Type alias DataOrError<T>

DataOrError<T>: {
    data?: T;
    error?: Error;
}

Used as the result of a React hook in order to represent one of three states:

  1. The data is loading. (data and error are both nil)
  2. The data is loaded. (data is not nil, error is nil)
  3. The data failed to load. (data is nil, error is not nil)

Type Parameters

  • T

Type declaration

  • Optional data?: T
  • Optional error?: Error

Generated using TypeDoc