fetch-status
v1.0.1
Published
FetchStatus pattern and utility functions for web applications
Downloads
5
Readme
FetchStatus
Provides a standard enum for FetchStatus
and methods for resolving the status from multiple statuses.
API
FetchStatus
Keys:
FetchStatus.NONE
FetchStatus.LOADING
FetchStatus.LOADED
FetchStatus.FAILED
resolveInitialFetchStatus(...statuses: Array<FetchStatusEnum>): FetchStatusEnum
Resolve a single status from multiple statuses for an initial case. Gives priority to FetchStatus.LOADED
and FetchStatus.LOADING
.
resolveFetchStatus(...statuses: Array<FetchStatusEnum>): FetchStatusEnum
Resolve a single status from multiple statuses for a generic case. Gives priority to FetchStatus.FAILED
and FetchStatus.LOADED
.