@gravity-ui/data-source 0.9.0 → 0.9.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/core/types/DataSource.d.ts +8 -8
- package/build/cjs/core/types/DataSource.js.map +1 -1
- package/build/cjs/react/components/AsyncBoundary/AsyncBoundary.d.ts +3 -0
- package/build/cjs/react/components/AsyncBoundary/AsyncBoundary.js +35 -0
- package/build/cjs/react/components/AsyncBoundary/AsyncBoundary.js.map +1 -0
- package/build/cjs/react/components/AsyncBoundary/index.d.ts +3 -0
- package/build/cjs/react/components/AsyncBoundary/index.js +20 -0
- package/build/cjs/react/components/AsyncBoundary/index.js.map +1 -0
- package/build/cjs/react/components/AsyncBoundary/types.d.ts +13 -0
- package/build/cjs/react/components/AsyncBoundary/types.js +6 -0
- package/build/cjs/react/components/AsyncBoundary/types.js.map +1 -0
- package/build/cjs/react/components/AsyncBoundary/withAsyncBoundary.d.ts +3 -0
- package/build/cjs/react/components/AsyncBoundary/withAsyncBoundary.js +26 -0
- package/build/cjs/react/components/AsyncBoundary/withAsyncBoundary.js.map +1 -0
- package/build/cjs/react/components/EmptyView/EmptyView.d.ts +2 -0
- package/build/cjs/react/components/EmptyView/EmptyView.js +10 -0
- package/build/cjs/react/components/EmptyView/EmptyView.js.map +1 -0
- package/build/cjs/react/components/EmptyView/index.d.ts +1 -0
- package/build/cjs/react/components/EmptyView/index.js +13 -0
- package/build/cjs/react/components/EmptyView/index.js.map +1 -0
- package/build/cjs/react/components/types.d.ts +1 -1
- package/build/cjs/react/components/types.js.map +1 -1
- package/build/cjs/react/index.d.ts +5 -3
- package/build/cjs/react/index.js +27 -3
- package/build/cjs/react/index.js.map +1 -1
- package/build/cjs/react-query/components/QueryAsyncBoundary/QueryAsyncBoundary.d.ts +3 -0
- package/build/cjs/react-query/components/QueryAsyncBoundary/QueryAsyncBoundary.js +23 -0
- package/build/cjs/react-query/components/QueryAsyncBoundary/QueryAsyncBoundary.js.map +1 -0
- package/build/cjs/react-query/components/QueryAsyncBoundary/index.d.ts +3 -0
- package/build/cjs/react-query/components/QueryAsyncBoundary/index.js +20 -0
- package/build/cjs/react-query/components/QueryAsyncBoundary/index.js.map +1 -0
- package/build/cjs/react-query/components/QueryAsyncBoundary/types.d.ts +8 -0
- package/build/cjs/react-query/components/QueryAsyncBoundary/types.js +6 -0
- package/build/cjs/react-query/components/QueryAsyncBoundary/types.js.map +1 -0
- package/build/cjs/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.d.ts +3 -0
- package/build/cjs/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.js +26 -0
- package/build/cjs/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.js.map +1 -0
- package/build/cjs/react-query/hooks/useSuspenseQueryData.d.ts +9 -0
- package/build/cjs/react-query/hooks/useSuspenseQueryData.js +22 -0
- package/build/cjs/react-query/hooks/useSuspenseQueryData.js.map +1 -0
- package/build/cjs/react-query/index.d.ts +2 -0
- package/build/cjs/react-query/index.js +35 -0
- package/build/cjs/react-query/index.js.map +1 -1
- package/build/esm/core/types/DataSource.d.ts +8 -8
- package/build/esm/core/types/DataSource.js.map +1 -1
- package/build/esm/react/components/AsyncBoundary/AsyncBoundary.d.ts +3 -0
- package/build/esm/react/components/AsyncBoundary/AsyncBoundary.js +28 -0
- package/build/esm/react/components/AsyncBoundary/AsyncBoundary.js.map +1 -0
- package/build/esm/react/components/AsyncBoundary/index.d.ts +3 -0
- package/build/esm/react/components/AsyncBoundary/index.js +3 -0
- package/build/esm/react/components/AsyncBoundary/index.js.map +1 -0
- package/build/esm/react/components/AsyncBoundary/types.d.ts +13 -0
- package/build/esm/react/components/AsyncBoundary/types.js +2 -0
- package/build/esm/react/components/AsyncBoundary/types.js.map +1 -0
- package/build/esm/react/components/AsyncBoundary/withAsyncBoundary.d.ts +3 -0
- package/build/esm/react/components/AsyncBoundary/withAsyncBoundary.js +19 -0
- package/build/esm/react/components/AsyncBoundary/withAsyncBoundary.js.map +1 -0
- package/build/esm/react/components/EmptyView/EmptyView.d.ts +2 -0
- package/build/esm/react/components/EmptyView/EmptyView.js +4 -0
- package/build/esm/react/components/EmptyView/EmptyView.js.map +1 -0
- package/build/esm/react/components/EmptyView/index.d.ts +1 -0
- package/build/esm/react/components/EmptyView/index.js +2 -0
- package/build/esm/react/components/EmptyView/index.js.map +1 -0
- package/build/esm/react/components/types.d.ts +1 -1
- package/build/esm/react/components/types.js.map +1 -1
- package/build/esm/react/index.d.ts +5 -3
- package/build/esm/react/index.js +4 -2
- package/build/esm/react/index.js.map +1 -1
- package/build/esm/react-query/components/QueryAsyncBoundary/QueryAsyncBoundary.d.ts +3 -0
- package/build/esm/react-query/components/QueryAsyncBoundary/QueryAsyncBoundary.js +16 -0
- package/build/esm/react-query/components/QueryAsyncBoundary/QueryAsyncBoundary.js.map +1 -0
- package/build/esm/react-query/components/QueryAsyncBoundary/index.d.ts +3 -0
- package/build/esm/react-query/components/QueryAsyncBoundary/index.js +3 -0
- package/build/esm/react-query/components/QueryAsyncBoundary/index.js.map +1 -0
- package/build/esm/react-query/components/QueryAsyncBoundary/types.d.ts +8 -0
- package/build/esm/react-query/components/QueryAsyncBoundary/types.js +2 -0
- package/build/esm/react-query/components/QueryAsyncBoundary/types.js.map +1 -0
- package/build/esm/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.d.ts +3 -0
- package/build/esm/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.js +19 -0
- package/build/esm/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.js.map +1 -0
- package/build/esm/react-query/hooks/useSuspenseQueryData.d.ts +9 -0
- package/build/esm/react-query/hooks/useSuspenseQueryData.js +15 -0
- package/build/esm/react-query/hooks/useSuspenseQueryData.js.map +1 -0
- package/build/esm/react-query/index.d.ts +2 -0
- package/build/esm/react-query/index.js +2 -0
- package/build/esm/react-query/index.js.map +1 -1
- package/build/plugin/esbuild.d.mts +7 -0
- package/build/plugin/esbuild.mjs +6 -0
- package/build/plugin/factory-2tSt4Rte.mjs +513 -0
- package/build/plugin/index-mY40Sgl5.d.mts +24 -0
- package/build/plugin/index.d.mts +7 -0
- package/build/plugin/index.mjs +6 -0
- package/build/plugin/rollup.d.mts +6 -0
- package/build/plugin/rollup.mjs +6 -0
- package/build/plugin/rspack.d.mts +7 -0
- package/build/plugin/rspack.mjs +6 -0
- package/build/plugin/typings/client.d.ts +11 -0
- package/build/plugin/vite.d.mts +6 -0
- package/build/plugin/vite.mjs +6 -0
- package/build/plugin/webpack.d.mts +7 -0
- package/build/plugin/webpack.mjs +6 -0
- package/package.json +54 -5
- package/build/cjs/core/utils/__tests__/composeFullKey.test.js +0 -34
- package/build/cjs/core/utils/__tests__/composeFullKey.test.js.map +0 -1
- package/build/cjs/core/utils/__tests__/composeKey.test.js +0 -32
- package/build/cjs/core/utils/__tests__/composeKey.test.js.map +0 -1
- package/build/cjs/core/utils/__tests__/getError.test.js +0 -31
- package/build/cjs/core/utils/__tests__/getError.test.js.map +0 -1
- package/build/cjs/core/utils/__tests__/getStatus.test.js +0 -49
- package/build/cjs/core/utils/__tests__/getStatus.test.js.map +0 -1
- package/build/cjs/core/utils/__tests__/hasTag.test.js +0 -31
- package/build/cjs/core/utils/__tests__/hasTag.test.js.map +0 -1
- package/build/cjs/core/utils/__tests__/mergeStatuses.test.js +0 -25
- package/build/cjs/core/utils/__tests__/mergeStatuses.test.js.map +0 -1
- package/build/cjs/core/utils/__tests__/skipContext.test.js +0 -70
- package/build/cjs/core/utils/__tests__/skipContext.test.js.map +0 -1
- package/build/cjs/core/utils/__tests__/withCancellation.test.js +0 -106
- package/build/cjs/core/utils/__tests__/withCancellation.test.js.map +0 -1
- package/build/cjs/core/utils/__tests__/withCatch.test.js +0 -208
- package/build/cjs/core/utils/__tests__/withCatch.test.js.map +0 -1
- package/build/cjs/react/__tests__/DataManagerContext.test.js +0 -47
- package/build/cjs/react/__tests__/DataManagerContext.test.js.map +0 -1
- package/build/cjs/react/__tests__/withDataManager.test.js +0 -61
- package/build/cjs/react/__tests__/withDataManager.test.js.map +0 -1
- package/build/cjs/react/components/DataInfiniteLoader/__tests__/DataInfiniteLoader.test.js +0 -187
- package/build/cjs/react/components/DataInfiniteLoader/__tests__/DataInfiniteLoader.test.js.map +0 -1
- package/build/cjs/react/components/DataLoader/__tests__/DataLoader.test.js +0 -119
- package/build/cjs/react/components/DataLoader/__tests__/DataLoader.test.js.map +0 -1
- package/build/cjs/react-query/__tests__/createQueryNormalizer.test.js +0 -177
- package/build/cjs/react-query/__tests__/createQueryNormalizer.test.js.map +0 -1
- package/build/cjs/react-query/__tests__/normalizationEdgeCases.test.js +0 -100
- package/build/cjs/react-query/__tests__/normalizationEdgeCases.test.js.map +0 -1
- package/build/cjs/react-query/__tests__/subscriptions.test.js +0 -1180
- package/build/cjs/react-query/__tests__/subscriptions.test.js.map +0 -1
- package/build/cjs/react-query/__tests__/threeLevelIntegration.test.js +0 -659
- package/build/cjs/react-query/__tests__/threeLevelIntegration.test.js.map +0 -1
- package/build/cjs/react-query/__tests__/updateQueriesFromMutationData.test.js +0 -229
- package/build/cjs/react-query/__tests__/updateQueriesFromMutationData.test.js.map +0 -1
- package/build/cjs/react-query/hooks/__tests__/useQueryContext.test.js +0 -55
- package/build/cjs/react-query/hooks/__tests__/useQueryContext.test.js.map +0 -1
- package/build/cjs/react-query/hooks/__tests__/useQueryData.refetch.test.js +0 -230
- package/build/cjs/react-query/hooks/__tests__/useQueryData.refetch.test.js.map +0 -1
- package/build/cjs/react-query/hooks/__tests__/useQueryData.test.js +0 -97
- package/build/cjs/react-query/hooks/__tests__/useQueryData.test.js.map +0 -1
- package/build/cjs/react-query/hooks/__tests__/useQueryResponses.test.js +0 -77
- package/build/cjs/react-query/hooks/__tests__/useQueryResponses.test.js.map +0 -1
- package/build/cjs/react-query/hooks/__tests__/useRefetchAll.test.js +0 -79
- package/build/cjs/react-query/hooks/__tests__/useRefetchAll.test.js.map +0 -1
- package/build/cjs/react-query/hooks/__tests__/useRefetchErrored.test.js +0 -117
- package/build/cjs/react-query/hooks/__tests__/useRefetchErrored.test.js.map +0 -1
- package/build/cjs/react-query/hooks/__tests__/useRefetchInterval.test.js +0 -156
- package/build/cjs/react-query/hooks/__tests__/useRefetchInterval.test.js.map +0 -1
- package/build/cjs/react-query/utils/__tests__/checkMutationObjectsKeys.test.js +0 -295
- package/build/cjs/react-query/utils/__tests__/checkMutationObjectsKeys.test.js.map +0 -1
- package/build/cjs/react-query/utils/__tests__/formatNullableValue.test.js +0 -27
- package/build/cjs/react-query/utils/__tests__/formatNullableValue.test.js.map +0 -1
- package/build/cjs/react-query/utils/__tests__/getProgressiveRefetch.test.js +0 -76
- package/build/cjs/react-query/utils/__tests__/getProgressiveRefetch.test.js.map +0 -1
- package/build/cjs/react-query/utils/__tests__/normalizeStatus.test.js +0 -30
- package/build/cjs/react-query/utils/__tests__/normalizeStatus.test.js.map +0 -1
- package/build/cjs/react-query/utils/__tests__/notReachable.test.js +0 -35
- package/build/cjs/react-query/utils/__tests__/notReachable.test.js.map +0 -1
- package/build/cjs/react-query/utils/__tests__/parseNullableValue.test.js +0 -27
- package/build/cjs/react-query/utils/__tests__/parseNullableValue.test.js.map +0 -1
- package/build/cjs/setupTests.d.ts +0 -1
- package/build/cjs/setupTests.js +0 -4
- package/build/cjs/setupTests.js.map +0 -1
- package/build/esm/core/utils/__tests__/composeFullKey.test.js +0 -32
- package/build/esm/core/utils/__tests__/composeFullKey.test.js.map +0 -1
- package/build/esm/core/utils/__tests__/composeKey.test.js +0 -30
- package/build/esm/core/utils/__tests__/composeKey.test.js.map +0 -1
- package/build/esm/core/utils/__tests__/getError.test.js +0 -29
- package/build/esm/core/utils/__tests__/getError.test.js.map +0 -1
- package/build/esm/core/utils/__tests__/getStatus.test.js +0 -47
- package/build/esm/core/utils/__tests__/getStatus.test.js.map +0 -1
- package/build/esm/core/utils/__tests__/hasTag.test.js +0 -29
- package/build/esm/core/utils/__tests__/hasTag.test.js.map +0 -1
- package/build/esm/core/utils/__tests__/mergeStatuses.test.js +0 -23
- package/build/esm/core/utils/__tests__/mergeStatuses.test.js.map +0 -1
- package/build/esm/core/utils/__tests__/skipContext.test.js +0 -67
- package/build/esm/core/utils/__tests__/skipContext.test.js.map +0 -1
- package/build/esm/core/utils/__tests__/withCancellation.test.js +0 -104
- package/build/esm/core/utils/__tests__/withCancellation.test.js.map +0 -1
- package/build/esm/core/utils/__tests__/withCatch.test.js +0 -205
- package/build/esm/core/utils/__tests__/withCatch.test.js.map +0 -1
- package/build/esm/react/__tests__/DataManagerContext.test.js +0 -44
- package/build/esm/react/__tests__/DataManagerContext.test.js.map +0 -1
- package/build/esm/react/__tests__/withDataManager.test.js +0 -58
- package/build/esm/react/__tests__/withDataManager.test.js.map +0 -1
- package/build/esm/react/components/DataInfiniteLoader/__tests__/DataInfiniteLoader.test.js +0 -184
- package/build/esm/react/components/DataInfiniteLoader/__tests__/DataInfiniteLoader.test.js.map +0 -1
- package/build/esm/react/components/DataLoader/__tests__/DataLoader.test.js +0 -116
- package/build/esm/react/components/DataLoader/__tests__/DataLoader.test.js.map +0 -1
- package/build/esm/react-query/__tests__/createQueryNormalizer.test.js +0 -174
- package/build/esm/react-query/__tests__/createQueryNormalizer.test.js.map +0 -1
- package/build/esm/react-query/__tests__/normalizationEdgeCases.test.js +0 -98
- package/build/esm/react-query/__tests__/normalizationEdgeCases.test.js.map +0 -1
- package/build/esm/react-query/__tests__/subscriptions.test.js +0 -1176
- package/build/esm/react-query/__tests__/subscriptions.test.js.map +0 -1
- package/build/esm/react-query/__tests__/threeLevelIntegration.test.js +0 -656
- package/build/esm/react-query/__tests__/threeLevelIntegration.test.js.map +0 -1
- package/build/esm/react-query/__tests__/updateQueriesFromMutationData.test.js +0 -227
- package/build/esm/react-query/__tests__/updateQueriesFromMutationData.test.js.map +0 -1
- package/build/esm/react-query/hooks/__tests__/useQueryContext.test.js +0 -52
- package/build/esm/react-query/hooks/__tests__/useQueryContext.test.js.map +0 -1
- package/build/esm/react-query/hooks/__tests__/useQueryData.refetch.test.js +0 -227
- package/build/esm/react-query/hooks/__tests__/useQueryData.refetch.test.js.map +0 -1
- package/build/esm/react-query/hooks/__tests__/useQueryData.test.js +0 -95
- package/build/esm/react-query/hooks/__tests__/useQueryData.test.js.map +0 -1
- package/build/esm/react-query/hooks/__tests__/useQueryResponses.test.js +0 -74
- package/build/esm/react-query/hooks/__tests__/useQueryResponses.test.js.map +0 -1
- package/build/esm/react-query/hooks/__tests__/useRefetchAll.test.js +0 -77
- package/build/esm/react-query/hooks/__tests__/useRefetchAll.test.js.map +0 -1
- package/build/esm/react-query/hooks/__tests__/useRefetchErrored.test.js +0 -115
- package/build/esm/react-query/hooks/__tests__/useRefetchErrored.test.js.map +0 -1
- package/build/esm/react-query/hooks/__tests__/useRefetchInterval.test.js +0 -154
- package/build/esm/react-query/hooks/__tests__/useRefetchInterval.test.js.map +0 -1
- package/build/esm/react-query/utils/__tests__/checkMutationObjectsKeys.test.js +0 -292
- package/build/esm/react-query/utils/__tests__/checkMutationObjectsKeys.test.js.map +0 -1
- package/build/esm/react-query/utils/__tests__/formatNullableValue.test.js +0 -25
- package/build/esm/react-query/utils/__tests__/formatNullableValue.test.js.map +0 -1
- package/build/esm/react-query/utils/__tests__/getProgressiveRefetch.test.js +0 -74
- package/build/esm/react-query/utils/__tests__/getProgressiveRefetch.test.js.map +0 -1
- package/build/esm/react-query/utils/__tests__/normalizeStatus.test.js +0 -28
- package/build/esm/react-query/utils/__tests__/normalizeStatus.test.js.map +0 -1
- package/build/esm/react-query/utils/__tests__/notReachable.test.js +0 -33
- package/build/esm/react-query/utils/__tests__/notReachable.test.js.map +0 -1
- package/build/esm/react-query/utils/__tests__/parseNullableValue.test.js +0 -25
- package/build/esm/react-query/utils/__tests__/parseNullableValue.test.js.map +0 -1
- package/build/esm/setupTests.d.ts +0 -1
- package/build/esm/setupTests.js +0 -2
- package/build/esm/setupTests.js.map +0 -1
|
@@ -15,14 +15,14 @@ export interface DataSource<TContext, TParams, TRequest, TResponse, TData, TErro
|
|
|
15
15
|
}
|
|
16
16
|
export type AnyDataSource = DataSource<any, any, any, any, any, any, any, any, any>;
|
|
17
17
|
export type DataSourceContext<TDataSource> = TDataSource extends DataSource<infer TContext, infer _TParams, infer _TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? TContext : never;
|
|
18
|
-
export type DataSourceParams<TDataSource> = TDataSource extends DataSource<infer
|
|
19
|
-
export type DataSourceRequest<TDataSource> = TDataSource extends DataSource<infer
|
|
20
|
-
export type DataSourceResponse<TDataSource> = TDataSource extends DataSource<infer
|
|
21
|
-
export type DataSourceData<TDataSource> = TDataSource extends DataSource<infer
|
|
22
|
-
export type DataSourceError<TDataSource> = TDataSource extends DataSource<infer
|
|
23
|
-
export type DataSourceOptions<TDataSource> = TDataSource extends DataSource<infer
|
|
24
|
-
export type DataSourceState<TDataSource> = TDataSource extends DataSource<infer
|
|
25
|
-
export type DataSourceFetchContext<TDataSource> = TDataSource extends DataSource<infer
|
|
18
|
+
export type DataSourceParams<TDataSource> = TDataSource extends DataSource<infer _TContext, infer TParams, infer TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? ActualParams<TParams, TRequest> : never;
|
|
19
|
+
export type DataSourceRequest<TDataSource> = TDataSource extends DataSource<infer _TContext, infer _TParams, infer TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? TRequest : never;
|
|
20
|
+
export type DataSourceResponse<TDataSource> = TDataSource extends DataSource<infer _TContext, infer _TParams, infer _TRequest, infer TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? TResponse : never;
|
|
21
|
+
export type DataSourceData<TDataSource> = TDataSource extends DataSource<infer _TContext, infer _TParams, infer _TRequest, infer TResponse, infer TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? ActualData<TData, TResponse> : never;
|
|
22
|
+
export type DataSourceError<TDataSource> = TDataSource extends DataSource<infer _TContext, infer _TParams, infer _TRequest, infer _TResponse, infer _TData, infer TError, infer _TOptions, infer _TState, infer _TFetchContext> ? TError : never;
|
|
23
|
+
export type DataSourceOptions<TDataSource> = TDataSource extends DataSource<infer _TContext, infer _TParams, infer _TRequest, infer _TResponse, infer _TData, infer _TError, infer TOptions, infer _TState, infer _TFetchContext> ? TOptions : never;
|
|
24
|
+
export type DataSourceState<TDataSource> = TDataSource extends DataSource<infer _TContext, infer _TParams, infer _TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer TState, infer _TFetchContext> ? TState : never;
|
|
25
|
+
export type DataSourceFetchContext<TDataSource> = TDataSource extends DataSource<infer _TContext, infer _TParams, infer _TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer TFetchContext> ? TFetchContext : never;
|
|
26
26
|
export type ActualParams<TParams, TRequest> = (unknown extends TParams ? TRequest : TParams) | typeof idle;
|
|
27
27
|
export type ActualData<TData, TResponse> = unknown extends TData ? TResponse : TData;
|
|
28
28
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["DataSource.ts"],"sourcesContent":["import type {idle} from '../constants';\n\nexport type DataSourceKey = ReadonlyArray<unknown>;\nexport type DataSourceTag = string;\n\ndeclare const errorHintSymbol: unique symbol;\ndeclare const stateHintSymbol: unique symbol;\n\nexport interface DataSource<\n TContext,\n TParams,\n TRequest,\n TResponse,\n TData,\n TError,\n TOptions,\n TState,\n TFetchContext,\n> {\n readonly name: string;\n\n fetch: (\n context: TContext,\n fetchContext: TFetchContext,\n request: TRequest,\n ) => Promise<TResponse> | TResponse;\n tags?: (params: ActualParams<NoInfer<TParams>, NoInfer<TRequest>>) => DataSourceTag[];\n\n transformParams?: (params: TParams) => NoInfer<TRequest>;\n transformResponse?: (response: TResponse) => TData;\n\n options?: Partial<TOptions>;\n [stateHintSymbol]?: TState;\n [errorHintSymbol]?: TError;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyDataSource = DataSource<any, any, any, any, any, any, any, any, any>;\n\nexport type DataSourceContext<TDataSource> =\n TDataSource extends DataSource<\n infer TContext,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TContext\n : never;\n\nexport type DataSourceParams<TDataSource> =\n TDataSource extends DataSource<\n infer
|
|
1
|
+
{"version":3,"names":[],"sources":["DataSource.ts"],"sourcesContent":["import type {idle} from '../constants';\n\nexport type DataSourceKey = ReadonlyArray<unknown>;\nexport type DataSourceTag = string;\n\ndeclare const errorHintSymbol: unique symbol;\ndeclare const stateHintSymbol: unique symbol;\n\nexport interface DataSource<\n TContext,\n TParams,\n TRequest,\n TResponse,\n TData,\n TError,\n TOptions,\n TState,\n TFetchContext,\n> {\n readonly name: string;\n\n fetch: (\n context: TContext,\n fetchContext: TFetchContext,\n request: TRequest,\n ) => Promise<TResponse> | TResponse;\n tags?: (params: ActualParams<NoInfer<TParams>, NoInfer<TRequest>>) => DataSourceTag[];\n\n transformParams?: (params: TParams) => NoInfer<TRequest>;\n transformResponse?: (response: TResponse) => TData;\n\n options?: Partial<TOptions>;\n [stateHintSymbol]?: TState;\n [errorHintSymbol]?: TError;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyDataSource = DataSource<any, any, any, any, any, any, any, any, any>;\n\nexport type DataSourceContext<TDataSource> =\n TDataSource extends DataSource<\n infer TContext,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TContext\n : never;\n\nexport type DataSourceParams<TDataSource> =\n TDataSource extends DataSource<\n infer _TContext,\n infer TParams,\n infer TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? ActualParams<TParams, TRequest>\n : never;\n\nexport type DataSourceRequest<TDataSource> =\n TDataSource extends DataSource<\n infer _TContext,\n infer _TParams,\n infer TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TRequest\n : never;\n\nexport type DataSourceResponse<TDataSource> =\n TDataSource extends DataSource<\n infer _TContext,\n infer _TParams,\n infer _TRequest,\n infer TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TResponse\n : never;\n\nexport type DataSourceData<TDataSource> =\n TDataSource extends DataSource<\n infer _TContext,\n infer _TParams,\n infer _TRequest,\n infer TResponse,\n infer TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? ActualData<TData, TResponse>\n : never;\n\nexport type DataSourceError<TDataSource> =\n TDataSource extends DataSource<\n infer _TContext,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TError\n : never;\n\nexport type DataSourceOptions<TDataSource> =\n TDataSource extends DataSource<\n infer _TContext,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TOptions\n : never;\n\nexport type DataSourceState<TDataSource> =\n TDataSource extends DataSource<\n infer _TContext,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer TState,\n infer _TFetchContext\n >\n ? TState\n : never;\n\nexport type DataSourceFetchContext<TDataSource> =\n TDataSource extends DataSource<\n infer _TContext,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer TFetchContext\n >\n ? TFetchContext\n : never;\n\nexport type ActualParams<TParams, TRequest> =\n | (unknown extends TParams ? TRequest : TParams)\n | typeof idle;\n\nexport type ActualData<TData, TResponse> = unknown extends TData ? TResponse : TData;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AsyncBoundary = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactErrorBoundary = require("react-error-boundary");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
var AsyncBoundary = exports.AsyncBoundary = function AsyncBoundary(_ref) {
|
|
12
|
+
var LoadingView = _ref.LoadingView,
|
|
13
|
+
ErrorView = _ref.ErrorView,
|
|
14
|
+
onReset = _ref.onReset,
|
|
15
|
+
children = _ref.children;
|
|
16
|
+
var fallbackRender = _react.default.useCallback(function (_ref2) {
|
|
17
|
+
var error = _ref2.error,
|
|
18
|
+
resetErrorBoundary = _ref2.resetErrorBoundary;
|
|
19
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ErrorView, {
|
|
20
|
+
error: error,
|
|
21
|
+
action: {
|
|
22
|
+
handler: resetErrorBoundary
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}, [ErrorView]);
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactErrorBoundary.ErrorBoundary, {
|
|
27
|
+
fallbackRender: fallbackRender,
|
|
28
|
+
onReset: onReset,
|
|
29
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Suspense, {
|
|
30
|
+
fallback: /*#__PURE__*/(0, _jsxRuntime.jsx)(LoadingView, {}),
|
|
31
|
+
children: children
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
// #sourceMappingURL=AsyncBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactErrorBoundary","_jsxRuntime","e","__esModule","default","AsyncBoundary","exports","_ref","LoadingView","ErrorView","onReset","children","fallbackRender","React","useCallback","_ref2","error","resetErrorBoundary","_jsx","action","handler","ErrorBoundary","Suspense","fallback"],"sources":["AsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {FallbackProps} from 'react-error-boundary';\nimport {ErrorBoundary} from 'react-error-boundary';\n\nimport type {AsyncBoundaryProps} from './types';\n\nexport const AsyncBoundary: React.FC<AsyncBoundaryProps> = ({\n LoadingView,\n ErrorView,\n onReset,\n children,\n}) => {\n const fallbackRender = React.useCallback(\n ({error, resetErrorBoundary}: FallbackProps) => (\n <ErrorView error={error} action={{handler: resetErrorBoundary}} />\n ),\n [ErrorView],\n );\n\n return (\n <ErrorBoundary fallbackRender={fallbackRender} onReset={onReset}>\n <React.Suspense fallback={<LoadingView />}>{children}</React.Suspense>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,mBAAA,GAAAD,OAAA;AAAmD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI5C,IAAMG,aAA2C,GAAAC,OAAA,CAAAD,aAAA,GAAG,SAA9CA,aAA2CA,CAAAE,IAAA,EAKlD;EAAA,IAJFC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IACXC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IACPC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;EAER,IAAMC,cAAc,GAAGC,cAAK,CAACC,WAAW,CACpC,UAAAC,KAAA;IAAA,IAAEC,KAAK,GAAAD,KAAA,CAALC,KAAK;MAAEC,kBAAkB,GAAAF,KAAA,CAAlBE,kBAAkB;IAAA,oBACvB,IAAAC,eAAA,EAACT,SAAS;MAACO,KAAK,EAAEA,KAAM;MAACG,MAAM,EAAE;QAACC,OAAO,EAAEH;MAAkB;IAAE,CAAE,CAAC;EAAA,CACrE,EACD,CAACR,SAAS,CACd,CAAC;EAED,oBACI,IAAAS,eAAA,EAACG,iCAAa;IAACT,cAAc,EAAEA,cAAe;IAACF,OAAO,EAAEA,OAAQ;IAAAC,QAAA,eAC5D,IAAAO,eAAA,EAACL,cAAK,CAACS,QAAQ;MAACC,QAAQ,eAAE,IAAAL,eAAA,EAACV,WAAW,IAAE,CAAE;MAAAG,QAAA,EAAEA;IAAQ,CAAiB;EAAC,CAC3D,CAAC;AAExB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "AsyncBoundary", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _AsyncBoundary.AsyncBoundary;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "withAsyncBoundary", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _withAsyncBoundary.withAsyncBoundary;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _AsyncBoundary = require("./AsyncBoundary");
|
|
19
|
+
var _withAsyncBoundary = require("./withAsyncBoundary");
|
|
20
|
+
// #sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_AsyncBoundary","require","_withAsyncBoundary"],"sources":["index.ts"],"sourcesContent":["export type {AsyncBoundaryProps, AsyncBoundaryComponent} from './types';\nexport {AsyncBoundary} from './AsyncBoundary';\nexport {withAsyncBoundary} from './withAsyncBoundary';\n"],"mappings":";;;;;;;;;;;;;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import type { ErrorViewProps } from '../types';
|
|
3
|
+
export interface AsyncBoundaryProps {
|
|
4
|
+
LoadingView: ComponentType;
|
|
5
|
+
ErrorView: ComponentType<ErrorViewProps>;
|
|
6
|
+
onReset?: () => void;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface AsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {
|
|
10
|
+
Content: React.ComponentType<TProps>;
|
|
11
|
+
Loading: AsyncBoundaryProps['LoadingView'];
|
|
12
|
+
Error: AsyncBoundaryProps['ErrorView'];
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nexport interface AsyncBoundaryProps {\n LoadingView: ComponentType;\n ErrorView: ComponentType<ErrorViewProps>;\n onReset?: () => void;\n children: ReactNode;\n}\n\nexport interface AsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {\n Content: React.ComponentType<TProps>;\n Loading: AsyncBoundaryProps['LoadingView'];\n Error: AsyncBoundaryProps['ErrorView'];\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AsyncBoundaryComponent, AsyncBoundaryProps } from './types';
|
|
3
|
+
export declare const withAsyncBoundary: <TProps extends object>(Component: React.ComponentType<TProps>, LoadingView: AsyncBoundaryProps["LoadingView"], ErrorView: AsyncBoundaryProps["ErrorView"]) => AsyncBoundaryComponent<TProps>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withAsyncBoundary = void 0;
|
|
7
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _AsyncBoundary = require("./AsyncBoundary");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
var withAsyncBoundary = exports.withAsyncBoundary = function withAsyncBoundary(Component, LoadingView, ErrorView) {
|
|
13
|
+
var WrappedComponent = function WrappedComponent(props) {
|
|
14
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AsyncBoundary.AsyncBoundary, {
|
|
15
|
+
LoadingView: LoadingView,
|
|
16
|
+
ErrorView: ErrorView,
|
|
17
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, (0, _objectSpread2.default)({}, props))
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
WrappedComponent.displayName = "WithAsyncBoundary(".concat(Component.displayName || Component.name, ")");
|
|
21
|
+
WrappedComponent.Content = Component;
|
|
22
|
+
WrappedComponent.Loading = LoadingView;
|
|
23
|
+
WrappedComponent.Error = ErrorView;
|
|
24
|
+
return WrappedComponent;
|
|
25
|
+
};
|
|
26
|
+
// #sourceMappingURL=withAsyncBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_AsyncBoundary","_jsxRuntime","e","__esModule","default","withAsyncBoundary","exports","Component","LoadingView","ErrorView","WrappedComponent","props","_jsx","AsyncBoundary","children","_objectSpread","displayName","concat","name","Content","Loading","Error"],"sources":["withAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport {AsyncBoundary} from './AsyncBoundary';\nimport type {AsyncBoundaryComponent, AsyncBoundaryProps} from './types';\n\nexport const withAsyncBoundary = <TProps extends object>(\n Component: React.ComponentType<TProps>,\n LoadingView: AsyncBoundaryProps['LoadingView'],\n ErrorView: AsyncBoundaryProps['ErrorView'],\n) => {\n const WrappedComponent = ((props: TProps) => (\n <AsyncBoundary LoadingView={LoadingView} ErrorView={ErrorView}>\n <Component {...props} />\n </AsyncBoundary>\n )) as AsyncBoundaryComponent<TProps>;\n\n WrappedComponent.displayName = `WithAsyncBoundary(${Component.displayName || Component.name})`;\n\n WrappedComponent.Content = Component;\n WrappedComponent.Loading = LoadingView;\n WrappedComponent.Error = ErrorView;\n\n return WrappedComponent;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAD,OAAA;AAA8C,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGvC,IAAMG,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,SAApBA,iBAAiBA,CAC1BE,SAAsC,EACtCC,WAA8C,EAC9CC,SAA0C,EACzC;EACD,IAAMC,gBAAgB,GAAI,SAApBA,gBAAgBA,CAAKC,KAAa;IAAA,oBACpC,IAAAC,eAAA,EAACC,4BAAa;MAACL,WAAW,EAAEA,WAAY;MAACC,SAAS,EAAEA,SAAU;MAAAK,QAAA,eAC1D,IAAAF,eAAA,EAACL,SAAS,MAAAQ,sBAAA,MAAKJ,KAAK,CAAG;IAAC,CACb,CAAC;EAAA,CACgB;EAEpCD,gBAAgB,CAACM,WAAW,wBAAAC,MAAA,CAAwBV,SAAS,CAACS,WAAW,IAAIT,SAAS,CAACW,IAAI,MAAG;EAE9FR,gBAAgB,CAACS,OAAO,GAAGZ,SAAS;EACpCG,gBAAgB,CAACU,OAAO,GAAGZ,WAAW;EACtCE,gBAAgB,CAACW,KAAK,GAAGZ,SAAS;EAElC,OAAOC,gBAAgB;AAC3B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EmptyView","exports"],"sources":["EmptyView.tsx"],"sourcesContent":["import type React from 'react';\n\nexport const EmptyView: React.FC = () => {\n return null;\n};\n"],"mappings":";;;;;;AAEO,IAAMA,SAAmB,GAAAC,OAAA,CAAAD,SAAA,GAAG,SAAtBA,SAAmBA,CAAA,EAAS;EACrC,OAAO,IAAI;AACf,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EmptyView } from './EmptyView';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "EmptyView", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _EmptyView.EmptyView;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _EmptyView = require("./EmptyView");
|
|
13
|
+
// #sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_EmptyView","require"],"sources":["index.ts"],"sourcesContent":["export {EmptyView} from './EmptyView';\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ReactNode} from 'react';\n\nexport interface ErrorAction {\n handler: () => unknown;\n children?: ReactNode;\n}\n\nexport interface ErrorViewProps<TError> {\n error: TError | null;\n action?: ErrorAction;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ReactNode} from 'react';\n\nexport interface ErrorAction {\n handler: () => unknown;\n children?: ReactNode;\n}\n\nexport interface ErrorViewProps<TError = unknown> {\n error: TError | null;\n action?: ErrorAction;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
export * from './components/AsyncBoundary';
|
|
2
|
+
export * from './components/DataLoader';
|
|
3
|
+
export * from './components/DataInfiniteLoader';
|
|
4
|
+
export * from './components/EmptyView';
|
|
5
|
+
export type { ErrorAction, ErrorViewProps } from './components/types';
|
|
1
6
|
export { DataManagerContext, useDataManager } from './DataManagerContext';
|
|
2
7
|
export { DataManagerProvider } from './DataManagerProvider';
|
|
3
8
|
export type { DataManagerProviderProps } from './DataManagerProvider';
|
|
4
9
|
export type { WithDataManagerProps } from './withDataManager';
|
|
5
10
|
export { withDataManager } from './withDataManager';
|
|
6
|
-
export type { ErrorAction, ErrorViewProps } from './components/types';
|
|
7
|
-
export * from './components/DataLoader';
|
|
8
|
-
export * from './components/DataInfiniteLoader';
|
package/build/cjs/react/index.js
CHANGED
|
@@ -33,9 +33,18 @@ Object.defineProperty(exports, "withDataManager", {
|
|
|
33
33
|
return _withDataManager.withDataManager;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
var _AsyncBoundary = require("./components/AsyncBoundary");
|
|
37
|
+
Object.keys(_AsyncBoundary).forEach(function (key) {
|
|
38
|
+
if (key === "default" || key === "__esModule") return;
|
|
39
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
40
|
+
if (key in exports && exports[key] === _AsyncBoundary[key]) return;
|
|
41
|
+
Object.defineProperty(exports, key, {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () {
|
|
44
|
+
return _AsyncBoundary[key];
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
39
48
|
var _DataLoader = require("./components/DataLoader");
|
|
40
49
|
Object.keys(_DataLoader).forEach(function (key) {
|
|
41
50
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -60,4 +69,19 @@ Object.keys(_DataInfiniteLoader).forEach(function (key) {
|
|
|
60
69
|
}
|
|
61
70
|
});
|
|
62
71
|
});
|
|
72
|
+
var _EmptyView = require("./components/EmptyView");
|
|
73
|
+
Object.keys(_EmptyView).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
76
|
+
if (key in exports && exports[key] === _EmptyView[key]) return;
|
|
77
|
+
Object.defineProperty(exports, key, {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function () {
|
|
80
|
+
return _EmptyView[key];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
var _DataManagerContext = require("./DataManagerContext");
|
|
85
|
+
var _DataManagerProvider = require("./DataManagerProvider");
|
|
86
|
+
var _withDataManager = require("./withDataManager");
|
|
63
87
|
// #sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_AsyncBoundary","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_DataLoader","_DataInfiniteLoader","_EmptyView","_DataManagerContext","_DataManagerProvider","_withDataManager"],"sources":["index.ts"],"sourcesContent":["export * from './components/AsyncBoundary';\nexport * from './components/DataLoader';\nexport * from './components/DataInfiniteLoader';\nexport * from './components/EmptyView';\nexport type {ErrorAction, ErrorViewProps} from './components/types';\n\nexport {DataManagerContext, useDataManager} from './DataManagerContext';\nexport {DataManagerProvider} from './DataManagerProvider';\nexport type {DataManagerProviderProps} from './DataManagerProvider';\nexport type {WithDataManagerProps} from './withDataManager';\nexport {withDataManager} from './withDataManager';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,cAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,WAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,WAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,WAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,WAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,mBAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,mBAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,mBAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,mBAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,UAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,UAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAW,UAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,UAAA,CAAAX,GAAA;IAAA;EAAA;AAAA;AAGA,IAAAY,mBAAA,GAAAhB,OAAA;AACA,IAAAiB,oBAAA,GAAAjB,OAAA;AAGA,IAAAkB,gBAAA,GAAAlB,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.QueryAsyncBoundary = void 0;
|
|
7
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _reactQuery = require("@tanstack/react-query");
|
|
10
|
+
var _react2 = require("../../../react");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
var QueryAsyncBoundary = exports.QueryAsyncBoundary = function QueryAsyncBoundary(props) {
|
|
14
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactQuery.QueryErrorResetBoundary, {
|
|
15
|
+
children: function children(_ref) {
|
|
16
|
+
var reset = _ref.reset;
|
|
17
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.AsyncBoundary, (0, _objectSpread2.default)({
|
|
18
|
+
onReset: reset
|
|
19
|
+
}, props));
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
// #sourceMappingURL=QueryAsyncBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactQuery","_react2","_jsxRuntime","e","__esModule","default","QueryAsyncBoundary","exports","props","_jsx","QueryErrorResetBoundary","children","_ref","reset","AsyncBoundary","_objectSpread","onReset"],"sources":["QueryAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport {QueryErrorResetBoundary} from '@tanstack/react-query';\n\nimport {AsyncBoundary} from '../../../react';\n\nimport type {QueryAsyncBoundaryProps} from './types';\n\nexport const QueryAsyncBoundary: React.FC<QueryAsyncBoundaryProps> = (props) => (\n <QueryErrorResetBoundary>\n {({reset}) => <AsyncBoundary onReset={reset} {...props} />}\n </QueryErrorResetBoundary>\n);\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAA6C,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAItC,IAAMG,kBAAqD,GAAAC,OAAA,CAAAD,kBAAA,GAAG,SAAxDA,kBAAqDA,CAAIE,KAAK;EAAA,oBACvE,IAAAC,eAAA,EAACC,mCAAuB;IAAAC,QAAA,EACnB,SAAAA,SAAAC,IAAA;MAAA,IAAEC,KAAK,GAAAD,IAAA,CAALC,KAAK;MAAA,oBAAM,IAAAJ,eAAA,EAACK,qBAAa,MAAAC,sBAAA;QAACC,OAAO,EAAEH;MAAM,GAAKL,KAAK,CAAG,CAAC;IAAA;EAAA,CACrC,CAAC;AAAA,CAC7B","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "QueryAsyncBoundary", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _QueryAsyncBoundary.QueryAsyncBoundary;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "withQueryAsyncBoundary", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _withQueryAsyncBoundary.withQueryAsyncBoundary;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _QueryAsyncBoundary = require("./QueryAsyncBoundary");
|
|
19
|
+
var _withQueryAsyncBoundary = require("./withQueryAsyncBoundary");
|
|
20
|
+
// #sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_QueryAsyncBoundary","require","_withQueryAsyncBoundary"],"sources":["index.ts"],"sourcesContent":["export {QueryAsyncBoundary} from './QueryAsyncBoundary';\nexport type {QueryAsyncBoundaryProps, QueryAsyncBoundaryComponent} from './types';\nexport {withQueryAsyncBoundary} from './withQueryAsyncBoundary';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAEA,IAAAC,uBAAA,GAAAD,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AsyncBoundaryProps } from '../../../react';
|
|
2
|
+
export interface QueryAsyncBoundaryProps extends AsyncBoundaryProps {
|
|
3
|
+
}
|
|
4
|
+
export interface QueryAsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {
|
|
5
|
+
Content: React.ComponentType<TProps>;
|
|
6
|
+
Loading: QueryAsyncBoundaryProps['LoadingView'];
|
|
7
|
+
Error: QueryAsyncBoundaryProps['ErrorView'];
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {AsyncBoundaryProps} from '../../../react';\n\nexport interface QueryAsyncBoundaryProps extends AsyncBoundaryProps {}\n\nexport interface QueryAsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {\n Content: React.ComponentType<TProps>;\n Loading: QueryAsyncBoundaryProps['LoadingView'];\n Error: QueryAsyncBoundaryProps['ErrorView'];\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QueryAsyncBoundaryComponent, QueryAsyncBoundaryProps } from './types';
|
|
3
|
+
export declare const withQueryAsyncBoundary: <TProps extends object>(Component: React.ComponentType<TProps>, LoadingView: QueryAsyncBoundaryProps["LoadingView"], ErrorView: QueryAsyncBoundaryProps["ErrorView"]) => QueryAsyncBoundaryComponent<TProps>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withQueryAsyncBoundary = void 0;
|
|
7
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _QueryAsyncBoundary = require("./QueryAsyncBoundary");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
var withQueryAsyncBoundary = exports.withQueryAsyncBoundary = function withQueryAsyncBoundary(Component, LoadingView, ErrorView) {
|
|
13
|
+
var WrappedComponent = function WrappedComponent(props) {
|
|
14
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryAsyncBoundary.QueryAsyncBoundary, {
|
|
15
|
+
LoadingView: LoadingView,
|
|
16
|
+
ErrorView: ErrorView,
|
|
17
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, (0, _objectSpread2.default)({}, props))
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
WrappedComponent.displayName = "WithQueryAsyncBoundary(".concat(Component.displayName || Component.name, ")");
|
|
21
|
+
WrappedComponent.Content = Component;
|
|
22
|
+
WrappedComponent.Loading = LoadingView;
|
|
23
|
+
WrappedComponent.Error = ErrorView;
|
|
24
|
+
return WrappedComponent;
|
|
25
|
+
};
|
|
26
|
+
// #sourceMappingURL=withQueryAsyncBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_QueryAsyncBoundary","_jsxRuntime","e","__esModule","default","withQueryAsyncBoundary","exports","Component","LoadingView","ErrorView","WrappedComponent","props","_jsx","QueryAsyncBoundary","children","_objectSpread","displayName","concat","name","Content","Loading","Error"],"sources":["withQueryAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport {QueryAsyncBoundary} from './QueryAsyncBoundary';\nimport type {QueryAsyncBoundaryComponent, QueryAsyncBoundaryProps} from './types';\n\nexport const withQueryAsyncBoundary = <TProps extends object>(\n Component: React.ComponentType<TProps>,\n LoadingView: QueryAsyncBoundaryProps['LoadingView'],\n ErrorView: QueryAsyncBoundaryProps['ErrorView'],\n) => {\n const WrappedComponent = ((props: TProps) => (\n <QueryAsyncBoundary LoadingView={LoadingView} ErrorView={ErrorView}>\n <Component {...props} />\n </QueryAsyncBoundary>\n )) as QueryAsyncBoundaryComponent<TProps>;\n\n WrappedComponent.displayName = `WithQueryAsyncBoundary(${\n Component.displayName || Component.name\n })`;\n\n WrappedComponent.Content = Component;\n WrappedComponent.Loading = LoadingView;\n WrappedComponent.Error = ErrorView;\n\n return WrappedComponent;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAD,OAAA;AAAwD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjD,IAAMG,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,SAAzBA,sBAAsBA,CAC/BE,SAAsC,EACtCC,WAAmD,EACnDC,SAA+C,EAC9C;EACD,IAAMC,gBAAgB,GAAI,SAApBA,gBAAgBA,CAAKC,KAAa;IAAA,oBACpC,IAAAC,eAAA,EAACC,sCAAkB;MAACL,WAAW,EAAEA,WAAY;MAACC,SAAS,EAAEA,SAAU;MAAAK,QAAA,eAC/D,IAAAF,eAAA,EAACL,SAAS,MAAAQ,sBAAA,MAAKJ,KAAK,CAAG;IAAC,CACR,CAAC;EAAA,CACgB;EAEzCD,gBAAgB,CAACM,WAAW,6BAAAC,MAAA,CACxBV,SAAS,CAACS,WAAW,IAAIT,SAAS,CAACW,IAAI,MACxC;EAEHR,gBAAgB,CAACS,OAAO,GAAGZ,SAAS;EACpCG,gBAAgB,CAACU,OAAO,GAAGZ,WAAW;EACtCE,gBAAgB,CAACW,KAAK,GAAGZ,SAAS;EAElC,OAAOC,gBAAgB;AAC3B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Overwrite } from 'utility-types';
|
|
2
|
+
import type { DataSourceData, DataSourceOptions, DataSourceParams, DataSourceState, idle } from '../../core';
|
|
3
|
+
import type { AnyQueryDataSource } from '../types/base';
|
|
4
|
+
type SuspenseQueryOptions<TDataSource extends AnyQueryDataSource> = Omit<Partial<DataSourceOptions<TDataSource>>, 'suspense' | 'enabled' | 'throwOnError' | 'retryOnMount' | 'placeholderData'>;
|
|
5
|
+
type SuspenseQueryResult<TDataSource extends AnyQueryDataSource> = Overwrite<DataSourceState<TDataSource>, {
|
|
6
|
+
data: NonNullable<DataSourceData<TDataSource>>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const useSuspenseQueryData: <TDataSource extends AnyQueryDataSource>(dataSource: TDataSource, params: Exclude<DataSourceParams<TDataSource>, typeof idle>, options?: SuspenseQueryOptions<TDataSource>) => SuspenseQueryResult<TDataSource>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useSuspenseQueryData = void 0;
|
|
7
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
8
|
+
var _useQueryData = require("./useQueryData");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var defaultThrowOnError = function defaultThrowOnError(_error, query) {
|
|
11
|
+
return query.state.data === undefined;
|
|
12
|
+
};
|
|
13
|
+
var useSuspenseQueryData = exports.useSuspenseQueryData = function useSuspenseQueryData(dataSource, params, options) {
|
|
14
|
+
return (0, _useQueryData.useQueryData)(dataSource, params, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, options), {}, {
|
|
15
|
+
suspense: true,
|
|
16
|
+
enabled: true,
|
|
17
|
+
throwOnError: defaultThrowOnError,
|
|
18
|
+
retryOnMount: true,
|
|
19
|
+
placeholderData: undefined
|
|
20
|
+
}));
|
|
21
|
+
};
|
|
22
|
+
// #sourceMappingURL=useSuspenseQueryData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_useQueryData","require","_interopRequireDefault","e","__esModule","default","defaultThrowOnError","_error","query","state","data","undefined","useSuspenseQueryData","exports","dataSource","params","options","useQueryData","_objectSpread","suspense","enabled","throwOnError","retryOnMount","placeholderData"],"sources":["useSuspenseQueryData.ts"],"sourcesContent":["import type {Query} from '@tanstack/react-query';\nimport type {Overwrite} from 'utility-types';\n\nimport type {\n DataSourceData,\n DataSourceOptions,\n DataSourceParams,\n DataSourceState,\n idle,\n} from '../../core';\nimport type {AnyQueryDataSource} from '../types/base';\n\nimport {useQueryData} from './useQueryData';\n\ntype SuspenseQueryOptions<TDataSource extends AnyQueryDataSource> = Omit<\n Partial<DataSourceOptions<TDataSource>>,\n 'suspense' | 'enabled' | 'throwOnError' | 'retryOnMount' | 'placeholderData'\n>;\n\ntype SuspenseQueryResult<TDataSource extends AnyQueryDataSource> = Overwrite<\n DataSourceState<TDataSource>,\n {data: NonNullable<DataSourceData<TDataSource>>}\n>;\n\nconst defaultThrowOnError = (_error: unknown, query: Query) => query.state.data === undefined;\n\nexport const useSuspenseQueryData = <TDataSource extends AnyQueryDataSource>(\n dataSource: TDataSource,\n params: Exclude<DataSourceParams<TDataSource>, typeof idle>,\n options?: SuspenseQueryOptions<TDataSource>,\n): SuspenseQueryResult<TDataSource> => {\n return useQueryData(dataSource, params, {\n ...options,\n suspense: true,\n enabled: true,\n throwOnError: defaultThrowOnError,\n retryOnMount: true,\n placeholderData: undefined,\n } as Partial<DataSourceOptions<TDataSource>>) as SuspenseQueryResult<TDataSource>;\n};\n"],"mappings":";;;;;;;AAYA,IAAAA,aAAA,GAAAC,OAAA;AAA2C,SAAAC,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAY3C,IAAMG,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,MAAe,EAAEC,KAAY;EAAA,OAAKA,KAAK,CAACC,KAAK,CAACC,IAAI,KAAKC,SAAS;AAAA;AAEtF,IAAMC,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,SAAvBA,oBAAoBA,CAC7BE,UAAuB,EACvBC,MAA2D,EAC3DC,OAA2C,EACR;EACnC,OAAO,IAAAC,0BAAY,EAACH,UAAU,EAAEC,MAAM,MAAAG,sBAAA,MAAAA,sBAAA,MAC/BF,OAAO;IACVG,QAAQ,EAAE,IAAI;IACdC,OAAO,EAAE,IAAI;IACbC,YAAY,EAAEf,mBAAmB;IACjCgB,YAAY,EAAE,IAAI;IAClBC,eAAe,EAAEZ;EAAS,EACc,CAAC;AACjD,CAAC","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './components/QueryAsyncBoundary';
|
|
1
2
|
export type { QueryDataSourceContext, AnyQueryDataSource } from './types/base';
|
|
2
3
|
export type { RefetchIntervalFunction, RefetchInterval } from './types/refetch-interval';
|
|
3
4
|
export { useQueryContext } from './hooks/useQueryContext';
|
|
@@ -5,6 +6,7 @@ export { useQueryData } from './hooks/useQueryData';
|
|
|
5
6
|
export { useQueryResponses } from './hooks/useQueryResponses';
|
|
6
7
|
export { useRefetchAll } from './hooks/useRefetchAll';
|
|
7
8
|
export { useRefetchErrored } from './hooks/useRefetchErrored';
|
|
9
|
+
export { useSuspenseQueryData } from './hooks/useSuspenseQueryData';
|
|
8
10
|
export type { InfiniteQueryDataSource, AnyInfiniteQueryDataSource } from './impl/infinite/types';
|
|
9
11
|
export { makeInfiniteQueryDataSource } from './impl/infinite/factory';
|
|
10
12
|
export { composeOptions as composeInfiniteQueryOptions } from './impl/infinite/utils';
|
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
useQueryContext: true,
|
|
8
|
+
useQueryData: true,
|
|
9
|
+
useQueryResponses: true,
|
|
10
|
+
useRefetchAll: true,
|
|
11
|
+
useRefetchErrored: true,
|
|
12
|
+
useSuspenseQueryData: true,
|
|
13
|
+
makeInfiniteQueryDataSource: true,
|
|
14
|
+
composeInfiniteQueryOptions: true,
|
|
15
|
+
makePlainQueryDataSource: true,
|
|
16
|
+
composePlainQueryOptions: true,
|
|
17
|
+
normalizeStatus: true,
|
|
18
|
+
getProgressiveRefetch: true,
|
|
19
|
+
ClientDataManager: true,
|
|
20
|
+
DataSourceProvider: true
|
|
21
|
+
};
|
|
6
22
|
Object.defineProperty(exports, "ClientDataManager", {
|
|
7
23
|
enumerable: true,
|
|
8
24
|
get: function () {
|
|
@@ -81,11 +97,30 @@ Object.defineProperty(exports, "useRefetchErrored", {
|
|
|
81
97
|
return _useRefetchErrored.useRefetchErrored;
|
|
82
98
|
}
|
|
83
99
|
});
|
|
100
|
+
Object.defineProperty(exports, "useSuspenseQueryData", {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
get: function () {
|
|
103
|
+
return _useSuspenseQueryData.useSuspenseQueryData;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
var _QueryAsyncBoundary = require("./components/QueryAsyncBoundary");
|
|
107
|
+
Object.keys(_QueryAsyncBoundary).forEach(function (key) {
|
|
108
|
+
if (key === "default" || key === "__esModule") return;
|
|
109
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
110
|
+
if (key in exports && exports[key] === _QueryAsyncBoundary[key]) return;
|
|
111
|
+
Object.defineProperty(exports, key, {
|
|
112
|
+
enumerable: true,
|
|
113
|
+
get: function () {
|
|
114
|
+
return _QueryAsyncBoundary[key];
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
});
|
|
84
118
|
var _useQueryContext = require("./hooks/useQueryContext");
|
|
85
119
|
var _useQueryData = require("./hooks/useQueryData");
|
|
86
120
|
var _useQueryResponses = require("./hooks/useQueryResponses");
|
|
87
121
|
var _useRefetchAll = require("./hooks/useRefetchAll");
|
|
88
122
|
var _useRefetchErrored = require("./hooks/useRefetchErrored");
|
|
123
|
+
var _useSuspenseQueryData = require("./hooks/useSuspenseQueryData");
|
|
89
124
|
var _factory = require("./impl/infinite/factory");
|
|
90
125
|
var _utils = require("./impl/infinite/utils");
|
|
91
126
|
var _factory2 = require("./impl/plain/factory");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_QueryAsyncBoundary","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_useQueryContext","_useQueryData","_useQueryResponses","_useRefetchAll","_useRefetchErrored","_useSuspenseQueryData","_factory","_utils","_factory2","_utils2","_normalizeStatus","_getProgressiveRefetch","_ClientDataManager","_DataSourceProvider"],"sources":["index.ts"],"sourcesContent":["export * from './components/QueryAsyncBoundary';\n\nexport type {QueryDataSourceContext, AnyQueryDataSource} from './types/base';\nexport type {RefetchIntervalFunction, RefetchInterval} from './types/refetch-interval';\n\nexport {useQueryContext} from './hooks/useQueryContext';\nexport {useQueryData} from './hooks/useQueryData';\nexport {useQueryResponses} from './hooks/useQueryResponses';\nexport {useRefetchAll} from './hooks/useRefetchAll';\nexport {useRefetchErrored} from './hooks/useRefetchErrored';\nexport {useSuspenseQueryData} from './hooks/useSuspenseQueryData';\n\nexport type {InfiniteQueryDataSource, AnyInfiniteQueryDataSource} from './impl/infinite/types';\nexport {makeInfiniteQueryDataSource} from './impl/infinite/factory';\nexport {composeOptions as composeInfiniteQueryOptions} from './impl/infinite/utils';\n\nexport type {PlainQueryDataSource, AnyPlainQueryDataSource} from './impl/plain/types';\nexport {makePlainQueryDataSource} from './impl/plain/factory';\nexport {composeOptions as composePlainQueryOptions} from './impl/plain/utils';\n\nexport {normalizeStatus} from './utils/normalizeStatus';\nexport type {ProgressiveRefetchOptions} from './utils/getProgressiveRefetch';\nexport {getProgressiveRefetch} from './utils/getProgressiveRefetch';\n\nexport type {ClientDataManagerConfig} from './ClientDataManager';\nexport {ClientDataManager} from './ClientDataManager';\n\nexport {DataSourceProvider} from './DataSourceProvider';\n\nexport type {QueryNormalizer} from './types/normalizer';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,mBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,mBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,mBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AAKA,IAAAS,gBAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AACA,IAAAe,kBAAA,GAAAf,OAAA;AACA,IAAAgB,cAAA,GAAAhB,OAAA;AACA,IAAAiB,kBAAA,GAAAjB,OAAA;AACA,IAAAkB,qBAAA,GAAAlB,OAAA;AAGA,IAAAmB,QAAA,GAAAnB,OAAA;AACA,IAAAoB,MAAA,GAAApB,OAAA;AAGA,IAAAqB,SAAA,GAAArB,OAAA;AACA,IAAAsB,OAAA,GAAAtB,OAAA;AAEA,IAAAuB,gBAAA,GAAAvB,OAAA;AAEA,IAAAwB,sBAAA,GAAAxB,OAAA;AAGA,IAAAyB,kBAAA,GAAAzB,OAAA;AAEA,IAAA0B,mBAAA,GAAA1B,OAAA","ignoreList":[]}
|