Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Latest commit

 

History

History
38 lines (27 loc) · 643 Bytes

README.md

File metadata and controls

38 lines (27 loc) · 643 Bytes

FV Store

Fast and simple key = value storage

Installation

npm install --save fv-store

Usage

import Store from "fv-store";

Store.set({
    user: {
        firstName: 'James',
        lastName: 'Craig'
    }
});

console.log(Store.get('user.firstName', 'defaultValue'));

Subscriptions

Subscriptions are a way of listening for events on the store.

const subscription = Store.subscribe('update', store => {
    console.log(store);
});

// If you are running a single page application, make sure you unsubscribe
// from an event when you are finished with it.
Store.unsubscribe(subscription);