- Introduction
- Introduction to MobX
- 2. Core API
- Best Practices For Large Apps
- How does MobX work?
- Tips & Tricks
- 5.1. DevTools
- 5.2. ES5 / ES6 / TypeScript syntax
- 5.3. Optimizing MobX
- 5.4. Testing
- 5.5. Stateless Components and Hot Module Reloading
- 6. Examples, related projects
- 7. Frequently Asked Questions
- Advanced API
- Published with GitBook
MobX
Edit This Page This are utilities exposed by MobX which might come in handy at some point. But most probably you won't need them. Ever.
SimpleEventEmitter
Constructorless class that can be used to register and emit events. Mainly here for internal purposes.
```javascript const eachSecondEvent = new mobx.SimpleEventEmitter();
setInterval(() => { eachSecondEvent.emit(new Date(), Date.now()); }, 1000);
// fires each second eachSecondEvent.on((dateObject, epoch) => { console.log(dateObject, epoch); });
// fires only once eachSecondEvent.once((dateObject, epoch) => { console.log(dateObject, epoch); });