bigtestjs / server

All BigTest development has moved to https://github.com/thefrontside/bigtest
https://github.com/thefrontside/bigtest
2 stars 1 forks source link

Add a notion of state to the Orchestrator #57

Closed jnicklas closed 4 years ago

jnicklas commented 4 years ago

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:

jnicklas commented 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 🤷‍♂

jnicklas commented 4 years ago

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.