How to use the autorun function from mobx
Find comprehensive JavaScript mobx.autorun code examples handpicked from public code repositorys.
602 603 604 605 606 607 608 609 610
relations: this.__activeRelations, comparator: comparator }); // Oh gawd MobX is so awesome. var events = mobx.autorun(function () { var models = _this7.filter(filter); store.models.replace(models); store.sort();
13
30
11
+ 3 other calls in file
GitHub: erobwen/causality
181 182 183 184 185 186 187 188 189 190
hobby: ['causality', 'muffins'], }; let xobj = mobx.observable(obj); mylist.push(xobj); mobx.autorun(function(){ count += xobj.hobby.length; }); } for( let element of mylist ){
1
20
3
+ 13 other calls in file
GitHub: distolma/mobx-crosstab
21 22 23 24 25 26 27 28 29 30
mobx.set(observable, value) } } catch (error) { } } mobx.autorun(function () { var value = isPropObservable ? target[key] : observable value = isBoxed ? observable.get() : value localStorage[name] = JSON.stringify(mobx.toJS(value))
0
1
0
+ 3 other calls in file
GitHub: mobxjs/mobx-utils
332 333 334 335 336 337 338 339 340 341 342 343
test("when creating a promise in a fulfilled state it should not fire twice, #36", (done) => { let events = 0 const obs = utils.fromPromise.resolve(3) mobx.autorun(() => { obs.state // track state & value obs.value events++ })
119
0
0
+ 2 other calls in file
33 34 35 36 37 38 39 40 41 42 43 44 45
} module.exports = ModifiableCodingRelatedSet; // const qs = new ModifiableCodingRelatedSet(1340, 10); // autorun(() => { // console.log("[autorun]", qs.questions.length); // }); // qs.resetCode("sq-1");
0
0
0
+ 2 other calls in file
GitHub: formegusto/study-reactjs
3 4 5 6 7 8 9 10 11 12
}; Object.defineProperty(exports, "__esModule", { value: true }); var mobx_1 = require("mobx"); var Message_1 = __importDefault(require("./types/Message")); var message = new Message_1.default("Foo", { name: "Michel" }, ["Joe", "Sara"]); var disposer = mobx_1.autorun(function () { console.log(message.title); mobx_1.trace(); }); message.updateTitle("Bar");
0
0
0
mobx.runInAction is the most popular function in mobx (1598 examples)