This one is piece of cake in React. If you want your MobX store to be available in any React component, you just use mobx-react @inject
component. Something like:
import React from 'react';
import {inject} from 'mobx-react';
@inject('myStore')
class Dummy extends React.Component {
Then, my store is available as a prop:
this.props.myStore.myMethod();
Nice, convenient... and React only. Maybe I'm missing something, but I can't find a way to access my store from a plain ES6 class. How do I get the same result in a plain ES6 class in pure Vanilla Javascript?