1.1.0 • Published 6 years ago

datx-keyvalue v1.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

datx-keyalue

Greenkeeper badge Build Status npm version

DatX is an opinionated data store for use with the MobX state management library. It features support for simple observable property definition, references to other models and first-class TypeScript support.

datx-keyvalue is a datx mixin that adds key value store support.


Basic usage

import { Collection } from 'datx';
import { keyValue, KeyValue } from 'datx-keyvalue';

class AppData extends keyValue(Collection) {
  public static types = [KeyValue];
}

const appData = new AppData();

appData.keyValues.add('currentUserId', 1);
console.log(appData.keyValues.get('currentUserId')); // => 1

License

The MIT License