2.0.8 • Published 6 years ago

@ludens-reklame/preserve v2.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

Preserve

A state lib for keeping track of and change localStorage data

Build Status PRs Welcome

Install

 npm install @ludens-reklame/preserve

or with Yarn

yarn add @ludens-reklame/preserve

Basic usage

import preserve from '@ludens-reklame/preserve';

// Make an item you want to keep track of.
const myItem = preserve('myData');

// Get the current data from localStorage
myItem.get();

// Update the localStorage data.
myItem.set(2);

// Listen to changes that happens within your localStorage item
myItem.subscribe(nextData => {
  console.log(nextData); // 2
});

// Clear the item from localStorage
myItem.clearItem();
2.0.8

6 years ago

2.0.7

7 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago