martyjs / marty

A Javascript library for state management in React applications
http://martyjs.org
MIT License
1.09k stars 76 forks source link

Store#clear does not set initial state from ES6 class constructor #356

Closed oyvinmar closed 9 years ago

oyvinmar commented 9 years ago

When I set the initial state via ES6 class constructor:

class MyStore extends Marty.Store {
  constructor(...args) {
    super(...args);
    this.state = new Immutable.List();
  }
}

And then call Store#clear() the state is set to the default getInitalState() and not new Immutable.List. I'm currently using getInitialState in my ES6 classes as workaround.

taion commented 9 years ago

Duplicate of https://github.com/martyjs/marty-lib/issues/24. Going to close this issue in favor of that one, because it has more discussion on it already.