Wondering how one would tackle UI state using this approach, in a similar manner to what’s…
Ryan Edge
11

This is an interesting question, and it depends on how you define the UI state.

For things like “loading”, having a boxed value to represent the status of the data is a reasonable strategy. There are downsides to that. E.g., JavaScript doesn’t support monad comprehensions, so the code manipulating the data will look ugly. There are other strategies (e.g., delegating this responsibility to the router).

If you define the UI state as “the color of a button”, then I actually prefer to have this state stored in the component itself. It’s more nuanced, of course.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.