react-cpls 0.0.1
Install from the command line:
Learn more about npm packages
$ npm install @shop3/react-cpls@0.0.1
Install via package.json:
"@shop3/react-cpls": "0.0.1"
About this version
React provider to simplify localStorage usage, when the storage is updated the new value is reflected across the whole application and on other opened pages.
npm install --save @shop3/react-cpls
import React, { useEffect } from 'react';
import { StorageProvider, useStorage } from '@shop3/react-cpls';
const App = () => {
return (
<StorageProvider>
{/* app here */}
</StorageProvider>
)
}
const Example = () => {
const storage = useStorage();
useEffect(() => {
storage.setItem('test', 'test value');
}, [storage]);
return (
<p>{storage.getItem('test')}</p>
)
}
npm install
npm run husky:install
npm run develop
Details
- react-cpls
- shop3
- over 2 years ago
- MIT
- 26 dependencies
Assets
- react-cpls-0.0.1-npm.tgz
Download activity
- Total downloads 1
- Last 30 days 0
- Last week 0
- Today 0