@gphone/sdk
    Preparing search index...

    Function useStorage

    • OS Service Hook for app key-value storage.

      Parameters

      • appId: string

      Returns {
          clear: () => void;
          getItem: <T = unknown>(key: string, defaultValue?: T) => T | null;
          markUnsynced: (key: string) => void;
          removeItem: (key: string) => void;
          setItem: <T = unknown>(key: string, value: T) => void;
      }

      • clear: () => void

        The wall-side route for clearAppStorage (GPHONE-16 step 4): that facet is a bare function, not a factory, so a remoteCall naming it has no member to call. This member is what the iframe twin's clearAppStorage(appId) actually reaches.

      • getItem: <T = unknown>(key: string, defaultValue?: T) => T | null
      • markUnsynced: (key: string) => void

        Serves the iframe persisted twin's markUnsynced (GPHONE-16 step 4): an add-on cannot import settingsSync directly, so this is the one member of the facet that reaches it on the add-on's behalf.

      • removeItem: (key: string) => void
      • setItem: <T = unknown>(key: string, value: T) => void