Module Futr

Futures as React events and vice-versa.

%%VERSION%% — homepage

Events

val to_event : ?⁠never:'a -> (unit -> 'a Fut.t) -> 'a React.event

to_event f occurs once when f () determines. If f is set to never determine the event never occurs unless never is specified in which case it occurs with the value never.

Important. It is better if f actually creates the future rather than being a closure that captures an already created future. The reason is that TODO.

val of_event : 'a React.event -> 'a Fut.t

of_event e is a future that determines on the next occurence of e.

Note. The React update step generating the occurence of s is guaranteed to terminate before the future determines.