Interface RequestSignature<RT, E>
interface RequestSignature<RT, E> {
Args: EmberRequestArgs<RT, E>;
Blocks: { always: [RequestState<RT, StructuredErrorDocument<E>>]; cancelled: [StructuredErrorDocument<E>, RecoveryFeatures]; content: [RT, ContentFeatures<RT>]; error: [StructuredErrorDocument<E>, RecoveryFeatures]; idle: []; loading: [RequestLoadingState] };
}Defined in: warp-drive-packages/ember/dist/index.d.ts:103
The Glint signature of the `<Request />` component: the args it accepts and the blocks it yields to.
Example
import type { RequestSignature } from '@warp-drive/ember';
import type { User } from './schemas/user';
type UserRequestArgs = RequestSignature<User, unknown>['Args'];Type Parameters
RT
RT
E
E
Properties
Args
Args: EmberRequestArgs<RT, E>;Defined in: warp-drive-packages/ember/dist/index.d.ts:106
The args the component accepts, see EmberRequestArgs.
Blocks
Blocks: {
always: [RequestState<RT, StructuredErrorDocument<E>>];
cancelled: [StructuredErrorDocument<E>, RecoveryFeatures];
content: [RT, ContentFeatures<RT>];
error: [StructuredErrorDocument<E>, RecoveryFeatures];
idle: [];
loading: [RequestLoadingState];
};Defined in: warp-drive-packages/ember/dist/index.d.ts:107
always
always: [RequestState<RT, StructuredErrorDocument<E>>];The block to render in every state except idle, after whichever state-specific block is rendered, with the current RequestState.
cancelled
cancelled: [StructuredErrorDocument<E>, RecoveryFeatures];The block to render when the request was cancelled.
content
content: [RT, ContentFeatures<RT>];The block to render when the request succeeded.
error
error: [StructuredErrorDocument<E>, RecoveryFeatures];The block to render when the request failed. If this block is not provided, the error will be rethrown.
Thus it is required to provide an error block and proper error handling if you do not want the error to crash the application.
idle
idle: [];The block to render when the component is idle and waiting to be given a request.
loading
loading: [RequestLoadingState];The block to render when the request is loading.