simple-state

Simple State for SPAs

Build Status codecov

Install

npm install simple-state or yarn add simple-state

ES Module

import SimpleState from 'simple-state';

Getting Started

After importing the library, you can create as many instances as you'd like (but likely should not).

store = new SimpleState({ amiibo: [] });

Then you can update the State:

store.updateStore({ myValue: "isNotEmpty" });

You can get state:

store.getState();

Previous state:

store.getPreviousState();

and initial state:

store.getInitialState();

and to JSON for API calls:

store.toJSON();

Changelog

  • 1.0.0-beta.0 - Initial release