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"

setItem

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

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

@val external localStorage: t = "localStorage"

sessionStorage

@val external sessionStorage: t = "sessionStorage"