mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(core): check ngDevMode for undefined (#60565)
This adds a check to "toSignal" whether ngDevMode is not undefined as this can happen for some MFE applications. PR Close #60565
This commit is contained in:
committed by
Jessica Janiuk
parent
ca5aa4d55b
commit
64da69f7b6
@@ -134,7 +134,8 @@ export function toSignal<T, U = undefined>(
|
||||
source: Observable<T> | Subscribable<T>,
|
||||
options?: ToSignalOptions<T | U> & {initialValue?: U},
|
||||
): Signal<T | U> {
|
||||
ngDevMode &&
|
||||
typeof ngDevMode !== 'undefined' &&
|
||||
ngDevMode &&
|
||||
assertNotInReactiveContext(
|
||||
toSignal,
|
||||
'Invoking `toSignal` causes new subscriptions every time. ' +
|
||||
|
||||
Reference in New Issue
Block a user