API / Dom / Storage2

Storage2

The same as Dom.Storage, but with t on first argument position for proper -> usage.

t

type t

getItem

external getItem: (t, string) => option<string> = "getItem"

removeItem

external removeItem: (t, string) => unit = "removeItem"

clear

external clear: t => unit = "clear"

key

external key: (t, int) => option<string> = "key"

length

external length: t => int = "length"

localStorage

@bs.val external localStorage: t = "localStorage"

sessionStorage

@bs.val external sessionStorage: t = "sessionStorage"