marcuswestin/store.js
Bindings forVERY WIP
This is:
- A template for your new ReasonReact project.
- A collection of thin examples illustrating ReasonReact usage.
- Extra helper documentation for ReasonReact (full ReasonReact docs here).
src
contains 4 sub-folders, each an independent, self-contained ReasonReact example. Feel free to delete any of them and shape this into your project! This template's more malleable than you might be used to =).
The point of this template and examples is to let you understand and personally tweak the entirely of it. We don't give you an opaque, elaborate mega build setup just to put some boxes on the screen. It strikes to stay transparent, learnable, and simple. You're encouraged to read every file; it's a great feeling, having the full picture of what you're using and being able to touch any part.
Run
npm installnpm run watch# in a new tab npm run example
Open a new web page to http://localhost:8000/
. Change any .re
file in example/
to try stuff out.
Store.js provides basic key/value storage functionality (get/set/remove/each
) as well as a rich set of plug-in storages and extra functionality.
- Basic Usage
- All you need to get started
- API
- Installation
- Supported Browsers
Basic Usage
All you need to know to get started:
API
Exposes a simple API for cross-browser local storage:
// Store current userlet test = {name: "Marcus"};Store.set("user", test); let test2 = {"name": "Janet"};Store.set("user2", test2); // Get current userlet marcus = Store.get("user");Js.log(marcus); let janet = Store.get("user2");Js.log(janet); // Remove current userStore.remove("user") // Clear all keysStore.clearAll()->ignore // Loop over all stored valueslet fn = (~value: 'a, ~namespacedKey: string) => Js.log3("logger", value, namespacedKey); Store.each(fn);
Installation
Using npm:
npm i store