goatslacker / goatslacker/alt

emitChange in bootstrap

Open
#704 0 comments 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.4k
Forks
312
PR merge metrics
No merged PRs in 30d

Description

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
```js
bootstrap(data) {
StateFunctions.setAppState(this, data, (storeInst, state) => {
storeInst.lifecycle('bootstrap', state)
storeInst.emitChange()
})
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.