Skip to content

Instantly share code, notes, and snippets.

@JefClaes
Created December 29, 2013 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JefClaes/8174136 to your computer and use it in GitHub Desktop.
Save JefClaes/8174136 to your computer and use it in GitHub Desktop.
Failing ES projection
fromAll().when({
$init: function () {
return { };
},
$any: function(state, event) {
var eventType = event.eventType;
if (state.hasOwnProperty(eventType)) {
state[eventType] += 1;
} else {
state[eventType] = 1;
}
return state;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment