npm.io
1.1.0 • Published 8 years ago

datx-keyvalue

Licence
MIT
Version
1.1.0
Deps
2
Size
270 kB
Vulns
0
Weekly
0

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

Keywords