react

"mulling over state management stuff"
ordnungswidrig 2021-04-16T13:18:32.102400Z

@raspasov what about an approach like cursors/subscription? You still “predent” to have a global and pure sate but enable isolated and faster change for these components?

raspasov 2021-04-17T16:19:19.106Z

The discussion about cursors/subscriptions can be a long one. But the short answer is: I’m not convinced “subscriptions” are a good abstraction.

raspasov 2021-04-17T16:22:29.110Z

There was an analogy from a Rich Hickey talk. It goes something like: “if we are all watching a game at the stadium, we can all watch uninterrupted. Nobody needs to “subscribe” to the game.” I’m generally very weary of abstractions that try to simulate the wrong physics and “subscriptions”, as commonly described, seem to me to fall in that category.

ordnungswidrig 2021-04-19T08:28:14.110400Z

good points.

ordnungswidrig 2021-04-19T08:29:26.110600Z

To me cursors is about two things: • focus (think “lens”) on a specifiy part of the global state for isolation (component does not need to know where in the global state to main it’s state) • isolation (does the components state affect the global state)

ordnungswidrig 2021-04-19T08:29:39.110800Z

For performance reasons the latter can be interesting.

ordnungswidrig 2021-04-16T13:19:17.103300Z

IOW having a state like {:foo :bar :sub {:something "different" :fast-paced-counter (atom 0)}} ?

orestis 2021-04-16T16:41:17.103900Z

Reseda has subscriptions for this kind of thing.