Closed jnicklas closed 4 years ago
I'm really very new to this style of programming, and I'm making it up as I go along. I think it feels pretty nice, but 🤷♂
Gonna go ahead and merge this, I think we proved yesterday that this is a decent direction to take this in, so let's build on this.
The orchestrator allocates an object of type State which is basically a state container. This is sort of similar to state in React in that we have one method of updating the state, which takes the current state and returns a new state object.
Any manipulation of state is supposed to be pure, and not make mutative changes to the current state. To facilitate this we're using lenses as provided by the Ramda library. I've also added a few helper functions on
State
to make it easier to work with lenses.This implementation has a few benefits:
update
method, which means it should be fairly simple to add watch queries and similar which depend on changing state.