Skip to content

Conversation

@maxkueng
Copy link
Collaborator

@maxkueng maxkueng commented Apr 2, 2017

Removes the component-emitter dependency and replaces it with a built-in list of listeners.

Reasons

  • Reduce the build size
  • Emitter was used for just a single event type

API changes (breaking)

Previous:

const state = new Bibimbap();
function onCommit(tree, prev, cursor) {
  // stuff
}
state.on('commit', onCommit);
state.off('commit', onCommit);

New:

const state = new Bibimbap();
const unsubscribe = state.subscribe((tree, prev, cursor) => {
  // stuff
});
unsubscribe();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants