-
Notifications
You must be signed in to change notification settings - Fork 10.3k
refactor(gatsby): expicitly call db saveState and autoSave #13007
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ef59859 to
41db68a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is more readable!
Just wondering why we're listening on emitter and not on the redux state changing itself (perhaps redux state change is happening to often?)
I'm holding off on merges as I want @pieh to have a look as well.
Do you mean by registering a reducer that reacts to any redux action? My guess is that we would have no guarantee that all other reducers had executed before performing the save. Whereas |
|
I think we need to remove
|
Good catch. Fixed in 5028776 |
f6a254e to
ab14d84
Compare
|
@pieh conflicts resolved |
|
Published in gatsby@2.3.14 |
…13007) * [gatsby/db]: expicitly call db saveState and autoSave * don't db.startAutosave() during bootstrap * saveState at beginning of db.startAutosave()
Description
As part of my work on #13004, I've been trying to remove reliance on global events such as
BOOTSTRAP_FINISHED. There are definitely some good use cases for global events, but I feel in this case, the code is more clear by specifically invokingdb.saveState/autoSave. Curious on other's thoughts.Related Issues