-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add async storage for saving/getting large data [DO NOT MERGE] #4418
Add async storage for saving/getting large data [DO NOT MERGE] #4418
Conversation
modules/core/history.js
Outdated
var isLocked = lock.locked(); | ||
|
||
if (isLocked) { | ||
return Promise.resolve(true); |
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.
I'm pretty sure native Promises don't work in IE11.. Can you use localForage's callback API instead?
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.
Oh, my fault. Rewrited to callback API.
@bhousel ping |
@@ -431,7 +455,7 @@ export function coreContext() { | |||
|
|||
// Debounce save, since it's a synchronous localStorage write, | |||
// and history changes can happen frequently (e.g. when dragging). | |||
context.debouncedSave = _debounce(context.save, 350); | |||
context.debouncedSave = _debounce(context.save, 100); |
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.
Is there a reason why you changed this? (If anything I think we could slow down the saves, not speed them up)
Thanks for being patient @Semigradsky - I think I'm going to move this new code into its own module, and also try to update the other places in iD that use storage to use this new store, and add some code to grab the existing localStorage values if they exist. Hope to merge it today 👍 |
Hey @Semigradsky - I did some work on this yesterday but here's where I ended up:
I don't have a timeline on when it would happen, but it is something we want eventually.. |
Fix #3239