Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AsyncCallback<T, E>

Type parameters

Hierarchy

  • AsyncCallback

Index

Properties

asyncCallback

asyncCallback: UnsafeAsyncCallback<T>

Optional onError

onError?: OnErrorEvent<E>

This callback is executed whenever the asyncFunction throws or rejects an error. It will not be executed if the promise is canceled, namely when the component is unmounted during the asyncFunction execution. So it is safe to change states within this callback.

param e

onSuccess

onSuccess: OnSuccessEvent<T>

Here is where should be the states change in response to async callback result. There is no need to be concerned with memory leaks or race conditions.

param result

The asyncCallback result.

Methods

Optional cleanup

  • cleanup(): void
  • Here is possible to add cleanup code (like removing subscriptions). Don't change states here!

    Returns void

Generated using TypeDoc