Module Brr_io.Storage
Storage
objects.
See Web Storage API
type t
The type for
Storage
objects.
val local : Brr.Window.t -> t
local w
is the storage saved accross page sessions for the window's origin.
val session : Brr.Window.t -> t
session w
is the storage cleared when the page session ends for the window's origin.
val length : t -> int
length s
is the number of items ins
.
val key : t -> int -> Jstr.t option
key s i
is the name of thei
th key. (N.B. local storage can race with other tabs)
val set_item : t -> Jstr.t -> Jstr.t -> (unit, Jv.Error.t) Stdlib.result
set_item s k v
sets the value ofk
tov
ins
. An error is returned if the value could not be set (no permission or quota exceeded).
val remove_item : t -> Jstr.t -> unit
remove_item s k
removes the value ofk
froms
. Ifk
has no value this does nothing.
Events
module Ev : sig ... end
Storage event.