use-remote-storage
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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

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.

Readme

Keywords

none

Package Sidebar

Install

npm i use-remote-storage

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

65.7 kB

Total Files

22

Last publish

Collaborators

  • calebmpeterson