mjstahl / stated

Simply put state management for your JavaScript application

Home Page:https://www.npmjs.com/package/@mjstahl/stated

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support instantiation without an 'initial' property. Allow it to be set later.

mjstahl opened this issue · comments

const state = new Stated({
  hello: {
    value: 'hello',
    TOGGLE: 'goodbye'
  },
  goodbye: {
    value: 'goodbye',
    TOGGLE: 'hello'
  }
})

state.state //-> undefined

state.initial = 'hello'
state.state //-> 'hello'