Interface for providing custom storage implementations for react Native.

This interface should only be used when customizing the storage mechanism used by the SDK. Typical usage of the SDK does not require implementing this interface.

Implementations may not throw exceptions.

The SDK assumes that the persistence is only being used by a single instance of the SDK per SDK key (two different SDK instances, with 2 different SDK keys could use the same persistence instance).

The SDK, with correct usage, will not have overlapping writes to the same key.

This interface does not depend on the ability to list the contents of the store or namespaces. This is to maintain the simplicity of implementing a key-value store on many platforms.

Hierarchy

  • RNStorage

Properties

Properties

clear: ((key) => Promise<void>)

Type declaration

    • (key): Promise<void>
    • Clear the value associated with a given key.

      After clearing a key subsequent calls to the get function should return null for that key.

      Parameters

      • key: string

        The key to clear the value for.

      Returns Promise<void>

      A promise that resolves after that operation completes.

get: ((key) => Promise<null | string>)

Type declaration

    • (key): Promise<null | string>
    • Get a value from the storage.

      Parameters

      • key: string

        The key to get a value for.

      Returns Promise<null | string>

      A promise which resolves to the value for the specified key, or null if there is no value for the key.

set: ((key, value) => Promise<void>)

Type declaration

    • (key, value): Promise<void>
    • Set the given key to the specified value.

      Parameters

      • key: string

        The key to set a value for.

      • value: string

        The value to set for the key.

      Returns Promise<void>

      A promise that resolves after the operation completes.

Generated using TypeDoc