mirror of
https://github.com/re-rxjs/react-rxjs.git
synced 2025-12-08 18:01:51 +00:00
v0.1.4
This commit is contained in:
parent
a1c64db22f
commit
f719548d94
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@josepot/react-rxjs",
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.4",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.4",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/josepot/react-rxjs.git"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useEffect, useState } from "react"
|
||||
import { Observable, of } from "rxjs"
|
||||
import { delay, takeUntil } from "rxjs/operators"
|
||||
import { Observable, of, race } from "rxjs"
|
||||
import { delay, take, mapTo } from "rxjs/operators"
|
||||
import {
|
||||
StaticObservableOptions,
|
||||
defaultStaticOptions,
|
||||
@ -66,9 +66,13 @@ export function connectFactoryObservable<
|
||||
setValue(initialValue)
|
||||
} else if (suspenseTime < Infinity) {
|
||||
subscription.add(
|
||||
of(initialValue)
|
||||
.pipe(delay(suspenseTime), takeUntil(sharedObservable$))
|
||||
.subscribe(setValue),
|
||||
race(
|
||||
of(initialValue).pipe(delay(suspenseTime)),
|
||||
sharedObservable$.pipe(
|
||||
take(1),
|
||||
mapTo((x: I | O) => x),
|
||||
),
|
||||
).subscribe(setValue),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user