package bonsai
A library for building dynamic webapps, using Js_of_ocaml
Install
Dune Dependency
Authors
Maintainers
Sources
bonsai-v0.16.0.tar.gz
sha256=1d68aab713659951eba5b85f21d6f9382e0efa8579a02c3be65d9071c6e86303
doc/bonsai.web/Bonsai_web/Rpc_effect/Polling_state_rpc/index.html
Module Rpc_effect.Polling_state_rpc
Source
Source
val dispatcher :
?on_forget_client_error:(Core.Error.t -> unit Bonsai.For_open.Effect.t) ->
('query, 'response) Polling_state_rpc.t ->
where_to_connect:Where_to_connect.t ->
('query ->
'response Core.Or_error.t Bonsai.For_open.Effect.t)
Bonsai.For_open.Computation.t
An effect for dispatching on a particular Polling_state_rpc with a particular query. When the computation is deactivated, it asks the server to cleanup any cached data, so that there is no memory leak. If this cleanup fails, then on_forget_client_error
is called with the error.
Source
val poll :
(module Bonsai.Model with type t = 'query) ->
(module Bonsai.Model with type t = 'response) ->
?clear_when_deactivated:bool ->
('query, 'response) Polling_state_rpc.t ->
where_to_connect:Where_to_connect.t ->
every:Core.Time_ns.Span.t ->
'query Bonsai.For_open.Value.t ->
('query, 'response) Poll_result.t Bonsai.For_open.Computation.t
A computation that periodically dispatches on a polling_state_rpc and keeps track of the most recent response. To explicitly re-send the RPC, schedule the refresh
field of the result. It also keeps track of the current query that is in-flight.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>