@debauchery1st/chillout-ra
v0.1.1
Published
freeze a slice of state
Downloads
3
Readme
@debauchery1st/chillout
freeze a slice of state.
Install
npm install @debauchery1st/chillout
Usage
const Chillout = require("@debauchery1st/chillout");
//Thaw will send your handler a decoded object
const handler = o => {
// in this example, 2 objects are being sent. state & history.
const { state } = o;
// we don't necessarily need the history object, but it may shed light during development.
setAppState(state);
};
// provide a route to the component or attach it to the end of a page.
<Chillout
contents={{ state: { ...appState }, history: { ...history } }}
onSubmit={handler}
/>;