Fixed execution of RxJS teardown logic on complete (7.2.3 regression)

This commit is contained in:
squidfunk
2021-08-11 23:44:01 +02:00
parent 281fa3ac91
commit f4b1f97dd0
22 changed files with 88 additions and 55 deletions

View File

@@ -31,6 +31,7 @@ import {
} from "rxjs"
import {
distinctUntilKeyChanged,
finalize,
map,
switchMap,
tap,
@@ -175,7 +176,8 @@ export function mountCodeBlock(
/* Create and return component */
return watchCodeBlock(el, options)
.pipe(
tap(internal$),
tap(state => internal$.next(state)),
finalize(() => internal$.complete()),
map(state => ({ ref: el, ...state }))
)
}

View File

@@ -23,6 +23,7 @@
import { Observable, Subject } from "rxjs"
import {
filter,
finalize,
map,
mapTo,
mergeWith,
@@ -107,7 +108,8 @@ export function mountDetails(
/* Create and return component */
return watchDetails(el, options)
.pipe(
tap(internal$),
tap(state => internal$.next(state)),
finalize(() => internal$.complete()),
mapTo({ ref: el })
)
}

View File

@@ -28,6 +28,7 @@ import {
of
} from "rxjs"
import {
finalize,
delay,
map,
observeOn,
@@ -131,7 +132,8 @@ export function mountDialog(
/* Create and return component */
return watchDialog(el, options)
.pipe(
tap(internal$),
tap(state => internal$.next(state)),
finalize(() => internal$.complete()),
map(state => ({ ref: el, ...state }))
)
}

View File

@@ -28,6 +28,7 @@ import {
} from "rxjs"
import {
distinctUntilKeyChanged,
finalize,
map,
observeOn,
tap
@@ -139,7 +140,8 @@ export function mountHeaderTitle(
/* Create and return component */
return watchHeaderTitle(headline, options)
.pipe(
tap(internal$),
tap(state => internal$.next(state)),
finalize(() => internal$.complete()),
map(state => ({ ref: el, ...state }))
)
}

View File

@@ -27,6 +27,7 @@ import {
of
} from "rxjs"
import {
finalize,
map,
mapTo,
mergeMap,
@@ -140,7 +141,8 @@ export function mountPalette(
const inputs = getElements<HTMLInputElement>("input", el)
return watchPalette(inputs)
.pipe(
tap(internal$),
tap(state => internal$.next(state)),
finalize(() => internal$.complete()),
map(state => ({ ref: el, ...state }))
)
}

View File

@@ -32,6 +32,7 @@ import {
distinctUntilChanged,
distinctUntilKeyChanged,
filter,
finalize,
map,
take,
takeLast,
@@ -172,7 +173,8 @@ export function mountSearchQuery(
/* Create and return component */
return watchSearchQuery(el, { tx$, rx$ })
.pipe(
tap(internal$),
tap(state => internal$.next(state)),
finalize(() => internal$.complete()),
map(state => ({ ref: el, ...state }))
)
}

View File

@@ -30,6 +30,7 @@ import {
import {
bufferCount,
filter,
finalize,
map,
observeOn,
switchMap,
@@ -152,7 +153,8 @@ export function mountSearchResult(
/* Create and return component */
return result$
.pipe(
tap(internal$),
tap(state => internal$.next(state)),
finalize(() => internal$.complete()),
map(state => ({ ref: el, ...state }))
)
}

View File

@@ -25,7 +25,11 @@ import {
Subject,
fromEvent
} from "rxjs"
import { map, tap } from "rxjs/operators"
import {
finalize,
map,
tap
} from "rxjs/operators"
import { getLocation } from "~/browser"
@@ -112,7 +116,8 @@ export function mountSearchShare(
/* Create and return component */
return watchSearchShare(el, options)
.pipe(
tap(internal$),
tap(state => internal$.next(state)),
finalize(() => internal$.complete()),
map(state => ({ ref: el, ...state }))
)
}

View File

@@ -30,6 +30,7 @@ import {
combineLatestWith,
distinctUntilChanged,
filter,
finalize,
map,
observeOn,
tap
@@ -144,7 +145,8 @@ export function mountSearchSuggest(
/* Create and return component */
return result$
.pipe(
tap(internal$),
tap(state => internal$.next(state)),
finalize(() => internal$.complete()),
map(() => ({ ref: el }))
)
}

View File

@@ -28,6 +28,7 @@ import {
} from "rxjs"
import {
distinctUntilChanged,
finalize,
map,
observeOn,
tap,
@@ -157,7 +158,8 @@ export function mountSidebar(
/* Create and return component */
return watchSidebar(el, options)
.pipe(
tap(internal$),
tap(state => internal$.next(state)),
finalize(() => internal$.complete()),
map(state => ({ ref: el, ...state }))
)
}

View File

@@ -24,6 +24,7 @@ import { NEVER, Observable, Subject, defer, of } from "rxjs"
import {
catchError,
filter,
finalize,
map,
shareReplay,
tap
@@ -117,7 +118,8 @@ export function mountSource(
/* Create and return component */
return watchSource(el)
.pipe(
tap(internal$),
tap(state => internal$.next(state)),
finalize(() => internal$.complete()),
map(state => ({ ref: el, ...state }))
)
}

View File

@@ -23,6 +23,7 @@
import { Observable, Subject, animationFrameScheduler } from "rxjs"
import {
distinctUntilKeyChanged,
finalize,
map,
observeOn,
switchMap,
@@ -135,7 +136,8 @@ export function mountTabs(
/* Create and return component */
return watchTabs(el, options)
.pipe(
tap(internal$),
tap(state => internal$.next(state)),
finalize(() => internal$.complete()),
map(state => ({ ref: el, ...state }))
)
}

View File

@@ -30,6 +30,7 @@ import {
bufferCount,
distinctUntilChanged,
distinctUntilKeyChanged,
finalize,
map,
observeOn,
scan,
@@ -267,7 +268,8 @@ export function mountTableOfContents(
const anchors = getElements<HTMLAnchorElement>("[href^=\\#]", el)
return watchTableOfContents(anchors, options)
.pipe(
tap(internal$),
tap(state => internal$.next(state)),
finalize(() => internal$.complete()),
map(state => ({ ref: el, ...state }))
)
}

View File

@@ -30,6 +30,7 @@ import {
bufferCount,
distinctUntilChanged,
distinctUntilKeyChanged,
finalize,
map,
observeOn,
tap,
@@ -170,7 +171,8 @@ export function mountBackToTop(
/* Create and return component */
return watchBackToTop(el, { viewport$, header$, main$ })
.pipe(
tap(internal$),
tap(state => internal$.next(state)),
finalize(() => internal$.complete()),
map(state => ({ ref: el, ...state }))
)
}