2.1.2 • Published 3 years ago

epicles v2.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Epicles

Build Status NPM Package

A small periodic event emitter

Installation

npm install --save epicles

Usage

import { epicles } from 'epicles';

// create an emitter with initial state [0, 0, 0]
const emitter = epicles({
    steps: 4,
    steppers: 3,
});

emitter.subscribe((event) => {
    console.log(event);
});

emitter.tick(); // [{ step: 1, stepper: 0 }]
emitter.tick(); // [{ step: 2, stepper: 0 }]
emitter.tick(); // [{ step: 3, stepper: 0 }]
emitter.tick(); // [{ step: 0, stepper: 0 }, { step: 1, stepper: 1 }]
emitter.tick(); // [{ step: 1, stepper: 0 }]

Test

npm run test

License

MIT

2.1.2

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago