Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Listen for events and reduce them to a state
- const state$ = app.store((state, event) => {
- // Initial state
- if (state === null) state = 0
- // Build state
- switch (event.event) {
- case 'Decrement':
- state--
- break
- case 'Increment':
- state++
- break
- }
- return state
- })
Add Comment
Please, Sign In to add comment