So I’ve been learning Dan Abramov’s Redux library via the egghead.io video series, and after a short chat on Twitter, am diving into the examples in the Redux library.
So far, I’m really liking all the concepts, but struggling to close the loop on a couple of techniques and limitations that seem to be part of Redux.
The primary thing is that I mentally want to think about my data store differently than Redux wants to do the same; not the immutable part, that’s fine by me. Its the plain old javascript objects as the only examples I can find.
Now, all I want to be able to do with my classes is have them do two things that are orthogonal to the design of Redux, but I can’t figure out how to make it work, so here’s my attempt to reason about it.
I want to have my data store, and my actions, both be composed of ES6 objects. I plan to limit all methods on them to nearly-pure methods; they understand the context of themselves for building a new object to return; none of their methods mutate themselves, but they do assume knowledge of their object context.
So, here’s my naive example:
Thoughts?