mirror of
https://github.com/re-rxjs/react-rxjs.git
synced 2025-12-08 18:01:51 +00:00
expose BehaviorObservable
This commit is contained in:
parent
9d0f6124d2
commit
c1b7f03661
5
src/BehaviorObservable.ts
Normal file
5
src/BehaviorObservable.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { Observable } from "rxjs"
|
||||
|
||||
export interface BehaviorObservable<T> extends Observable<T> {
|
||||
getValue: () => T
|
||||
}
|
||||
@ -3,6 +3,7 @@ import { unstable_batchedUpdates as batch } from "./utils/react-batched-updates"
|
||||
setBatch(batch as any)
|
||||
|
||||
export const SUSPENSE = Symbol("SUSPENSE")
|
||||
export { BehaviorObservable } from "./BehaviorObservable"
|
||||
export { connectObservable } from "./connectObservable"
|
||||
export { connectFactoryObservable } from "./connectFactoryObservable"
|
||||
export { distinctShareReplay } from "./operators/distinct-share-replay"
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
import { Observable, Subscription, Subject } from "rxjs"
|
||||
import { SUSPENSE } from "../"
|
||||
import { SUSPENSE, BehaviorObservable } from "../"
|
||||
import { getBatch } from "../utils/batch"
|
||||
|
||||
function defaultTeardown() {}
|
||||
|
||||
export interface BehaviorObservable<T> extends Observable<T> {
|
||||
getValue: () => T
|
||||
}
|
||||
|
||||
const EMPTY_VALUE: any = {}
|
||||
export const EMPTY_VALUE: any = {}
|
||||
export const distinctShareReplay = <T>(
|
||||
compareFn: (a: T, b: T) => boolean = Object.is,
|
||||
teardown = defaultTeardown,
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { Observable, of, Subscription, Subject, race } from "rxjs"
|
||||
import { delay, takeUntil, take, filter, tap } from "rxjs/operators"
|
||||
import { BehaviorObservable } from "./distinct-share-replay"
|
||||
import { SUSPENSE } from "../"
|
||||
import { BehaviorObservable, SUSPENSE } from "../"
|
||||
|
||||
const IS_SSR =
|
||||
typeof window === "undefined" ||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user