Skip to content

Instantly share code, notes, and snippets.

@miwillhite
Last active November 19, 2016 02:30
Show Gist options
  • Save miwillhite/6d12fefa992f3c2913004b9acefaf35c to your computer and use it in GitHub Desktop.
Save miwillhite/6d12fefa992f3c2913004b9acefaf35c to your computer and use it in GitHub Desktop.
var store = new TaskStore(reducer, actions.init({
tasks: {
incomplete: incompleteTasks,
complete: completedTasks,
},
}));
store.state.observe(function (state) { console.log(state) });
(function () {
'use strict';
var empty = R.empty;
function TaskStore () {
var dispatcher = mostSubject.subject();
return function constructor (reducer, initialState) {
this.state = dispatcher
.scan(reducer, head(initialState))
.thru(mostHold.default);
this.dispatch = dispatcher.next.bind(dispatcher);
return this;
};
}
angular
.module('task')
.factory('TaskStore', TaskStore);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment