Skip to content

Commit 0fc3a57

Browse files
authored
Merge branch 'main' into renovate/formatjs-monorepo
2 parents 62d00f4 + 21a2dc6 commit 0fc3a57

File tree

5 files changed

+66
-38
lines changed

5 files changed

+66
-38
lines changed

.changeset/six-houses-visit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@scaleway/use-dataloader": patch
3+
---
4+
5+
export a datalifetime object

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@testing-library/jest-dom": "6.6.3",
2727
"@testing-library/react": "16.0.1",
2828
"@types/jest": "29.5.14",
29-
"@types/node": "22.8.1",
29+
"@types/node": "22.8.7",
3030
"@types/react": "18.3.12",
3131
"@types/react-dom": "18.3.1",
3232
"@vitejs/plugin-react": "4.3.3",

packages/use-dataloader/src/constants.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
const SECOND = 1000
2+
const MINUTE = 60 * SECOND
3+
const HOUR = 60 * MINUTE
4+
15
export enum StatusEnum {
26
ERROR = 'error',
37
IDLE = 'idle',
@@ -7,3 +11,21 @@ export enum StatusEnum {
711

812
export const KEY_IS_NOT_STRING_ERROR = 'Key should be a string'
913
export 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

packages/use-dataloader/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ export {
44
} from './DataLoaderProvider'
55
export { useDataLoader } from './useDataLoader'
66
export type { UseDataLoaderConfig } from './types'
7+
export { DATALIFE_TIME, POLLING_INTERVAL } from './constants'

pnpm-lock.yaml

Lines changed: 37 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)