Skip to content
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

Dealing with timeouts for fetch #33

Open
nikhilaravi opened this issue Dec 22, 2015 · 3 comments
Open

Dealing with timeouts for fetch #33

nikhilaravi opened this issue Dec 22, 2015 · 3 comments

Comments

@nikhilaravi
Copy link
Collaborator

May want to reject the fetch promise automatically after a certain time elapsed.

Possible solution from whatwg/fetch#179

const oldfetch = fetch;
fetch = function(input, opts) {
    return new Promise((resolve, reject) => {
        setTimeout(reject, opts.deadline);
        oldfetch(input, opts).then(resolve, reject);
    });
}

Not sure if this will be a problem for us - @besarthoxhaj what do you think?

@besarthoxhaj
Copy link
Owner

Like it! Should we implement it in #14?

@nikhilaravi
Copy link
Collaborator Author

@besarthoxhaj do you think it is necessary? Can you think of any situations in which we might have a problem with the request taking too long and having to abort it?

@besarthoxhaj
Copy link
Owner

@nikhilaravi it happened sometimes when requesting a new deck. We always solved the problem by refreshing the app, now we can implement this solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants