React Native Storage - v2.0.0
    Preparing search index...

    A namespace in one backend, with a cache that keeps hooks and items in sync.

    Create one per backend and namespace with createStorage, then declare typed items with Storage.item.

    Index
    namespace: string | undefined
    maxValueBytes: number

    The value limit in effect: the smaller of the option and the driver's own limit.

    • Declares a typed value stored under name. Cheap: call it once at module level.

      With a schema, the item's type is the schema's output and defaultValue must match it. Without one, pass the type (storage.item<string>('token')) or let defaultValue set it.

      Type Parameters

      Parameters

      Returns StorageItem<InferSchema<S>>

    • Declares a typed value stored under name. Cheap: call it once at module level.

      With a schema, the item's type is the schema's output and defaultValue must match it. Without one, pass the type (storage.item<string>('token')) or let defaultValue set it.

      Type Parameters

      Parameters

      Returns StorageItem<InferSchema<S> | undefined>

    • Declares a typed value stored under name. Cheap: call it once at module level.

      With a schema, the item's type is the schema's output and defaultValue must match it. Without one, pass the type (storage.item<string>('token')) or let defaultValue set it.

      Type Parameters

      • T

      Parameters

      Returns StorageItem<T>

    • Declares a typed value stored under name. Cheap: call it once at module level.

      With a schema, the item's type is the schema's output and defaultValue must match it. Without one, pass the type (storage.item<string>('token')) or let defaultValue set it.

      Type Parameters

      • T

      Parameters

      Returns StorageItem<T | undefined>

    • The key under which the driver stores name. Throws INVALID_KEY for a bad name.

      Parameters

      • name: string

      Returns string

    • Names (without the namespace) of every stored key in this namespace.

      Returns Promise<string[]>

    • Removes every key in this namespace (every key, without a namespace). Returns the count.

      Returns Promise<number>

    • Removes values whose TTL has passed. Returns how many were removed.

      Returns Promise<number>

    • Stops listening to the driver. Items keep working but no longer see outside changes.

      Returns void