sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
A plugin is a bunch of commands, and optionally some disk-backed state. It will register its commands to the core loop
type json = Yojson.Safe.json
type action_callback = action Signal.Send_ref.t
and 'st stateful_ = private {
name : string;
commands : 'st -> Command.t list;
on_msg : 'st -> (Core.t -> Irc_message.t -> unit Lwt.t) list;
to_json : 'st -> json option;
of_json : action_callback -> json option -> ('st, string) Result.result Lwt.t;
stop : 'st -> unit Lwt.t;
}
type plugin = t
val stateful :
name:string ->
commands:('st -> Command.t list) ->
?on_msg:('st -> (Core.t -> Irc_message.t -> unit Lwt.t) list) ->
to_json:('st -> json option) ->
of_json:(action_callback -> json option -> ('st, string) Result.result Lwt.t) ->
?stop:('st -> unit Lwt.t) ->
unit ->
t
Make a stateful plugin using the given name
(for prefixing its storage; this should be unique) and ways to serialize state to Json, deserialize state from Json, and building commands from the state. See stateful_
for more details on each field.
module Set : sig ... end