0.1.1 • Published 4 years ago

@debauchery1st/chillout-ra v0.1.1

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

@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}
/>;