State Charts (FSM) - AutoSponge/dev-notes GitHub Wiki
Vue
Conventions
- event types:
- SNAKE_CASE and all caps
- "NAMESPACE.WITH_DOT" (must be quoted) // !verify need
- verb words (e.g., SUMBIT, CLICK) or state-based event (e.g., FAIL => FAILURE)
- states:
- in config
- camelCase
- state/status words: loggedIn, loggedOut, loading (i.e., "the X state")
- services:
- in options object
- main mode of carrying external stimuli (events) to the machine
- actions:
- in options object
- uses
assign
to update context from event
data ((ctx, evt) => assign({prop: evt.prop})
- "fire-and-forget" side effects
- works like hooks "before, after, during"
- services:
- in options object
- used for communication between "actors"
- invoking:
- used for promises, callbacks, and other machines (onDone, onError)
- activities:
Resources