package brr

  1. Overview
  2. Docs
Browser programming toolkit for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

brr-0.0.7.tbz
sha512=4b3d42eb6a32c1d6f1c5ef003f5311b5029156b31f6e51af098b695c769699e0304b66afd2dd574ecf1084e095bbbc4eac552daab083766cd81ed2f1d9897d51

doc/brr.ocaml_poke_ui/Brr_ocaml_poke_ui/Store/index.html

Module Brr_ocaml_poke_ui.Store

Persistent storage.

Basic interface to abstract over Brr_io.Storage and Web extension storage.

type t

The type for persistent storage.

val create : get:(Jstr.t -> Jstr.t option Fut.or_error) -> set:(Jstr.t -> Jstr.t -> unit Fut.or_error) -> t

store is a store with given get and set functions.

val page : ?key_prefix:Jstr.t -> Brr_io.Storage.t -> t

local_store is a store that uses Brr_io.Storage.local, with keys prefixed by key_prefix (defaults to "ocaml-repl-").

val webext : ?key_prefix:Jstr.t -> unit -> t

webext_store is a store using the Web extension storage. The "storage" premission must be added to the manifest.

val get : t -> Jstr.t -> Jstr.t option Fut.or_error

get s k is the value of key k in s (if any).

val set : t -> Jstr.t -> Jstr.t -> unit Fut.or_error

set s k v sets the value of k in s to v.

OCaml

Innovation. Community. Security.