File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed
packages/use-dataloader/src Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @scaleway/use-dataloader " : patch
3+ ---
4+
5+ export a datalifetime object
Original file line number Diff line number Diff line change 1+ const SECOND = 1000
2+ const MINUTE = 60 * SECOND
3+ const HOUR = 60 * MINUTE
4+
15export enum StatusEnum {
26 ERROR = 'error' ,
37 IDLE = 'idle' ,
@@ -7,3 +11,21 @@ export enum StatusEnum {
711
812export const KEY_IS_NOT_STRING_ERROR = 'Key should be a string'
913export const DEFAULT_MAX_CONCURRENT_REQUESTS = 20
14+
15+ export const POLLING_INTERVAL = {
16+ '10S' : 10 * SECOND ,
17+ '5S' : 5 * SECOND ,
18+ '3S' : 3 * SECOND ,
19+ } as const
20+
21+ export const DATALIFE_TIME = {
22+ '2h' : 2 * HOUR ,
23+ '1h' : 1 * HOUR ,
24+ '5m' : 5 * MINUTE ,
25+ '3m' : 3 * MINUTE ,
26+ '1m' : 1 * MINUTE ,
27+ '30S' : 30 * SECOND ,
28+ '10S' : 10 * SECOND ,
29+ '5S' : 5 * SECOND ,
30+ NONE : 0 ,
31+ } as const
Original file line number Diff line number Diff line change 44} from './DataLoaderProvider'
55export { useDataLoader } from './useDataLoader'
66export type { UseDataLoaderConfig } from './types'
7+ export { DATALIFE_TIME , POLLING_INTERVAL } from './constants'
You can’t perform that action at this time.
0 commit comments