miso-0.21.1.0: A tasty Haskell front-end framework

Copyright(C) 2016-2018 David M. Johnson
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <djohnson.m@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Miso.Effect.Storage

Contents

Description

This module provides an interface to the Web Storage API.

Synopsis

Retrieve storage

getLocalStorage :: FromJSON model => JSString -> JSM (Either String model) Source #

Retrieve local storage

getSessionStorage :: FromJSON model => JSString -> JSM (Either String model) Source #

Retrieve session storage

Set items in storage

setLocalStorage :: ToJSON model => JSString -> model -> JSM () Source #

Set the value of a key in local storage.

setLocalStorage key value sets the value of key to value.

setSessionStorage :: ToJSON model => JSString -> model -> JSM () Source #

Set the value of a key in session storage.

setSessionStorage key value sets the value of key to value.

Remove items from storage

Clear storage

Get number of items in storage