package note

  1. Overview
  2. Docs

Module Note.LogrSource

Event and signal changes loggers.

Loggers are the output interface of the reactive system. They allow external entities to observe event occurrences and signal changes.

Observations

Sourcetype 'a obs

The type for observing changes of type 'a.

Sourceval const : 'a -> 'a obs

const v never changes and always observes v.

Sourceval app : ('a -> 'b) obs -> 'a obs -> 'b obs

app f v is the observation that result from applying the changes of f to the ones of v.

Sourceval ($) : ('a -> 'b) obs -> 'a obs -> 'b obs

f $ v is app f v.

Loggers

Sourcetype t

The type for loggers.

Sourceval create : ?now:bool -> unit obs -> t

create ~now o is a logger that observes changes to o. If now is true (default) logs at least one observation before the call returns.

Sourceval force : t -> unit

force l observes l even if nothing changed.

Sourceval destroy : t -> unit

destroy l destroys log l this ensure that l's does not observe any change again. The underlying observed events or signals also stop updating, unless they are observed by another logger.

Sourceval hold : t -> unit

hold l holds logger l to ensure it does not get garbage collected.

Sourceval may_hold : t option -> unit

may_hold l holds logger Some l to ensure it does not get garbage collected. Does nothing on None.

Sourceval unhold_all : unit -> unit

unhold_all () destroys and unholds all loggers held via hold.