0.1.4 • Published 7 months ago

@wezz/store-manager v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Store Manager

This is a script to make it easier to talk to localStorage and sessionStorage.

It will automatically transform stored JSON to objects.

It also makes use of prefixed store values. So you can have multiple instances of the storage manager using the same store values without having conflicts.

Installation

npm install @wezz/store-manager

Usage

Initialize Store Manager

import { StoreManager } from "@wezz/store-manager";
// On document ready
const storeManager = new StoreManager('prefix');
// Save to localStorage
storeManager.Set('keyname', {'jsondatakey': 'jsondatavalue'}, true);
// Save to sessionStorage
storeManager.Set('keyname', {'jsondatakey': 'jsondatavalue'});
storeManager.Get('keyname');

See demo/example1.js for more advanced usage

Development & Demo

Clone this repo Run npm install

To run the demo, run npm run dev

0.1.4

7 months ago

0.1.3

7 months ago

0.1.2

1 year ago

0.1.1

1 year ago

0.0.13

1 year ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago