-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fire off network requests as soon as they're queued #227
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
| // Try to fire off the request as soon as it's queued so we don't add a delay to every queued command | ||
| // eslint-disable-next-line no-use-before-define | ||
| processNetworkRequestQueue(); |
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.
Everything except for this is just changing names
marcaaron
left a comment
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.
LGTM 👍
| .then(delayedWriteRequest.callback); | ||
| const queuedRequest = networkRequestQueue.shift(); | ||
| request(queuedRequest.command, queuedRequest.data) | ||
| .then(queuedRequest.callback); |
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 guessing we are ok with not catching whatever error might pop up here for now.
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 can't think of a reason why we'd need to beyond making the console.debug show something more useful on mobile than unhandled promise rejection (which it will if you click on it anyway)
processNetworkRequestQueue()call in the now calledqueueRequest