mirror of
https://github.com/expo/autodone.git
synced 2026-11-14 08:48:06 -10:00
master
autodone
A decorator for async functions that automatically calls done() on the returned promise
Usage
Decorate any function that returns a promise, including async functions:
@autodone
async componentDidMount() {
...
}
Important Notes
- Use this decorator only when you never will use the promise returned from the async function. Once a promise has been marked as done, you cannot call any more methods on it.
- Your promise library must implement
done()
Description
A decorator for async functions that automatically calls
done() on the returned promise
29 KiB
0 Stars
1 Watchers
0 Forks
Languages
JavaScript
100%