Redux: It's small. Reducer == Controller? And State isn't an object model.

Random thoughts while learning redux.... (Subject to later revision.)

1. Redux is Small

Seriously. Go look:  https://github.com/reduxjs/redux/tree/master/src

2. Are Reducers the new Controllers?

"Actions" mostly seem to be generated from the UI, or from very close to it with very little logic in between.

The "Store" is just data. Period.

So what's left is the Reducer. And it starts from where the controller would start.

It might be worth pulling out business logic into some explicitly separated part. And that part could be all functional and testable, which seems like a good thing.

3. Object Model?

My OO Java brain likes the idea of an object model that understands the things you want to do and offers methods for doing them. But the Store is data-only. And it's supposed to look like a bunch of relational tables interlinked by ID values. So it doesn't seem to be acting like an Object model.

....But I really don't want to do ORM between JavaScript and other JavaScript in the browser.

I need more coffee.


Comments

Popular posts from this blog

Callback, Promise, Observable, and Doughnuts

Learn grid and grid-template-areas FIRST!!!

The Day TDD Started Working for Me