paint-brush
Let’s play “Spot the reducer” game.by@hackernoon-archives

Let’s play “Spot the reducer” game.

by HackerNoon ArchivesOctober 28th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Let’s play “Spot the reducer” game.

Company Mentioned

Mention Thumbnail
featured image - Let’s play “Spot the reducer” game.
HackerNoon Archives HackerNoon profile picture

Let’s play “Spot the reducer” game.

export const actions = store => ({
  increment: state => ({ count: state.count + 1 }),
  decrement: state => ({ count: state.count - 1 })
})

I see two. ;-) How many can you spot?

This is a nice approach and there are few action/reducer creator libraries wrapping Redux accomplishing the same or similar result.

Why would one want to wrap Redux library instead rewriting it in 1k? See http://wiki.c2.com/?RewriteCodeFromScratch