Useri gathers user input as
React signals and events from
a single rendering surface.
Open the module to use it, this defines only modules in your scope.
Useri.App.init is called all signals hold invalid data.
Caveat. Do not expect to be able to fully exploit the possibilities and flexibility of the platforms underlying the backends. This library is a simple abstraction library and thus remains limited by design.
Release 0.0.0-72-g9c6670f — Daniel Bünzli <daniel.buenzl email@example.com>
This minimal example can be used on both synchronous and asynchronous backends.
A good way of managing side-effects at the boundaries of your functional reactive system is to use a cooperative concurency library and convert event occurences and signal changes to yielding futures/threads (to avoid the problem of forbidden recursive primitive feedback) and convert futures/threads to a primitive event with a single occurence.
You will need however need to cooperate with
loop and give it a high priority as the ability to interact
should never take over a long running computation.
The following code shows how to do that with Lwt and Fut
Useri.Surface modules provide support for coordinating
input, animation and rendering. We can distinguish two patterns for
Useri.Surface.refreshevent, in this step you can sample signals needed for rendering (as long as they do not depend on
Useri.Surface.refreshoccurences simply generate a task that is run outside React's update step, this means that the signals needed for rendering can be safely sampled using
React.S.valuefor rendering data.
Useri.Surface.refreshevent. It is important to use this event for the following reasons:
E.never) you need steady refreshing, use
Useri.Surface.refreshoccurences are generated immediately after the following signals are created and updated:
E.selectthem and register the resulting event with