4.3.2 • Published 10 months ago

cogwheel v4.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Cogwheel - simple JavaScript state machines

npm.io Node version NPM Downloads Minified size License: MIT

Simple finite state machines that can be used for state/process management.

Principles

Cogwheel is build around the following principles around state machines, and the library should be used as such:

  • State transitions are synchronous & fire & forget by design;
  • State transisions should not have side-effects, except for debugging purposes (e.g. console-log);
  • The context should be serializable;
  • All state & context mutations should be owned by the machine and its actions. This means as much (business) logic as possible should be included in the machine and its actions.

Getting started

Guards

Actions

Hierarchical machines

Front-end framework implementation

State machine examples

Migration v3.x.x > v4.x.x

  • Remove all import { send, assign } from 'cogwheel';;
  • Replace input parameters of all actions
const exampleAction({ state, event, assign, send }) {}
4.3.2

10 months ago

4.3.1

10 months ago

4.3.0

10 months ago

4.2.6

2 years ago

4.2.3

2 years ago

4.2.2

2 years ago

4.2.5

2 years ago

4.2.4

2 years ago

4.2.1

2 years ago

4.1.0

3 years ago

4.0.0

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

4 years ago