package jsoo_storage
Module WebStorage.LocalSource
Support for LocalStorage
This type represents a changeset on the storage
Dump a changestate (mainly for debugging)
is_supported () returns true if the current storage is supported by the browser, false otherwise.
The length read-only property of the Storage interface returns an integer representing the number of data items stored in the Storage object.
When passed a key name, will return that key's value. (Wrapped into an option)
When passed a key name and value, will add that key to the storage, or update that key's value if it already exists.)
When invoked, clears all stored keys.
When passed a number n, returns the name of the nth key in the storage. The order of keys is user-agent defined, so you should not rely on it.
find p returns the first element of the storage that satisfies the predicate p. The result is wrapped into an option.
select p returns all the elements of the storage that satisfy the predicate p. The results is an Hashtbl.t of the results.
val on_change :
?prefix:string ->
(change_state -> url -> unit) ->
Js_of_ocaml.Dom.event_listener_idon_change f trigger f at each changement of the storage. (You can use a prefix to trigger the events only if it concerns a set of keys (with the gived prefix))
on_clear f trigger f at each clear of the storage.
val on_insert :
?prefix:string ->
(key -> value -> url -> unit) ->
Js_of_ocaml.Dom.event_listener_idon_insert f trigger f at each insertion in the storage. (You can use a prefix to trigger the events only if it concerns a set of keys (with the gived prefix))
val on_remove :
?prefix:string ->
(key -> old_value -> url -> unit) ->
Js_of_ocaml.Dom.event_listener_idon_remove f trigger f at each remove in the storage. (You can use a prefix to trigger the events only if it concerns a set of keys (with the gived prefix))