|
|
||
|---|---|---|
| dist | ||
| src | ||
| test | ||
| .eslintrc.json | ||
| .gitignore | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
| gulpfile.js | ||
| package-lock.json | ||
| package.json | ||
README.md
State JS
simple spa state managment utility
WIP
Simple state managment utility for single-page-applications w/ optional localStorage caching with a tiny footprint
ALL values are JSONified
Features
- Tiny ~100 lines of JS
- Support both browser and NodeJS environments
.getcan be used as expression,falsereturned for all empty datatypes -- yes even{}&[]
Quick Start
include the library ONLY ONCE
const state = require('state.js');
or in browser
<script src="state.js"></script>
Options
state is a funciton that you can optionally pass in an options object
| Option | Descption | | cache | enable localStorage | | debug | display various console messages |
API
from there you have access to a simple api, get, set, remove, and clear
| Method | Description | | get(key) | get value by key | | set(key, val) | set value by key | | remove(key) | remove key | | clear() | destories all state data |
Support
Please open an issue for support.
Contributing
Anyone is welcome to contribute, however, if you decide to get involved, please take a moment to review the guidelines, there minimalistic;)