use-remote-storage
React hook wrapping the remote-storage library.
Installation
This library is published in the NPM registry and can be installed using any compatible package manager.
npm install use-remote-storage --save
# For Yarn, use the command below.
yarn add use-remote-storage
Use
remote-storage
configuration
Provide the import { RemoteStorageProvider } from 'use-remote-storage';
<RemoteStorageProvider userId={...} instanceId="my-awesome-app">
...
</RemoteStorageProvider>
Read and write values
import { useRemoteStorage } from 'use-remote-storage';
// within any functional component
const { status, value, setValue, refresh } = useRemoteStorage('my-key');
remote-storage
instance
Access the import { useRemoteStorageInstance } from 'use-remote-storage';
// within any functional component
const remoteStorage = useRemoteStorageInstance();
Documentation
Documentation generated from source files by Typedoc.
License
Released under MIT License.