@coaction/mobx
v0.1.5
Published
A Coaction integration tool for MobX
Downloads
252
Readme
@coaction/mobx
A Coaction integration tool for MobX
Installation
You can install it via npm, yarn or pnpm.
npm install coaction @coaction/mobx
Usage
import { create } from 'coaction';
import { bindMobx } from '@coaction/mobx';
import { makeAutoObservable } from 'mobx';
const useStore = create(() =>
makeAutoObservable(
bindMobx({
name: 'test',
count: 0,
get double() {
return this.count * 2;
},
increment() {
this.count += 1;
}
})
)
);
Documentation
You can find the documentation here.