Skip to main content

Import

import { AssetPairs } from '@krono/core'

Usage

You can check the general status string or use the boolean convenience getters (loading, loaded).
if (assetPairs.loading) {
  console.log('Fetching pairs...');
}

if (assetPairs.status === 'error') {
  console.error(assetPairs.error);
}

Type

type AssetPairsStatus = 'idle' | 'loading' | 'loaded' | 'error';
PropertyTypeDescription
loadingbooleanTrue if a fetch request is currently in progress.
loadedbooleanTrue if data has been successfully fetched at least once.
error`Errornull`Contains the last error object if the status is ‘error’.