Skip to content

Commit

Permalink
Added pointer to JSON variant.
Browse files Browse the repository at this point in the history
  • Loading branch information
eskimor committed Aug 10, 2016
1 parent 83f4c3e commit d29d844
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://travis-ci.org/eskimor/purescript-localstorage.svg?branch=master)](https://travis-ci.org/eskimor/purescript-localstorage)

Access JS webstorage (local & session) in a typesafe and convenient way.
Access JS webstorage (local & session) in a type-safe and convenient way.
Just define a key type with some smart constructors and you are done
(GADTs would even make those unnecessary).

Expand All @@ -16,6 +16,11 @@ also makes the API easier to use, because with the value type encoded
in the key type, type inference is always possible, even for a plain
`getItem` call. You will never need any type annotations!

The values you want to store should have a Generic instance, then
everything just works. Alternatively, if your type is not `Generic`, you can provide
`EncodeJson` and `DecodeJson` instances and use `getItem`, `setItem` and friends
from `DOM.WebStorage.JSON`.

Find a basic usage example in test/Example.purs, repeated here for convenience:

```purescript
Expand Down

0 comments on commit d29d844

Please sign in to comment.