Async
Abstraction for async operations that can be hooked into React.
Source code is hosted in GitHub
Seamless React integrations are shipped inside separate packages:
useAsyncuseStreamuseActioncreateAsync()
Create an observable async operation:
Create an observable async operation without the factory function:
Async.getResult()
Retrieve result from the last invocation:
Async.getError()
Retrieve probable error from the last invocation:
Async.getState()
Retrieve all the details in a single call, contains values like isRunning
, isCancelled
, result
, etc.:
Async.isRunning()
Check if the async operation is being executed right now:
Async.isCancelled()
Check if the latest async invocation has been cancelled:
Async.isErrored()
Check if the latest async invocation errored:
Async.run()
Invoke async operation:
Async.resolve()
Manually resolve async result, makes it available on the instance using getResult()
:
Async.cancel()
Cancel current async invocation:
Async.listen()
Subscribe to state changes, the listener receives the same object that you get from getState()
:
Last updated