Module Brr_io.Storage
Storage objects.
See Web Storage API
The type for Storage objects.
val local : Brr.Window.t -> Brr_io.Storage.tlocal w is the storage saved accross page sessions for the window's origin.
val session : Brr.Window.t -> Brr_io.Storage.tsession w is the storage cleared when the page session ends for the window's origin.
val length : Brr_io.Storage.t -> intlength s is the number of items in s.
val key : Brr_io.Storage.t -> int -> Jstr.t optionkey s i is the name of the ith key. (N.B. local storage can race with other tabs)
val get_item : Brr_io.Storage.t -> Jstr.t -> Jstr.t optionget_item s k is the value of k in s.
val set_item :
Brr_io.Storage.t ->
Jstr.t ->
Jstr.t ->
(unit, Jv.Error.t) Stdlib.resultset_item s k v sets the value of k to v in s. An error is returned if the value could not be set (no permission or quota exceeded).
val remove_item : Brr_io.Storage.t -> Jstr.t -> unitremove_item s k removes the value of k from s. If k has no value this does nothing.
val clear : Brr_io.Storage.t -> unitclear s removes all keys from s.
Events
module Ev : sig ... endStorage event.
val to_jv : Brr_io.Storage.t -> Jv.jvval of_jv : Jv.jv -> Brr_io.Storage.t