Skip to content

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 Cross Page Local Storage

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.

Installation

npm install --save @shop3/react-cpls

Usage

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>
  )
}

Development

Installation

npm install

npm run husky:install

Development

npm run develop

Details


Assets

  • react-cpls-0.0.1-npm.tgz

Download activity

  • Total downloads 1
  • Last 30 days 0
  • Last week 0
  • Today 0

Recent versions

View all