Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

BREAKING: Non blocking behavior for client mutate #10

Merged
merged 1 commit into from Apr 17, 2019

Conversation

wtrocki
Copy link
Contributor

@wtrocki wtrocki commented Apr 17, 2019

Motivation

Avoid blocking offline queue.
General idea is to return an error to the user instantly
and then trigger another mutation that will be enqueued as an offline one.

  1. The request comes to an offline queue.
  2. Return observable with error instantly (mutate().catch() will be triggered)
  3. Attach observable to error object.
client.mutate.try()
.catch(error => {
    error.offlineObservable.then((data)=>{
        // Successfully mutated after error
    })
})

Screen Shot 2019-04-12 at 5 56 41 PM

Tasks

  • Implement nonblocking behavior
  • Unify storage

Copy link
Member

@StephenCoady StephenCoady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇 🥇 🥇

Great work!

@wtrocki wtrocki merged commit 6dbb916 into master Apr 17, 2019
@wtrocki wtrocki deleted the non-blocking-mutation branch April 17, 2019 15:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants