Up

Module Update_queue = Update_queue

Signature

type ('perm, 'state) t
val create : ?init:'state -> unit -> ([< ], 'state) t
val init : (Core.Std.read_write, 'state) t -> 'state -> unit
val enqueue : (Core.Std.read_write, 'state) t -> ('state -> 'state) -> unit
val watch : (_, 'state) t -> f:('state -> unit) -> unit

watch t f will call f every time that that t's state is updated. f should not call enqueue_update.

val map : (_, 'state1) t -> f:('state1 -> 'state2) -> (Core.Std.read, 'state2) t
val read_only : ([> ], 'state) t -> (Core.Std.read, 'state) t