I agree with user1628461, but if your application grows, it can be problematic to repeatedly pass the store as an argument.

A possibility you have is to first initialise your store, to then pass it as parameter when initialising your helper class. This way you can save a reference to the store, its observables, and access it when needed. See example:


import Store from './store.jsx'
import Helper from './helper.jsx'

const myStore = new Store();
const myHelper = new Helper(myStore);



export default class Helper {

  constructor(store){ = store;

  doSomething() {
    // do something with the store; = 'modified';

Related Query

More Query from same tag