UNPKG

277 BJavaScriptView Raw
1// @flow
2/* eslint
3 import/prefer-default-export: 0
4*/
5import { observable } from 'mobx';
6
7export class Counter {
8 @observable value = 0;
9
10 increase() {
11 this.value += 1;
12 }
13
14 decrease() {
15 this.value -= 1;
16 }
17
18 double() {
19 this.value = this.value * 2;
20 }
21}