Module Start.Handle
type ('input, 'extra, 'incoming, 'outgoing) tA handle represents a running app, and can be used to schedule external actions, determine if the app has started, and stop the app.
'inputis the input type of the outermost component of the app.'extrais any extra result (other than the app view) returned by the outermost component.
val stop : (_, _, _, _) t -> unitStops 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.tA deferred that resolves after the first display occurs. At this point, there is content being shown on the screen.
val schedule : (_, _, 'incoming, _) t -> 'incoming -> unitSchedules an event for an action of type
'incoming. This action gets routed to the Bonsai component that returned itsinjectfunction in theApp_result.t
val outgoing : (_, _, _, 'outgoing) t -> 'outgoing Async_kernel.Pipe.Reader.tReturns a pipe containing all of the actions of type
'outgoingthat the Bonsai app has scheduled.
val input : ('input, _, _, _) t -> 'inputReturns the value of the current input.
val set_input : ('input, _, _, _) t -> 'input -> unitOverwrites the current input.
val update_input : ('input, _, _, _) t -> f:('input -> 'input) -> unitA 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.tA bus containing successive values of
extrareturned by the app in itsApp_result.t.
val last_extra : (_, 'extra, _, _) t -> 'extra optionThe latest value written to
extra, if it exists.