Skip to content

Aborting query use case #1021

Closed
Closed
@JeromeDeLeon

Description

@JeromeDeLeon

I followed the test case reference to the new feature query.cancel for aborting the request made by @dplewis . I don't know if that was the right thing. After that didn't work, here's what I tried:

query.find().then(console.log).catch(console.error)
setTimeout(() => {
    query.cancel();
}, 0);

I saw from the network section that the query was cancelled however, two request were made (one that got cancelled and one that went successfully) and I also saw from the console that it passes the then block from above. So how do I use the cancel? awaiting before calling abort was nonsense because the request was already completed before aborting.

I thought doing below snippet is possible:

query.find().then(console.log).catch(console.error)
query.cancel();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions