use-remote-storage
v1.0.4
Published
React hook wrapping the remote-storage library.
Readme
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-storageUse
Provide the remote-storage configuration
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');Access the remote-storage instance
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.
