Skip to content

Remove component-emitter dependency#2

Open
maxkueng wants to merge 1 commit into
masterfrom
remove-component-emitter
Open

Remove component-emitter dependency#2
maxkueng wants to merge 1 commit into
masterfrom
remove-component-emitter

Conversation

@maxkueng

@maxkueng maxkueng commented Apr 2, 2017

Copy link
Copy Markdown
Collaborator

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.

1 participant