Composing State
Last updated
Last updated
We advocate for creating atomic state and to compose new state when you need to.
There are several composition operations that you can perform and that we will see below.
One key aspect of composing state is that it returns another ConanState, which you can compose again.
We can derive one state into a new one using ConanState.map:
We can filter 1 state into a new one using ConanState.filter:
We can merge 2 states into 1 using ConanState.merge:
We can combine N states into a new one using ConanState.combine: