Skip to content

Commit 765ba1e

Browse files
BenjaminPabstthePunderWoman
authored andcommitted
fix(core): check ngDevMode for undefined (angular#60565)
This adds a check to "toSignal" whether ngDevMode is not undefined as this can happen for some MFE applications. PR Close angular#60565
1 parent e6d2afb commit 765ba1e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/rxjs-interop/src/to_signal.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ export function toSignal<T, U = undefined>(
122122
source: Observable<T> | Subscribable<T>,
123123
options?: ToSignalOptions<T | U> & {initialValue?: U},
124124
): Signal<T | U> {
125-
ngDevMode &&
125+
typeof ngDevMode !== 'undefined' &&
126+
ngDevMode &&
126127
assertNotInReactiveContext(
127128
toSignal,
128129
'Invoking `toSignal` causes new subscriptions every time. ' +

0 commit comments

Comments
 (0)