r/javascript • • Oct 21 '18

Writing Redux in 15 lines of code

https://medium.com/@dominictobias/6d317b521719
3 Upvotes

2 comments sorted by

36

u/soft-wear Oct 22 '18

One of the key components to Redux is immutable state, and the first thing you do is write a class that directly mutates state and call it "Redux in 15 lines'. It isn't Redux, it's a basic mutable store. You lack a means to combine multiple reducers, your implementation can't support middleware (not doesn't, it can't in it's 15 line form).

How about we stop with the stupid click-bait and just write an article on a simple state store instead of claiming you did something you absolutely didn't?