Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marcusstenbeck/801a2574ea521680631d63262362bfd7 to your computer and use it in GitHub Desktop.
Save marcusstenbeck/801a2574ea521680631d63262362bfd7 to your computer and use it in GitHub Desktop.
module.exports = function getShows(eventStore) {
return eventStore.getEvents()
.reduce((shows, event) => {
switch (event.type) {
case 'ShowAdded':
return [...shows, event.payload];
default:
return shows;
}
}, []);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment