Go to file
Geoff Doty 8975cbd0bd init commit 2019-06-24 14:45:14 -05:00
dist init commit 2019-06-24 14:45:14 -05:00
src init commit 2019-06-24 14:45:14 -05:00
test init commit 2019-06-24 14:45:14 -05:00
.eslintrc.json init commit 2019-06-24 14:45:14 -05:00
.gitignore init commit 2019-06-24 14:45:14 -05:00
CONTRIBUTING.md init commit 2019-06-24 14:45:14 -05:00
LICENSE init commit 2019-06-24 14:45:14 -05:00
README.md init commit 2019-06-24 14:45:14 -05:00
gulpfile.js init commit 2019-06-24 14:45:14 -05:00
package-lock.json init commit 2019-06-24 14:45:14 -05:00
package.json init commit 2019-06-24 14:45:14 -05:00

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
  • .get can be used as expression, false returned 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;)

License

MIT