0.17.0 • Published 6 years ago
flow-runtime-mobx v0.17.0
flow-runtime-mobx
Adds mobx support to flow-runtime.
Why?
Because mobx observables don't pass standard checks like Array.isArray(observableArray)
or observableMap instanceof Map
.
Installation
npm install flow-runtime-mobx
or
yarn add flow-runtime-mobx
Usage
Before you use any observable objects you must register the types:
import t from 'flow-runtime';
import * as mobx from 'mobx';
import flowRuntimeMobx from 'flow-runtime-mobx';
flowRuntimeMobx(t, mobx); // only need to do this once.
You are now free to use ObservableArray
and ObservableMap
in place of their native
equivalents thoughout your app:
import {observable, ObservableMap} from 'mobx';
type Thing = {
numbers: number[];
map: Map<string, string>;
};
const thing: Thing = observable({
numbers: [1, 2, 3],
map: new ObservableMap({foo: 'bar'})
});
console.log(thing);
0.17.0
6 years ago
0.16.0
6 years ago
0.15.0
6 years ago
0.14.0
7 years ago
0.13.0
7 years ago
0.12.0
7 years ago
0.11.1
7 years ago
0.11.0
7 years ago
0.10.0
7 years ago
0.9.1
7 years ago
0.9.0
7 years ago
0.8.0
7 years ago
0.7.0
7 years ago
0.6.1
7 years ago
0.6.0
7 years ago
0.5.0
7 years ago
0.4.0
7 years ago
0.3.0
7 years ago
0.2.1
7 years ago
0.2.0
7 years ago
0.1.0
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago