mjstahl / stated

Simply put state management for your JavaScript application
https://www.npmjs.com/package/@mjstahl/stated
MIT License
4 stars 0 forks source link

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

Closed mjstahl closed 5 years ago

mjstahl commented 5 years ago
const state = new Stated({
  hello: {
    value: 'hello',
    TOGGLE: 'goodbye'
  },
  goodbye: {
    value: 'goodbye',
    TOGGLE: 'hello'
  }
})

state.state //-> undefined

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