Added errors store with tests

This commit is contained in:
Jori Lallo
2017-05-22 22:16:47 -07:00
parent 3353eb913a
commit 2a8cc80a86
3 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
// @flow
import { observable, action } from 'mobx';
class UiStore {
@observable errors = observable.array([]);
/* Actions */
@action add = (errorMessage: string): void => {
this.errors.push(errorMessage);
};
@action remove = (index: number): void => {
this.errors.splice(index, 1);
};
}
export default UiStore;