Skip to content

Expose promise as prop #79

@ghengeveld

Description

@ghengeveld

Because run does not reject on error, we should expose a new promise property from useAsync and in the render props of <Async>, which rejects or resolves along with the internal promise. Probably just create a new Promise(...) along with new window.AbortController() and keep it as a ref. It can be resolved/rejected from handleResolve and handleReject.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions