goatslacker / alt

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

emitChange in bootstrap #704

Open tuwhoo opened 7 years ago

tuwhoo commented 7 years ago

As you can see in docs

Bootstrapping can be done as many times as you wish, but it is common to use when initializing your application. The alt.bootstrap() function takes in a snapshot (JSON string) you've saved and reloads all the state with that snapshot, no events will be emitted to your components during this process, so again, it's best to do this on init before the view has even rendered. If you need to emit a change event, you can use this.emitChange inside of your bootstrap life cycle method.

But in code I see

bootstrap(data) {
    StateFunctions.setAppState(this, data, (storeInst, state) => {
      storeInst.lifecycle('bootstrap', state)
      storeInst.emitChange()
    })
  }