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

Abort XHR? #3

Closed
GRiMe2D opened this issue Jun 29, 2016 · 2 comments
Closed

Abort XHR? #3

GRiMe2D opened this issue Jun 29, 2016 · 2 comments

Comments

@GRiMe2D
Copy link

GRiMe2D commented Jun 29, 2016

In current project I heavily use your library. Sometimes I need to abort opened xhr requests.

I think you could add one time event listeners. Look at this

...

let openedXHR = [];
api.once('request', (xhr) => {
    openedXHR.push(xhr);
})
api.res('account').res('balance').get().then(...)

openedXHR.forEach((xhr) => xhr.abort())

I can't use request event, because RestClient created once and reused everywhere.

@Amareis
Copy link
Owner

Amareis commented Jul 12, 2017

So, i'm back in programmer's world, and now it's time to rise ARC again. Can you say more detail about it issue?

@Amareis
Copy link
Owner

Amareis commented Jul 26, 2017

Now you can use this:

api.res('account').res('balance').get().on('request', xhr => openedXHR.push(xhr));

@Amareis Amareis closed this as completed Jul 26, 2017
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