Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 659 Bytes

state-object.md

File metadata and controls

24 lines (17 loc) · 659 Bytes

State in the context of Stent

Full documentation


The state in the context of Stent is represented by a state object. The state object is just a normal object literal. The only one required property is name and it is used to indicate the state of the machine:

{
  name: 'idle',
  user: {
    firstName: '...',
    lastName: '...'
  },
  someOtherProperty: '...'
}

If you try transitioning to a state which is not defined into the transitions section or it has no actions in it Stent will throw an exception. It's because once you get into that new state you are basically stuck.


Full documentation