1.1.2 • Published 4 years ago

@skarllet/state-machine v1.1.2

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

Node.js Package

State Machine

This module is destinated to manage the state of the Agent;

How to use

Install

npm install @skarllet/state-machine

Usage

// To use the module inside Node JS
const StateMachine = require('@skarllet/state-machine')

// Create the State Machine instance,
const sm = StateMachine.create();

// Define the states
sm.add('state:foo', async ({ change }) => change('state:bar'))
sm.add('state:bar', async () => {})

// Bootstrap the events by changing the first state
sm.change('state:foo');
1.1.2

4 years ago

1.1.0

4 years ago