datx-keyvalue
v1.1.0
Published
DatX mixin for key value store
Downloads
4
Readme
datx-keyalue
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