Once Meiosis is set up either with Function Patches or Mergerino, you have a stream of cells.
Each cell has state
and update
to read the state and update the state. Normally you use
cells.map
to render the view on each state change.
Here is the setup code for Mithril:
In the setup above, m.redraw()
is called for every state change. This may or may not be acceptable
depending in the application. If the application triggers many state changes very rapidly (such as
tracking the mouse), it is preferable to remove the m.redraw()
code:
cells.map(() => m.redraw());
Redraws will still happen by virtue of Mithril's
auto-redraw system. However, they will not happen for
state changes outside of the auto-redraw system. For those state changes, m.redraw()
needs to be
called after updating the state.
Here is the setup code for Preact:
Here is the setup code for React: