package bonsai
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=43f35d648644492d776bf2c7b86c8227e7793615b6a658432e95f8dccd3631f8
md5=b5e743dbfa64d0da5fd660f14cd0b549
doc/bonsai.web/Bonsai_web/Start/Handle/index.html
Module Start.Handle
A handle represents a running app, and can be used to schedule external actions, determine if the app has started, and stop the app.
'input
is the input type of the outermost component of the app.'extra
is any extra result (other than the app view) returned by the outermost component.
val stop : (_, _, _, _) t -> unit
Stops the application from updating or responding to any actions. The app cannot be restarted. The displayed contents are not removed from the page.
val started : (_, _, _, _) t -> unit Async_kernel.Deferred.t
A deferred that resolves after the first display occurs. At this point, there is content being shown on the screen.
val schedule : (_, _, 'incoming, _) t -> 'incoming -> unit
Schedules an event for an action of type 'incoming
. This action gets routed to the Bonsai component that returned its inject
function in the App_result.t
val outgoing : (_, _, _, 'outgoing) t -> 'outgoing Async_kernel.Pipe.Reader.t
Returns a pipe containing all of the actions of type 'outgoing
that the Bonsai app has scheduled.
val input : ('input, _, _, _) t -> 'input
Returns the value of the current input.
val set_input : ('input, _, _, _) t -> 'input -> unit
Overwrites the current input.
val update_input : ('input, _, _, _) t -> f:('input -> 'input) -> unit
A helper method for fetching the current input and providing an updating function that returns a new input. This is to make functionally updating data structures easier.
val extra : (_, 'extra, _, _) t -> ('extra -> unit) Bus.Read_only.t
A bus containing successive values of extra
returned by the app in its App_result.t
.
val last_extra : (_, 'extra, _, _) t -> 'extra option
The latest value written to extra
, if it exists.