Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Feature: useDeferred() #17

Open
getify opened this issue Jan 18, 2019 · 0 comments
Open

Feature: useDeferred() #17

getify opened this issue Jan 18, 2019 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@getify
Copy link
Owner

getify commented Jan 18, 2019

The useDeferred() hook creates and stores in a state slot (via useState(..)) an object, commonly called a deferred, which is a promise and also its resolve(..) / reject(..) capabilities.

function foo() {
   var { pr, resolve, reject } = useDeferred();
}

Unclear if there's any pattern that would benefit from passing a value to useDeferred(..). Need to further consider.

@getify getify added enhancement New feature or request help wanted Extra attention is needed question Further information is requested labels Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant