Skip to content

FetchStatus pattern and utility functions for web applications

License

Notifications You must be signed in to change notification settings

paularmstrong/fetch-status

Repository files navigation

FetchStatus build status npm version npm downloads

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.

About

FetchStatus pattern and utility functions for web applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published