I would like to use Mobx in React project (with Meteor) and create global Notification store with mobx-react.
I try to init the module, but I don't know why it returns an empty object :
import { observable } from 'mobx';
class NotificationStore {
@observable notifications = ['test', 'new notification'];
}
var store = window.store = new NotificationStore;
export default store;
And in my App.js :
import store from '../../components/NotificationStore';
console.log(store); // return Object { }
Anyone knows why my object is empty ?
Thank you community !
window.storesomewhere else in your code? - Thollestore.notifications.toJS()and you will see the values. - Thollestore.notifications.toJS(), thank you :) Maybe the problem is because it's on MeteorJS env .. thank you for your help ! - s-leg3ndz