Skip to content

Commit e3d6f64

Browse files
committed
core: fix SUSPENSE typings
1 parent 85ad4a3 commit e3d6f64

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/core/src/SUSPENSE.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,4 @@
44
* leverage React Suspense API while we are waiting for that value.
55
*/
66
export const SUSPENSE = Symbol("SUSPENSE")
7-
8-
export const filterOutSuspense = <T>(
9-
value: T,
10-
): value is Exclude<T, typeof SUSPENSE> => value !== (SUSPENSE as any)
7+
export type SUSPENSE = typeof SUSPENSE

packages/core/src/useStateObservable.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useRef, useState } from "react"
2-
import { SUSPENSE, filterOutSuspense } from "./SUSPENSE"
2+
import { SUSPENSE } from "./SUSPENSE"
33
import { DefaultedStateObservable, StateObservable } from "@rxstate/core"
44
import { EMPTY_VALUE } from "./internal/empty-value"
55
import useSyncExternalStore from "./internal/useSyncExternalStore"
@@ -12,6 +12,9 @@ interface Ref<T> {
1212
args: [(cb: VoidCb) => VoidCb, () => Exclude<T, typeof SUSPENSE>]
1313
}
1414

15+
const filterOutSuspense = <T>(value: T): value is Exclude<T, SUSPENSE> =>
16+
value !== (SUSPENSE as any)
17+
1518
export const useStateObservable = <O>(
1619
source$: StateObservable<O>,
1720
): Exclude<O, typeof SUSPENSE> => {

0 commit comments

Comments
 (0)