mobx-localstorage
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

mobx-localstorage

A declarative reactive localStorage using MobX

Install

yarn add mobx-localstorage
npm i -S mobx-localstorage

Features

  • Higher performance than native getter
  • Synchronize with external changes
  • Support native APIs and MobX APIs

Usage

Same as native but can be observed by MobX

import { autorun } from 'mobx';
import localStorage from 'mobx-localstorage';
 
autorun(() => {
  console.log(localStorage.getItem('foo'));
});
 
localStorage.setItem('foo', 'bar');
 
// print bar

Readme

Keywords

Package Sidebar

Install

npm i mobx-localstorage

Weekly Downloads

941

Version

1.2.0

License

MIT

Unpacked Size

40.7 kB

Total Files

7

Last publish

Collaborators

  • aihornmac