Skip to content

Commit

Permalink
Merge pull request #50 from vslinko/next-auto-bind
Browse files Browse the repository at this point in the history
createDispatcher should return binded functions
  • Loading branch information
gaearon committed Jun 6, 2015
2 parents a2887ae + 7a2bd6a commit 461cf11
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/createDispatcher.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import Dispatcher from './Dispatcher';

export default function createDispatcher(...args) {
return new Dispatcher(...args);
const dispatcher = new Dispatcher(...args);

return {
subscribe: ::dispatcher.subscribe,
perform: ::dispatcher.perform,
hydrate: ::dispatcher.hydrate,
dehydrate: ::dispatcher.dehydrate,
};
}

0 comments on commit 461cf11

Please sign in to comment.