0.4.1 • Published 12 months ago

@bleckert/state v0.4.1

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

Install

npm i @bleckert/state or yarn add @bleckert/state

Usage

import Machine from '@bleckert/state';

const machine = new Machine({
    IDLE: {
        on: {
            send: 'SENDING',
        },
    },
    SENDING: {
        on: {
            sent: 'SENT',
            failed: 'ERROR',
        },
    },
    SENT: {
        final: true,
    },
    FAILED: {
        on: {
            retry: 'SENDING',
        },
    },
});

machine.onState('SENDING', console.log);
machine.dispatch('send');
0.4.1

12 months ago

0.4.0

12 months ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago