Created
January 17, 2018 20:03
-
-
Save marcusstenbeck/801a2574ea521680631d63262362bfd7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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