goatslacker / alt

Isomorphic flux implementation
http://alt.js.org/
3.45k stars 323 forks source link

Create store ReferenceError when Store Class only has constructor #625

Open bmatto opened 8 years ago

bmatto commented 8 years ago

I have a simple store ...

import alt from 'altInstance';
import ActivityActions from '../actions/Activity.actions';

class ActivtyStore {

  constructor () {
    this.bindActions(ActivityActions);
  }
}

export default alt.createStore(ActivtyStore);

With that i'm getting a ReferenceError: ActivityStore is not defined from alt Object.createStoreFromClass. If I add any method, the error no longer occurs.

import alt from 'altInstance';
import ActivityActions from '../actions/Activity.actions';

class ActivtyStore {

  constructor () {
    this.bindActions(ActivityActions);
  }

  onUpdateActivityQueue (activity) {
    this.setState({activity});
  }
}

export default alt.createStore(ActivtyStore);

Also if I pass the class into the alt.createStore method, it does not have the issue.