module States:sig..end
type'acallback =('a -> unit) -> unit
val register_value : page:Doc.page ->
name:string ->
descr:Markdown.text ->
?details:Markdown.block ->
output:'a Request.output ->
get:(unit -> 'a) -> ?add_hook:unit callback -> unit -> Request.signal<name>.sig is emitted on value updates;<name>.get returns the current value.~add_hook option is used to register a hook to notify the
server of value updates. The hook will be installed only once the client
starts to listen for value updates.
Inside Ivette you can use the States.useSyncValue(id) hook to
synchronize with this value.
val register_state : page:Doc.page ->
name:string ->
descr:Markdown.text ->
?details:Markdown.block ->
data:'a Data.data ->
get:(unit -> 'a) ->
set:('a -> unit) -> ?add_hook:unit callback -> unit -> Request.signal<name>.sig is emitted on value updates;<name>.get returns the current value;<name>.set modifies the server value.~add_hook option is used to register a hook to notify the
server of value updates. The hook will be installed only once the client
starts to listen for value updates.
Inside Ivette you can use the States.useSyncState(id) hook to
synchronize with this state.
type 'a model
val model : unit -> 'a modelval column : model:'a model ->
name:string ->
descr:Markdown.text ->
data:'b Request.output -> get:('a -> 'b) -> unit -> unittype 'a array
val reload : 'a array -> unitval update : 'a array -> 'a -> unitval remove : 'a array -> 'a -> unitval signal : 'a array -> Request.signalval register_array : page:Doc.page ->
name:string ->
descr:Markdown.text ->
?details:Markdown.block ->
key:('a -> string) ->
iter:'a callback ->
?add_update_hook:'a callback ->
?add_remove_hook:'a callback ->
?add_reload_hook:unit callback -> 'a model -> 'a array<name>.sig is emitted on array updates;<name>.fetch is registered to get updates;<name>.reload is registered to trigger a full reload.~key parameter is used to identify array entries, and used to fill
the reserved column "id" of entries.
Columns added to the model after registration are not taken into account.
If provided, the ~add_xxx_hook options are used to register hooks
to notify the server of corresponding array updates.
Each hook will be installed only once the client starts to listen for array
updates.
Inside Ivette you can obtain the entries in sync by using the
States.useSyncArray() hook.