Remove circular dependencies

This commit is contained in:
Josep M Sobrepere 2020-06-21 15:43:29 +02:00
parent d2e7702796
commit c929c7e210
8 changed files with 15 additions and 11 deletions

1
src/SUSPENSE.ts Normal file
View File

@ -0,0 +1 @@
export const SUSPENSE = Symbol("SUSPENSE")

View File

@ -1,10 +1,10 @@
import { Observable, NEVER, concat } from "rxjs"
import { BehaviorObservable } from "./BehaviorObservable"
import { distinctShareReplay } from "./operators/distinct-share-replay"
import { ConnectorOptions, defaultConnectorOptions } from "./options"
import { SUSPENSE } from "./"
import { useObservable } from "./useObservable"
import reactEnhancer from "./operators/react-enhancer"
import { ConnectorOptions, defaultConnectorOptions } from "./options"
import { BehaviorObservable } from "./BehaviorObservable"
import { SUSPENSE } from "./SUSPENSE"
import { useObservable } from "./useObservable"
export function connectFactoryObservable<
A extends (number | string | boolean | null)[],

View File

@ -1,8 +1,8 @@
import { Observable, NEVER, concat } from "rxjs"
import { distinctShareReplay } from "./"
import { distinctShareReplay } from "./operators/distinct-share-replay"
import reactEnhancer from "./operators/react-enhancer"
import { useObservable } from "./useObservable"
import { ConnectorOptions, defaultConnectorOptions } from "./options"
import reactEnhancer from "./operators/react-enhancer"
export function connectObservable<T>(
observable: Observable<T>,

View File

@ -1,4 +1,4 @@
export const SUSPENSE = Symbol("SUSPENSE")
export { SUSPENSE } from "./SUSPENSE"
export { BehaviorObservable } from "./BehaviorObservable"
export { connectObservable } from "./connectObservable"
export { connectFactoryObservable } from "./connectFactoryObservable"

View File

@ -1,5 +1,6 @@
import { Observable, Subscription, Subject } from "rxjs"
import { SUSPENSE, BehaviorObservable } from "../"
import { SUSPENSE } from "../SUSPENSE"
import { BehaviorObservable } from "../BehaviorObservable"
function defaultTeardown() {}

View File

@ -1,6 +1,7 @@
import { Observable, of, Subscription, Subject, race } from "rxjs"
import { delay, takeUntil, take, filter, tap } from "rxjs/operators"
import { BehaviorObservable, SUSPENSE } from "../"
import { BehaviorObservable } from "../BehaviorObservable"
import { SUSPENSE } from "../SUSPENSE"
const IS_SSR =
typeof window === "undefined" ||

View File

@ -1,6 +1,6 @@
import { ObservableInput, from } from "rxjs"
import { startWith } from "rxjs/operators"
import { SUSPENSE } from "../"
import { SUSPENSE } from "../SUSPENSE"
export const suspend = <T>(source$: ObservableInput<T>) =>
from(source$).pipe(startWith(SUSPENSE))

View File

@ -1,5 +1,6 @@
import { useEffect, useReducer } from "react"
import { BehaviorObservable, SUSPENSE } from "./"
import { SUSPENSE } from "./SUSPENSE"
import { BehaviorObservable } from "./BehaviorObservable"
const reducer = (
_: any,