2.0.3 • Published 3 years ago

statemitter v2.0.3

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

Statemitter

A library for observing when state changes.

Installation

npm i --save statemitter

Example

import statemitter from 'statemitter';

const [state, applyState, subscribeState] = statemitter({
  number: 1
});

const unsubscribe = subscribe(function () {
  console.log('state has changed');
});

applyState({
  number: state.number + 1;
});

setTimeout(() => {
  unsubscribe()
}, 500);

Developing

There is an example web application that uses statemitter.

git clone https://github.com/markwylde/statemitter.git
cd statemitter
npm install
npm run start

Then visit:

http://localhost:8080

2.0.3

3 years ago

2.0.2

3 years ago

2.0.0

3 years ago

1.1.0

3 years ago

1.0.1

4 years ago

1.0.0

4 years ago