From d7df9ca942320fcc47384d9df091982e7cc3b0bd Mon Sep 17 00:00:00 2001 From: Alec Aivazis Date: Wed, 17 May 2023 22:33:37 -0700 Subject: [PATCH] Move isPending to houdini core (#1089) --- packages/houdini-react/src/runtime/routing/index.ts | 1 - .../houdini-react/src/runtime/routing/lib/is_pending.tsx | 5 ----- packages/houdini/src/runtime/lib/types.ts | 5 +++++ 3 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 packages/houdini-react/src/runtime/routing/lib/is_pending.tsx diff --git a/packages/houdini-react/src/runtime/routing/index.ts b/packages/houdini-react/src/runtime/routing/index.ts index 8bafe549f..9ed8c89f5 100644 --- a/packages/houdini-react/src/runtime/routing/index.ts +++ b/packages/houdini-react/src/runtime/routing/index.ts @@ -1,4 +1,3 @@ export * from './components' export { suspense_cache } from './lib/cache' export type { RouterManifest, RouterPageManifest } from './lib/types' -export { isPending } from './lib/is_pending' diff --git a/packages/houdini-react/src/runtime/routing/lib/is_pending.tsx b/packages/houdini-react/src/runtime/routing/lib/is_pending.tsx deleted file mode 100644 index bb06a0aad..000000000 --- a/packages/houdini-react/src/runtime/routing/lib/is_pending.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { PendingValue } from '$houdini/runtime/lib/types' - -export function isPending(value: any): value is typeof PendingValue { - return typeof value === 'symbol' -} diff --git a/packages/houdini/src/runtime/lib/types.ts b/packages/houdini/src/runtime/lib/types.ts index 8a9e45dd6..3d062e81d 100644 --- a/packages/houdini/src/runtime/lib/types.ts +++ b/packages/houdini/src/runtime/lib/types.ts @@ -379,6 +379,11 @@ interface VariableNode { readonly kind: 'Variable' readonly name: NameNode } + export const PendingValue = Symbol('houdini_loading') export type LoadingType = typeof PendingValue + +export function isPending(value: any): value is LoadingType { + return typeof value === 'symbol' +}