@angular/core 20.0.0-next.3 → 20.0.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.d-mxcXqDpA.d.ts +297 -0
- package/discovery.d-CyYpOJ7j.d.ts +7393 -0
- package/event_dispatcher.d-PWnbqZDx.d.ts +346 -0
- package/fesm2022/attribute-B17mgaqe.mjs +24 -0
- package/fesm2022/attribute-B17mgaqe.mjs.map +1 -0
- package/fesm2022/core.mjs +579 -36730
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/debug_node-xKpCIZm-.mjs +32070 -0
- package/fesm2022/debug_node-xKpCIZm-.mjs.map +1 -0
- package/fesm2022/primitives/di.mjs +2 -2
- package/fesm2022/primitives/di.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +2 -16
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +5 -609
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/resource-BPpYEDic.mjs +621 -0
- package/fesm2022/resource-BPpYEDic.mjs.map +1 -0
- package/fesm2022/root_effect_scheduler-D0_b1cf_.mjs +3816 -0
- package/fesm2022/root_effect_scheduler-D0_b1cf_.mjs.map +1 -0
- package/fesm2022/rxjs-interop.mjs +91 -7
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/signal-DhRAAi7R.mjs +522 -0
- package/fesm2022/signal-DhRAAi7R.mjs.map +1 -0
- package/fesm2022/testing.mjs +105 -103
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/untracked-DaaW3JJm.mjs +117 -0
- package/fesm2022/untracked-DaaW3JJm.mjs.map +1 -0
- package/fesm2022/weak_ref-DrMdAIDh.mjs +1 -1
- package/graph.d-StYigYp1.d.ts +195 -0
- package/index.d.ts +2616 -10854
- package/ng_i18n_closure_mode.d-DLxSUiDr.d.ts +832 -0
- package/package.json +3 -3
- package/primitives/di/index.d.ts +3 -2
- package/primitives/event-dispatch/index.d.ts +5 -340
- package/primitives/signals/index.d.ts +7 -209
- package/rxjs-interop/index.d.ts +16 -4
- package/schematics/bundles/{apply_import_manager-BXQEjo09.js → apply_import_manager-C-ysxahq.js} +3 -3
- package/schematics/bundles/{compiler_host-Bk3repE2.js → change_tracker-0Ktek5Xl.js} +3 -121
- package/schematics/bundles/checker-DqUKCGda.js +17702 -0
- package/schematics/bundles/cleanup-unused-imports.js +6 -5
- package/schematics/bundles/{checker-BHb19MHt.js → compiler-CuoiHqkc.js} +578 -18086
- package/schematics/bundles/compiler_host-CAfDJO3W.js +129 -0
- package/schematics/bundles/control-flow-migration.js +59 -50
- package/schematics/bundles/document-core.js +96 -0
- package/schematics/bundles/imports-CIX-JgAN.js +1 -1
- package/schematics/bundles/{index-BL9kAIe5.js → index-CwFQSYXZ.js} +30 -29
- package/schematics/bundles/{index-I8VbxQcO.js → index-WFXCe5Q0.js} +527 -524
- package/schematics/bundles/inject-flags.js +6 -5
- package/schematics/bundles/inject-migration.js +29 -10
- package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
- package/schematics/bundles/{migrate_ts_type_references-KlOTWeDl.js → migrate_ts_type_references-BNuHufqZ.js} +6 -5
- package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
- package/schematics/bundles/nodes-B16H9JUd.js +1 -1
- package/schematics/bundles/output-migration.js +15 -10
- package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
- package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
- package/schematics/bundles/route-lazy-loading.js +7 -5
- package/schematics/bundles/{run_in_devkit-C0JPtK2u.js → run_in_devkit-CmHxABFr.js} +4 -3
- package/schematics/bundles/self-closing-tags-migration.js +10 -9
- package/schematics/bundles/signal-input-migration.js +8 -7
- package/schematics/bundles/signal-queries-migration.js +27 -14
- package/schematics/bundles/signals.js +8 -7
- package/schematics/bundles/standalone-migration.js +11 -9
- package/schematics/bundles/symbol-VPWguRxr.js +1 -1
- package/schematics/bundles/test-bed-get.js +5 -4
- package/schematics/collection.json +0 -6
- package/schematics/migrations.json +11 -0
- package/signal.d-BeaTIeOE.d.ts +31 -0
- package/testing/index.d.ts +13 -9
- package/weak_ref.d-ttyj86RV.d.ts +1 -1
- package/navigation_types.d-u4EOrrdZ.d.ts +0 -121
- package/schematics/ng-generate/control-flow-migration/schema.json +0 -20
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.0-next.
|
|
2
|
+
* @license Angular v20.0.0-next.5
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { assertInInjectionContext, inject, DestroyRef, ɵRuntimeError as _RuntimeError, ɵgetOutputDestroyRef as _getOutputDestroyRef, Injector, effect, untracked, assertNotInReactiveContext, signal, computed, PendingTasks, resource } from '@angular/core';
|
|
8
7
|
import { Observable, ReplaySubject } from 'rxjs';
|
|
9
8
|
import { takeUntil } from 'rxjs/operators';
|
|
9
|
+
import { a as assertInInjectionContext, i as inject, D as DestroyRef, R as RuntimeError, I as Injector, b as assertNotInReactiveContext, s as signal, P as PendingTasks } from './root_effect_scheduler-D0_b1cf_.mjs';
|
|
10
|
+
import { g as getOutputDestroyRef, e as effect, u as untracked, c as computed, r as resource } from './resource-BPpYEDic.mjs';
|
|
11
|
+
import { S as SIGNAL } from './signal-DhRAAi7R.mjs';
|
|
12
|
+
import './primitives/di.mjs';
|
|
13
|
+
import '@angular/core/primitives/di';
|
|
14
|
+
import '@angular/core/primitives/signals';
|
|
15
|
+
import './untracked-DaaW3JJm.mjs';
|
|
10
16
|
|
|
11
17
|
/**
|
|
12
18
|
* Operator which completes the Observable when the calling context (component, directive, service,
|
|
@@ -50,7 +56,7 @@ class OutputFromObservableRef {
|
|
|
50
56
|
}
|
|
51
57
|
subscribe(callbackFn) {
|
|
52
58
|
if (this.destroyed) {
|
|
53
|
-
throw new
|
|
59
|
+
throw new RuntimeError(953 /* ɵRuntimeErrorCode.OUTPUT_REF_DESTROYED */, ngDevMode &&
|
|
54
60
|
'Unexpected subscription to destroyed `OutputRef`. ' +
|
|
55
61
|
'The owning directive/component is destroyed.');
|
|
56
62
|
}
|
|
@@ -101,7 +107,7 @@ function outputFromObservable(observable, opts) {
|
|
|
101
107
|
* @publicApi
|
|
102
108
|
*/
|
|
103
109
|
function outputToObservable(ref) {
|
|
104
|
-
const destroyRef =
|
|
110
|
+
const destroyRef = getOutputDestroyRef(ref);
|
|
105
111
|
return new Observable((observer) => {
|
|
106
112
|
// Complete the observable upon directive/component destroy.
|
|
107
113
|
// Note: May be `undefined` if an `EventEmitter` is declared outside
|
|
@@ -122,6 +128,9 @@ function outputToObservable(ref) {
|
|
|
122
128
|
* @developerPreview
|
|
123
129
|
*/
|
|
124
130
|
function toObservable(source, options) {
|
|
131
|
+
if (options?.forceSyncFirstEmit === true) {
|
|
132
|
+
return toObservableNext(source, options);
|
|
133
|
+
}
|
|
125
134
|
!options?.injector && assertInInjectionContext(toObservable);
|
|
126
135
|
const injector = options?.injector ?? inject(Injector);
|
|
127
136
|
const subject = new ReplaySubject(1);
|
|
@@ -142,6 +151,80 @@ function toObservable(source, options) {
|
|
|
142
151
|
});
|
|
143
152
|
return subject.asObservable();
|
|
144
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* New version of `toObservable` with always-synchronous first emit.
|
|
156
|
+
*
|
|
157
|
+
* This will eventually replace the other implementation.
|
|
158
|
+
*/
|
|
159
|
+
function toObservableNext(source, options) {
|
|
160
|
+
!options?.injector && assertInInjectionContext(toObservable);
|
|
161
|
+
const injector = options?.injector ?? inject(Injector);
|
|
162
|
+
return new Observable((subscriber) => {
|
|
163
|
+
let firstVersion = -1;
|
|
164
|
+
let firstValue;
|
|
165
|
+
try {
|
|
166
|
+
firstValue = untracked(source);
|
|
167
|
+
}
|
|
168
|
+
catch (err) {
|
|
169
|
+
// A failure on the first read just errors the observable without
|
|
170
|
+
// creating an effect.
|
|
171
|
+
subscriber.error(err);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
// We cache the `version` of the first value. This lets us avoid emitting
|
|
175
|
+
// this value a second time during the `effect`.
|
|
176
|
+
firstVersion = signalVersion(source);
|
|
177
|
+
// Emit the first value synchronously on subscription.
|
|
178
|
+
subscriber.next(firstValue);
|
|
179
|
+
// Create an effect that will watch the signal for future changes.
|
|
180
|
+
let firstEmit = true;
|
|
181
|
+
const ref = effect(() => {
|
|
182
|
+
let value;
|
|
183
|
+
try {
|
|
184
|
+
// Read the value (& track it).
|
|
185
|
+
value = source();
|
|
186
|
+
}
|
|
187
|
+
catch (err) {
|
|
188
|
+
// Errors cause the Observable stream to terminate.
|
|
189
|
+
untracked(() => subscriber.error(err));
|
|
190
|
+
cleanup(false);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
// Skip the emit of the value if it hasn't changed since the
|
|
194
|
+
// synchronous emit.
|
|
195
|
+
if (firstEmit) {
|
|
196
|
+
firstEmit = false;
|
|
197
|
+
if (signalVersion(source) === firstVersion) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
untracked(() => subscriber.next(value));
|
|
202
|
+
}, { injector, manualCleanup: true });
|
|
203
|
+
const cleanup = (fromInjector) => {
|
|
204
|
+
ref.destroy();
|
|
205
|
+
if (fromInjector) {
|
|
206
|
+
// If we're cleaning up because the injector is destroyed, then our
|
|
207
|
+
// subscription is still active and we need to complete it.
|
|
208
|
+
subscriber.complete();
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
// Otherwise, remove the cleanup function. This both prevents the
|
|
212
|
+
// complete() event from being produced and allows memory to be
|
|
213
|
+
// reclaimed.
|
|
214
|
+
removeInjectorCleanupFn();
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
const removeInjectorCleanupFn = injector.get(DestroyRef).onDestroy(() => {
|
|
218
|
+
// Cleaning up from the `DestroyRef` means the stream is still active, so
|
|
219
|
+
// we should emit completion.
|
|
220
|
+
cleanup(true);
|
|
221
|
+
});
|
|
222
|
+
return () => cleanup(false);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
function signalVersion(source) {
|
|
226
|
+
return source[SIGNAL].version;
|
|
227
|
+
}
|
|
145
228
|
|
|
146
229
|
/**
|
|
147
230
|
* Get the current value of an `Observable` as a reactive `Signal`.
|
|
@@ -166,7 +249,8 @@ function toObservable(source, options) {
|
|
|
166
249
|
* context is needed in this configuration as well.
|
|
167
250
|
*/
|
|
168
251
|
function toSignal(source, options) {
|
|
169
|
-
ngDevMode &&
|
|
252
|
+
typeof ngDevMode !== 'undefined' &&
|
|
253
|
+
ngDevMode &&
|
|
170
254
|
assertNotInReactiveContext(toSignal, 'Invoking `toSignal` causes new subscriptions every time. ' +
|
|
171
255
|
'Consider moving `toSignal` outside of the reactive context and read the signal value where needed.');
|
|
172
256
|
const requiresCleanup = !options?.manualCleanup;
|
|
@@ -201,7 +285,7 @@ function toSignal(source, options) {
|
|
|
201
285
|
// "complete".
|
|
202
286
|
});
|
|
203
287
|
if (options?.requireSync && state().kind === 0 /* StateKind.NoValue */) {
|
|
204
|
-
throw new
|
|
288
|
+
throw new RuntimeError(601 /* ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
205
289
|
'`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.');
|
|
206
290
|
}
|
|
207
291
|
// Unsubscribe when the current context is destroyed, if requested.
|
|
@@ -217,7 +301,7 @@ function toSignal(source, options) {
|
|
|
217
301
|
throw current.error;
|
|
218
302
|
case 0 /* StateKind.NoValue */:
|
|
219
303
|
// This shouldn't really happen because the error is thrown on creation.
|
|
220
|
-
throw new
|
|
304
|
+
throw new RuntimeError(601 /* ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
221
305
|
'`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.');
|
|
222
306
|
}
|
|
223
307
|
}, { equal: options?.equal });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxjs-interop.mjs","sources":["../../../../../../packages/core/rxjs-interop/src/take_until_destroyed.ts","../../../../../../packages/core/rxjs-interop/src/output_from_observable.ts","../../../../../../packages/core/rxjs-interop/src/output_to_observable.ts","../../../../../../packages/core/rxjs-interop/src/to_observable.ts","../../../../../../packages/core/rxjs-interop/src/to_signal.ts","../../../../../../packages/core/rxjs-interop/src/pending_until_event.ts","../../../../../../packages/core/rxjs-interop/src/rx_resource.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertInInjectionContext, DestroyRef, inject} from '@angular/core';\nimport {MonoTypeOperatorFunction, Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n/**\n * Operator which completes the Observable when the calling context (component, directive, service,\n * etc) is destroyed.\n *\n * @param destroyRef optionally, the `DestroyRef` representing the current context. This can be\n * passed explicitly to use `takeUntilDestroyed` outside of an [injection\n * context](guide/di/dependency-injection-context). Otherwise, the current `DestroyRef` is injected.\n *\n * @publicApi\n */\nexport function takeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T> {\n if (!destroyRef) {\n assertInInjectionContext(takeUntilDestroyed);\n destroyRef = inject(DestroyRef);\n }\n\n const destroyed$ = new Observable<void>((observer) => {\n const unregisterFn = destroyRef!.onDestroy(observer.next.bind(observer));\n return unregisterFn;\n });\n\n return <T>(source: Observable<T>) => {\n return source.pipe(takeUntil(destroyed$));\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n inject,\n OutputOptions,\n OutputRef,\n OutputRefSubscription,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '@angular/core';\nimport {Observable} from 'rxjs';\n\nimport {takeUntilDestroyed} from './take_until_destroyed';\n\n/**\n * Implementation of `OutputRef` that emits values from\n * an RxJS observable source.\n *\n * @internal\n */\nclass OutputFromObservableRef<T> implements OutputRef<T> {\n private destroyed = false;\n\n destroyRef = inject(DestroyRef);\n\n constructor(private source: Observable<T>) {\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n });\n }\n\n subscribe(callbackFn: (value: T) => void): OutputRefSubscription {\n if (this.destroyed) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.OUTPUT_REF_DESTROYED,\n ngDevMode &&\n 'Unexpected subscription to destroyed `OutputRef`. ' +\n 'The owning directive/component is destroyed.',\n );\n }\n\n // Stop yielding more values when the directive/component is already destroyed.\n const subscription = this.source.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (value) => callbackFn(value),\n });\n\n return {\n unsubscribe: () => subscription.unsubscribe(),\n };\n }\n}\n\n/**\n * Declares an Angular output that is using an RxJS observable as a source\n * for events dispatched to parent subscribers.\n *\n * The behavior for an observable as source is defined as followed:\n * 1. New values are forwarded to the Angular output (next notifications).\n * 2. Errors notifications are not handled by Angular. You need to handle these manually.\n * For example by using `catchError`.\n * 3. Completion notifications stop the output from emitting new values.\n *\n * @usageNotes\n * Initialize an output in your directive by declaring a\n * class field and initializing it with the `outputFromObservable()` function.\n *\n * ```ts\n * @Directive({..})\n * export class MyDir {\n * nameChange$ = <some-observable>;\n * nameChange = outputFromObservable(this.nameChange$);\n * }\n * ```\n *\n * @publicApi\n */\nexport function outputFromObservable<T>(\n observable: Observable<T>,\n opts?: OutputOptions,\n): OutputRef<T> {\n ngDevMode && assertInInjectionContext(outputFromObservable);\n return new OutputFromObservableRef<T>(observable);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {OutputRef, ɵgetOutputDestroyRef} from '@angular/core';\nimport {Observable} from 'rxjs';\n\n/**\n * Converts an Angular output declared via `output()` or `outputFromObservable()`\n * to an observable.\n *\n * You can subscribe to the output via `Observable.subscribe` then.\n *\n * @publicApi\n */\nexport function outputToObservable<T>(ref: OutputRef<T>): Observable<T> {\n const destroyRef = ɵgetOutputDestroyRef(ref);\n\n return new Observable<T>((observer) => {\n // Complete the observable upon directive/component destroy.\n // Note: May be `undefined` if an `EventEmitter` is declared outside\n // of an injection context.\n destroyRef?.onDestroy(() => observer.complete());\n\n const subscription = ref.subscribe((v) => observer.next(v));\n return () => subscription.unsubscribe();\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n effect,\n inject,\n Injector,\n Signal,\n untracked,\n} from '@angular/core';\nimport {Observable, ReplaySubject} from 'rxjs';\n\n/**\n * Options for `toObservable`.\n *\n * @developerPreview\n */\nexport interface ToObservableOptions {\n /**\n * The `Injector` to use when creating the underlying `effect` which watches the signal.\n *\n * If this isn't specified, the current [injection context](guide/di/dependency-injection-context)\n * will be used.\n */\n injector?: Injector;\n}\n\n/**\n * Exposes the value of an Angular `Signal` as an RxJS `Observable`.\n *\n * The signal's value will be propagated into the `Observable`'s subscribers using an `effect`.\n *\n * `toObservable` must be called in an injection context unless an injector is provided via options.\n *\n * @developerPreview\n */\nexport function toObservable<T>(source: Signal<T>, options?: ToObservableOptions): Observable<T> {\n !options?.injector && assertInInjectionContext(toObservable);\n const injector = options?.injector ?? inject(Injector);\n const subject = new ReplaySubject<T>(1);\n\n const watcher = effect(\n () => {\n let value: T;\n try {\n value = source();\n } catch (err) {\n untracked(() => subject.error(err));\n return;\n }\n untracked(() => subject.next(value));\n },\n {injector, manualCleanup: true},\n );\n\n injector.get(DestroyRef).onDestroy(() => {\n watcher.destroy();\n subject.complete();\n });\n\n return subject.asObservable();\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n assertNotInReactiveContext,\n computed,\n DestroyRef,\n inject,\n Injector,\n signal,\n Signal,\n WritableSignal,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '@angular/core';\nimport {ValueEqualityFn} from '@angular/core/primitives/signals';\nimport {Observable, Subscribable} from 'rxjs';\n\n/**\n * Options for `toSignal`.\n *\n * @publicApi\n */\nexport interface ToSignalOptions<T> {\n /**\n * Initial value for the signal produced by `toSignal`.\n *\n * This will be the value of the signal until the observable emits its first value.\n */\n initialValue?: unknown;\n\n /**\n * Whether to require that the observable emits synchronously when `toSignal` subscribes.\n *\n * If this is `true`, `toSignal` will assert that the observable produces a value immediately upon\n * subscription. Setting this option removes the need to either deal with `undefined` in the\n * signal type or provide an `initialValue`, at the cost of a runtime error if this requirement is\n * not met.\n */\n requireSync?: boolean;\n\n /**\n * `Injector` which will provide the `DestroyRef` used to clean up the Observable subscription.\n *\n * If this is not provided, a `DestroyRef` will be retrieved from the current [injection\n * context](guide/di/dependency-injection-context), unless manual cleanup is requested.\n */\n injector?: Injector;\n\n /**\n * Whether the subscription should be automatically cleaned up (via `DestroyRef`) when\n * `toSignal`'s creation context is destroyed.\n *\n * If manual cleanup is enabled, then `DestroyRef` is not used, and the subscription will persist\n * until the `Observable` itself completes.\n */\n manualCleanup?: boolean;\n\n /**\n * A comparison function which defines equality for values emitted by the observable.\n *\n * Equality comparisons are executed against the initial value if one is provided.\n */\n equal?: ValueEqualityFn<T>;\n}\n\n// Base case: no options -> `undefined` in the result type.\nexport function toSignal<T>(source: Observable<T> | Subscribable<T>): Signal<T | undefined>;\n// Options with `undefined` initial value and no `requiredSync` -> `undefined`.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | undefined>> & {\n initialValue?: undefined;\n requireSync?: false;\n },\n): Signal<T | undefined>;\n// Options with `null` initial value -> `null`.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | null>> & {initialValue?: null; requireSync?: false},\n): Signal<T | null>;\n// Options with `undefined` initial value and `requiredSync` -> strict result type.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T>> & {initialValue?: undefined; requireSync: true},\n): Signal<T>;\n// Options with a more specific initial value type.\nexport function toSignal<T, const U extends T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | U>> & {initialValue: U; requireSync?: false},\n): Signal<T | U>;\n\n/**\n * Get the current value of an `Observable` as a reactive `Signal`.\n *\n * `toSignal` returns a `Signal` which provides synchronous reactive access to values produced\n * by the given `Observable`, by subscribing to that `Observable`. The returned `Signal` will always\n * have the most recent value emitted by the subscription, and will throw an error if the\n * `Observable` errors.\n *\n * With `requireSync` set to `true`, `toSignal` will assert that the `Observable` produces a value\n * immediately upon subscription. No `initialValue` is needed in this case, and the returned signal\n * does not include an `undefined` type.\n *\n * By default, the subscription will be automatically cleaned up when the current [injection\n * context](guide/di/dependency-injection-context) is destroyed. For example, when `toSignal` is\n * called during the construction of a component, the subscription will be cleaned up when the\n * component is destroyed. If an injection context is not available, an explicit `Injector` can be\n * passed instead.\n *\n * If the subscription should persist until the `Observable` itself completes, the `manualCleanup`\n * option can be specified instead, which disables the automatic subscription teardown. No injection\n * context is needed in this configuration as well.\n */\nexport function toSignal<T, U = undefined>(\n source: Observable<T> | Subscribable<T>,\n options?: ToSignalOptions<T | U> & {initialValue?: U},\n): Signal<T | U> {\n ngDevMode &&\n assertNotInReactiveContext(\n toSignal,\n 'Invoking `toSignal` causes new subscriptions every time. ' +\n 'Consider moving `toSignal` outside of the reactive context and read the signal value where needed.',\n );\n\n const requiresCleanup = !options?.manualCleanup;\n requiresCleanup && !options?.injector && assertInInjectionContext(toSignal);\n const cleanupRef = requiresCleanup\n ? (options?.injector?.get(DestroyRef) ?? inject(DestroyRef))\n : null;\n\n const equal = makeToSignalEqual(options?.equal);\n\n // Note: T is the Observable value type, and U is the initial value type. They don't have to be\n // the same - the returned signal gives values of type `T`.\n let state: WritableSignal<State<T | U>>;\n if (options?.requireSync) {\n // Initially the signal is in a `NoValue` state.\n state = signal({kind: StateKind.NoValue}, {equal});\n } else {\n // If an initial value was passed, use it. Otherwise, use `undefined` as the initial value.\n state = signal<State<T | U>>(\n {kind: StateKind.Value, value: options?.initialValue as U},\n {equal},\n );\n }\n\n // Note: This code cannot run inside a reactive context (see assertion above). If we'd support\n // this, we would subscribe to the observable outside of the current reactive context, avoiding\n // that side-effect signal reads/writes are attribute to the current consumer. The current\n // consumer only needs to be notified when the `state` signal changes through the observable\n // subscription. Additional context (related to async pipe):\n // https://github.com/angular/angular/pull/50522.\n const sub = source.subscribe({\n next: (value) => state.set({kind: StateKind.Value, value}),\n error: (error) => {\n state.set({kind: StateKind.Error, error});\n },\n // Completion of the Observable is meaningless to the signal. Signals don't have a concept of\n // \"complete\".\n });\n\n if (options?.requireSync && state().kind === StateKind.NoValue) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',\n );\n }\n\n // Unsubscribe when the current context is destroyed, if requested.\n cleanupRef?.onDestroy(sub.unsubscribe.bind(sub));\n\n // The actual returned signal is a `computed` of the `State` signal, which maps the various states\n // to either values or errors.\n return computed(\n () => {\n const current = state();\n switch (current.kind) {\n case StateKind.Value:\n return current.value;\n case StateKind.Error:\n throw current.error;\n case StateKind.NoValue:\n // This shouldn't really happen because the error is thrown on creation.\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',\n );\n }\n },\n {equal: options?.equal},\n );\n}\n\nfunction makeToSignalEqual<T>(\n userEquality: ValueEqualityFn<T> = Object.is,\n): ValueEqualityFn<State<T>> {\n return (a, b) =>\n a.kind === StateKind.Value && b.kind === StateKind.Value && userEquality(a.value, b.value);\n}\n\nconst enum StateKind {\n NoValue,\n Value,\n Error,\n}\n\ninterface NoValueState {\n kind: StateKind.NoValue;\n}\n\ninterface ValueState<T> {\n kind: StateKind.Value;\n value: T;\n}\n\ninterface ErrorState {\n kind: StateKind.Error;\n error: unknown;\n}\n\ntype State<T> = NoValueState | ValueState<T> | ErrorState;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertInInjectionContext, PendingTasks, inject, Injector} from '@angular/core';\nimport {MonoTypeOperatorFunction, Observable} from 'rxjs';\n\n/**\n * Operator which makes the application unstable until the observable emits, complets, errors, or is unsubscribed.\n *\n * Use this operator in observables whose subscriptions are important for rendering and should be included in SSR serialization.\n *\n * @param injector The `Injector` to use during creation. If this is not provided, the current injection context will be used instead (via `inject`).\n *\n * @experimental\n */\nexport function pendingUntilEvent<T>(injector?: Injector): MonoTypeOperatorFunction<T> {\n if (injector === undefined) {\n assertInInjectionContext(pendingUntilEvent);\n injector = inject(Injector);\n }\n const taskService = injector.get(PendingTasks);\n\n return (sourceObservable) => {\n return new Observable<T>((originalSubscriber) => {\n // create a new task on subscription\n const removeTask = taskService.add();\n\n let cleanedUp = false;\n function cleanupTask() {\n if (cleanedUp) {\n return;\n }\n\n removeTask();\n cleanedUp = true;\n }\n\n const innerSubscription = sourceObservable.subscribe({\n next: (v) => {\n originalSubscriber.next(v);\n cleanupTask();\n },\n complete: () => {\n originalSubscriber.complete();\n cleanupTask();\n },\n error: (e) => {\n originalSubscriber.error(e);\n cleanupTask();\n },\n });\n innerSubscription.add(() => {\n originalSubscriber.unsubscribe();\n cleanupTask();\n });\n return innerSubscription;\n });\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n resource,\n ResourceLoaderParams,\n ResourceRef,\n Signal,\n signal,\n BaseResourceOptions,\n} from '@angular/core';\nimport {Observable, Subscription} from 'rxjs';\n\n/**\n * Like `ResourceOptions` but uses an RxJS-based `loader`.\n *\n * @experimental\n */\nexport interface RxResourceOptions<T, R> extends BaseResourceOptions<T, R> {\n loader: (params: ResourceLoaderParams<R>) => Observable<T>;\n}\n\n/**\n * Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the\n * resource's value.\n *\n * @experimental\n */\nexport function rxResource<T, R>(\n opts: RxResourceOptions<T, R> & {defaultValue: NoInfer<T>},\n): ResourceRef<T>;\n\n/**\n * Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the\n * resource's value.\n *\n * @experimental\n */\nexport function rxResource<T, R>(opts: RxResourceOptions<T, R>): ResourceRef<T | undefined>;\nexport function rxResource<T, R>(opts: RxResourceOptions<T, R>): ResourceRef<T | undefined> {\n opts?.injector || assertInInjectionContext(rxResource);\n return resource<T, R>({\n ...opts,\n loader: undefined,\n stream: (params) => {\n let sub: Subscription;\n\n // Track the abort listener so it can be removed if the Observable completes (as a memory\n // optimization).\n const onAbort = () => sub.unsubscribe();\n params.abortSignal.addEventListener('abort', onAbort);\n\n // Start off stream as undefined.\n const stream = signal<{value: T} | {error: unknown}>({value: undefined as T});\n let resolve: ((value: Signal<{value: T} | {error: unknown}>) => void) | undefined;\n const promise = new Promise<Signal<{value: T} | {error: unknown}>>((r) => (resolve = r));\n\n function send(value: {value: T} | {error: unknown}): void {\n stream.set(value);\n resolve?.(stream);\n resolve = undefined;\n }\n\n sub = opts.loader(params).subscribe({\n next: (value) => send({value}),\n error: (error) => send({error}),\n complete: () => {\n if (resolve) {\n send({error: new Error('Resource completed before producing a value')});\n }\n params.abortSignal.removeEventListener('abort', onAbort);\n },\n });\n\n return promise;\n },\n });\n}\n"],"names":["ɵRuntimeError","ɵgetOutputDestroyRef"],"mappings":";;;;;;;;;;AAYA;;;;;;;;;AASG;AACG,SAAU,kBAAkB,CAAI,UAAuB,EAAA;IAC3D,IAAI,CAAC,UAAU,EAAE;QACf,wBAAwB,CAAC,kBAAkB,CAAC;AAC5C,QAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;IAGjC,MAAM,UAAU,GAAG,IAAI,UAAU,CAAO,CAAC,QAAQ,KAAI;AACnD,QAAA,MAAM,YAAY,GAAG,UAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACxE,QAAA,OAAO,YAAY;AACrB,KAAC,CAAC;IAEF,OAAO,CAAI,MAAqB,KAAI;QAClC,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAC3C,KAAC;AACH;;ACdA;;;;;AAKG;AACH,MAAM,uBAAuB,CAAA;AAKP,IAAA,MAAA;IAJZ,SAAS,GAAG,KAAK;AAEzB,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAE/B,IAAA,WAAA,CAAoB,MAAqB,EAAA;QAArB,IAAM,CAAA,MAAA,GAAN,MAAM;AACxB,QAAA,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,MAAK;AAC7B,YAAA,IAAI,CAAC,SAAS,GAAG,IAAI;AACvB,SAAC,CAAC;;AAGJ,IAAA,SAAS,CAAC,UAA8B,EAAA;AACtC,QAAA,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,MAAM,IAAIA,aAAa,CAAA,GAAA,+CAErB,SAAS;gBACP,oDAAoD;AAClD,oBAAA,8CAA8C,CACnD;;;AAIH,QAAA,MAAM,YAA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AAO;SACf;AACF,KAAA,CAAC;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"rxjs-interop.mjs","sources":["../../../../../../packages/core/rxjs-interop/src/take_until_destroyed.ts","../../../../../../packages/core/rxjs-interop/src/output_from_observable.ts","../../../../../../packages/core/rxjs-interop/src/output_to_observable.ts","../../../../../../packages/core/rxjs-interop/src/to_observable.ts","../../../../../../packages/core/rxjs-interop/src/to_signal.ts","../../../../../../packages/core/rxjs-interop/src/pending_until_event.ts","../../../../../../packages/core/rxjs-interop/src/rx_resource.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertInInjectionContext, DestroyRef, inject} from '../../src/core';\nimport {MonoTypeOperatorFunction, Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n/**\n * Operator which completes the Observable when the calling context (component, directive, service,\n * etc) is destroyed.\n *\n * @param destroyRef optionally, the `DestroyRef` representing the current context. This can be\n * passed explicitly to use `takeUntilDestroyed` outside of an [injection\n * context](guide/di/dependency-injection-context). Otherwise, the current `DestroyRef` is injected.\n *\n * @publicApi\n */\nexport function takeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T> {\n if (!destroyRef) {\n assertInInjectionContext(takeUntilDestroyed);\n destroyRef = inject(DestroyRef);\n }\n\n const destroyed$ = new Observable<void>((observer) => {\n const unregisterFn = destroyRef!.onDestroy(observer.next.bind(observer));\n return unregisterFn;\n });\n\n return <T>(source: Observable<T>) => {\n return source.pipe(takeUntil(destroyed$));\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n inject,\n OutputOptions,\n OutputRef,\n OutputRefSubscription,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '../../src/core';\nimport {Observable} from 'rxjs';\n\nimport {takeUntilDestroyed} from './take_until_destroyed';\n\n/**\n * Implementation of `OutputRef` that emits values from\n * an RxJS observable source.\n *\n * @internal\n */\nclass OutputFromObservableRef<T> implements OutputRef<T> {\n private destroyed = false;\n\n destroyRef = inject(DestroyRef);\n\n constructor(private source: Observable<T>) {\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n });\n }\n\n subscribe(callbackFn: (value: T) => void): OutputRefSubscription {\n if (this.destroyed) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.OUTPUT_REF_DESTROYED,\n ngDevMode &&\n 'Unexpected subscription to destroyed `OutputRef`. ' +\n 'The owning directive/component is destroyed.',\n );\n }\n\n // Stop yielding more values when the directive/component is already destroyed.\n const subscription = this.source.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (value) => callbackFn(value),\n });\n\n return {\n unsubscribe: () => subscription.unsubscribe(),\n };\n }\n}\n\n/**\n * Declares an Angular output that is using an RxJS observable as a source\n * for events dispatched to parent subscribers.\n *\n * The behavior for an observable as source is defined as followed:\n * 1. New values are forwarded to the Angular output (next notifications).\n * 2. Errors notifications are not handled by Angular. You need to handle these manually.\n * For example by using `catchError`.\n * 3. Completion notifications stop the output from emitting new values.\n *\n * @usageNotes\n * Initialize an output in your directive by declaring a\n * class field and initializing it with the `outputFromObservable()` function.\n *\n * ```ts\n * @Directive({..})\n * export class MyDir {\n * nameChange$ = <some-observable>;\n * nameChange = outputFromObservable(this.nameChange$);\n * }\n * ```\n *\n * @publicApi\n */\nexport function outputFromObservable<T>(\n observable: Observable<T>,\n opts?: OutputOptions,\n): OutputRef<T> {\n ngDevMode && assertInInjectionContext(outputFromObservable);\n return new OutputFromObservableRef<T>(observable);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {OutputRef, ɵgetOutputDestroyRef} from '../../src/core';\nimport {Observable} from 'rxjs';\n\n/**\n * Converts an Angular output declared via `output()` or `outputFromObservable()`\n * to an observable.\n *\n * You can subscribe to the output via `Observable.subscribe` then.\n *\n * @publicApi\n */\nexport function outputToObservable<T>(ref: OutputRef<T>): Observable<T> {\n const destroyRef = ɵgetOutputDestroyRef(ref);\n\n return new Observable<T>((observer) => {\n // Complete the observable upon directive/component destroy.\n // Note: May be `undefined` if an `EventEmitter` is declared outside\n // of an injection context.\n destroyRef?.onDestroy(() => observer.complete());\n\n const subscription = ref.subscribe((v) => observer.next(v));\n return () => subscription.unsubscribe();\n });\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n effect,\n inject,\n Injector,\n Signal,\n untracked,\n} from '../../src/core';\nimport {SIGNAL, ReactiveNode} from '../../primitives/signals';\nimport {Observable, ReplaySubject} from 'rxjs';\n\n/**\n * Options for `toObservable`.\n *\n * @developerPreview\n */\nexport interface ToObservableOptions {\n /**\n * The `Injector` to use when creating the underlying `effect` which watches the signal.\n *\n * If this isn't specified, the current [injection context](guide/di/dependency-injection-context)\n * will be used.\n */\n injector?: Injector;\n\n /**\n * Temporary option for forcing a synchronous emit of the signal's initial value.\n *\n * This will eventually become the default behavior, but is opt-in to allow a short migration\n * period.\n *\n * @deprecated will become default behavior\n */\n forceSyncFirstEmit?: true;\n}\n\n/**\n * Exposes the value of an Angular `Signal` as an RxJS `Observable`.\n *\n * The signal's value will be propagated into the `Observable`'s subscribers using an `effect`.\n *\n * `toObservable` must be called in an injection context unless an injector is provided via options.\n *\n * @developerPreview\n */\nexport function toObservable<T>(source: Signal<T>, options?: ToObservableOptions): Observable<T> {\n if (options?.forceSyncFirstEmit === true) {\n return toObservableNext(source, options);\n }\n\n !options?.injector && assertInInjectionContext(toObservable);\n const injector = options?.injector ?? inject(Injector);\n const subject = new ReplaySubject<T>(1);\n\n const watcher = effect(\n () => {\n let value: T;\n try {\n value = source();\n } catch (err) {\n untracked(() => subject.error(err));\n return;\n }\n untracked(() => subject.next(value));\n },\n {injector, manualCleanup: true},\n );\n\n injector.get(DestroyRef).onDestroy(() => {\n watcher.destroy();\n subject.complete();\n });\n\n return subject.asObservable();\n}\n\n/**\n * New version of `toObservable` with always-synchronous first emit.\n *\n * This will eventually replace the other implementation.\n */\nfunction toObservableNext<T>(source: Signal<T>, options?: ToObservableOptions): Observable<T> {\n !options?.injector && assertInInjectionContext(toObservable);\n const injector = options?.injector ?? inject(Injector);\n\n return new Observable<T>((subscriber) => {\n let firstVersion: number = -1;\n let firstValue: T;\n try {\n firstValue = untracked(source);\n } catch (err) {\n // A failure on the first read just errors the observable without\n // creating an effect.\n subscriber.error(err);\n return;\n }\n // We cache the `version` of the first value. This lets us avoid emitting\n // this value a second time during the `effect`.\n firstVersion = signalVersion(source);\n\n // Emit the first value synchronously on subscription.\n subscriber.next(firstValue);\n\n // Create an effect that will watch the signal for future changes.\n let firstEmit = true;\n const ref = effect(\n () => {\n let value: T;\n try {\n // Read the value (& track it).\n value = source();\n } catch (err) {\n // Errors cause the Observable stream to terminate.\n untracked(() => subscriber.error(err));\n cleanup(false);\n return;\n }\n\n // Skip the emit of the value if it hasn't changed since the\n // synchronous emit.\n if (firstEmit) {\n firstEmit = false;\n if (signalVersion(source) === firstVersion) {\n return;\n }\n }\n\n untracked(() => subscriber.next(value));\n },\n {injector, manualCleanup: true},\n );\n\n const cleanup = (fromInjector: boolean) => {\n ref.destroy();\n\n if (fromInjector) {\n // If we're cleaning up because the injector is destroyed, then our\n // subscription is still active and we need to complete it.\n subscriber.complete();\n } else {\n // Otherwise, remove the cleanup function. This both prevents the\n // complete() event from being produced and allows memory to be\n // reclaimed.\n removeInjectorCleanupFn();\n }\n };\n\n const removeInjectorCleanupFn = injector.get(DestroyRef).onDestroy(() => {\n // Cleaning up from the `DestroyRef` means the stream is still active, so\n // we should emit completion.\n cleanup(true);\n });\n\n return () => cleanup(false);\n });\n}\n\nfunction signalVersion(source: Signal<unknown>): number {\n return (source[SIGNAL] as ReactiveNode).version;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n assertNotInReactiveContext,\n computed,\n DestroyRef,\n inject,\n Injector,\n signal,\n Signal,\n WritableSignal,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '../../src/core';\nimport {ValueEqualityFn} from '../../primitives/signals';\nimport {Observable, Subscribable} from 'rxjs';\n\n/**\n * Options for `toSignal`.\n *\n * @publicApi\n */\nexport interface ToSignalOptions<T> {\n /**\n * Initial value for the signal produced by `toSignal`.\n *\n * This will be the value of the signal until the observable emits its first value.\n */\n initialValue?: unknown;\n\n /**\n * Whether to require that the observable emits synchronously when `toSignal` subscribes.\n *\n * If this is `true`, `toSignal` will assert that the observable produces a value immediately upon\n * subscription. Setting this option removes the need to either deal with `undefined` in the\n * signal type or provide an `initialValue`, at the cost of a runtime error if this requirement is\n * not met.\n */\n requireSync?: boolean;\n\n /**\n * `Injector` which will provide the `DestroyRef` used to clean up the Observable subscription.\n *\n * If this is not provided, a `DestroyRef` will be retrieved from the current [injection\n * context](guide/di/dependency-injection-context), unless manual cleanup is requested.\n */\n injector?: Injector;\n\n /**\n * Whether the subscription should be automatically cleaned up (via `DestroyRef`) when\n * `toSignal`'s creation context is destroyed.\n *\n * If manual cleanup is enabled, then `DestroyRef` is not used, and the subscription will persist\n * until the `Observable` itself completes.\n */\n manualCleanup?: boolean;\n\n /**\n * A comparison function which defines equality for values emitted by the observable.\n *\n * Equality comparisons are executed against the initial value if one is provided.\n */\n equal?: ValueEqualityFn<T>;\n}\n\n// Base case: no options -> `undefined` in the result type.\nexport function toSignal<T>(source: Observable<T> | Subscribable<T>): Signal<T | undefined>;\n// Options with `undefined` initial value and no `requiredSync` -> `undefined`.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | undefined>> & {\n initialValue?: undefined;\n requireSync?: false;\n },\n): Signal<T | undefined>;\n// Options with `null` initial value -> `null`.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | null>> & {initialValue?: null; requireSync?: false},\n): Signal<T | null>;\n// Options with `undefined` initial value and `requiredSync` -> strict result type.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T>> & {initialValue?: undefined; requireSync: true},\n): Signal<T>;\n// Options with a more specific initial value type.\nexport function toSignal<T, const U extends T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | U>> & {initialValue: U; requireSync?: false},\n): Signal<T | U>;\n\n/**\n * Get the current value of an `Observable` as a reactive `Signal`.\n *\n * `toSignal` returns a `Signal` which provides synchronous reactive access to values produced\n * by the given `Observable`, by subscribing to that `Observable`. The returned `Signal` will always\n * have the most recent value emitted by the subscription, and will throw an error if the\n * `Observable` errors.\n *\n * With `requireSync` set to `true`, `toSignal` will assert that the `Observable` produces a value\n * immediately upon subscription. No `initialValue` is needed in this case, and the returned signal\n * does not include an `undefined` type.\n *\n * By default, the subscription will be automatically cleaned up when the current [injection\n * context](guide/di/dependency-injection-context) is destroyed. For example, when `toSignal` is\n * called during the construction of a component, the subscription will be cleaned up when the\n * component is destroyed. If an injection context is not available, an explicit `Injector` can be\n * passed instead.\n *\n * If the subscription should persist until the `Observable` itself completes, the `manualCleanup`\n * option can be specified instead, which disables the automatic subscription teardown. No injection\n * context is needed in this configuration as well.\n */\nexport function toSignal<T, U = undefined>(\n source: Observable<T> | Subscribable<T>,\n options?: ToSignalOptions<T | U> & {initialValue?: U},\n): Signal<T | U> {\n typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n assertNotInReactiveContext(\n toSignal,\n 'Invoking `toSignal` causes new subscriptions every time. ' +\n 'Consider moving `toSignal` outside of the reactive context and read the signal value where needed.',\n );\n\n const requiresCleanup = !options?.manualCleanup;\n requiresCleanup && !options?.injector && assertInInjectionContext(toSignal);\n const cleanupRef = requiresCleanup\n ? (options?.injector?.get(DestroyRef) ?? inject(DestroyRef))\n : null;\n\n const equal = makeToSignalEqual(options?.equal);\n\n // Note: T is the Observable value type, and U is the initial value type. They don't have to be\n // the same - the returned signal gives values of type `T`.\n let state: WritableSignal<State<T | U>>;\n if (options?.requireSync) {\n // Initially the signal is in a `NoValue` state.\n state = signal({kind: StateKind.NoValue}, {equal});\n } else {\n // If an initial value was passed, use it. Otherwise, use `undefined` as the initial value.\n state = signal<State<T | U>>(\n {kind: StateKind.Value, value: options?.initialValue as U},\n {equal},\n );\n }\n\n // Note: This code cannot run inside a reactive context (see assertion above). If we'd support\n // this, we would subscribe to the observable outside of the current reactive context, avoiding\n // that side-effect signal reads/writes are attribute to the current consumer. The current\n // consumer only needs to be notified when the `state` signal changes through the observable\n // subscription. Additional context (related to async pipe):\n // https://github.com/angular/angular/pull/50522.\n const sub = source.subscribe({\n next: (value) => state.set({kind: StateKind.Value, value}),\n error: (error) => {\n state.set({kind: StateKind.Error, error});\n },\n // Completion of the Observable is meaningless to the signal. Signals don't have a concept of\n // \"complete\".\n });\n\n if (options?.requireSync && state().kind === StateKind.NoValue) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',\n );\n }\n\n // Unsubscribe when the current context is destroyed, if requested.\n cleanupRef?.onDestroy(sub.unsubscribe.bind(sub));\n\n // The actual returned signal is a `computed` of the `State` signal, which maps the various states\n // to either values or errors.\n return computed(\n () => {\n const current = state();\n switch (current.kind) {\n case StateKind.Value:\n return current.value;\n case StateKind.Error:\n throw current.error;\n case StateKind.NoValue:\n // This shouldn't really happen because the error is thrown on creation.\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',\n );\n }\n },\n {equal: options?.equal},\n );\n}\n\nfunction makeToSignalEqual<T>(\n userEquality: ValueEqualityFn<T> = Object.is,\n): ValueEqualityFn<State<T>> {\n return (a, b) =>\n a.kind === StateKind.Value && b.kind === StateKind.Value && userEquality(a.value, b.value);\n}\n\nconst enum StateKind {\n NoValue,\n Value,\n Error,\n}\n\ninterface NoValueState {\n kind: StateKind.NoValue;\n}\n\ninterface ValueState<T> {\n kind: StateKind.Value;\n value: T;\n}\n\ninterface ErrorState {\n kind: StateKind.Error;\n error: unknown;\n}\n\ntype State<T> = NoValueState | ValueState<T> | ErrorState;\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {assertInInjectionContext, PendingTasks, inject, Injector} from '../../src/core';\nimport {MonoTypeOperatorFunction, Observable} from 'rxjs';\n\n/**\n * Operator which makes the application unstable until the observable emits, complets, errors, or is unsubscribed.\n *\n * Use this operator in observables whose subscriptions are important for rendering and should be included in SSR serialization.\n *\n * @param injector The `Injector` to use during creation. If this is not provided, the current injection context will be used instead (via `inject`).\n *\n * @experimental\n */\nexport function pendingUntilEvent<T>(injector?: Injector): MonoTypeOperatorFunction<T> {\n if (injector === undefined) {\n assertInInjectionContext(pendingUntilEvent);\n injector = inject(Injector);\n }\n const taskService = injector.get(PendingTasks);\n\n return (sourceObservable) => {\n return new Observable<T>((originalSubscriber) => {\n // create a new task on subscription\n const removeTask = taskService.add();\n\n let cleanedUp = false;\n function cleanupTask() {\n if (cleanedUp) {\n return;\n }\n\n removeTask();\n cleanedUp = true;\n }\n\n const innerSubscription = sourceObservable.subscribe({\n next: (v) => {\n originalSubscriber.next(v);\n cleanupTask();\n },\n complete: () => {\n originalSubscriber.complete();\n cleanupTask();\n },\n error: (e) => {\n originalSubscriber.error(e);\n cleanupTask();\n },\n });\n innerSubscription.add(() => {\n originalSubscriber.unsubscribe();\n cleanupTask();\n });\n return innerSubscription;\n });\n };\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n assertInInjectionContext,\n resource,\n ResourceLoaderParams,\n ResourceRef,\n Signal,\n signal,\n BaseResourceOptions,\n} from '../../src/core';\nimport {Observable, Subscription} from 'rxjs';\n\n/**\n * Like `ResourceOptions` but uses an RxJS-based `loader`.\n *\n * @experimental\n */\nexport interface RxResourceOptions<T, R> extends BaseResourceOptions<T, R> {\n loader: (params: ResourceLoaderParams<R>) => Observable<T>;\n}\n\n/**\n * Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the\n * resource's value.\n *\n * @experimental\n */\nexport function rxResource<T, R>(\n opts: RxResourceOptions<T, R> & {defaultValue: NoInfer<T>},\n): ResourceRef<T>;\n\n/**\n * Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the\n * resource's value.\n *\n * @experimental\n */\nexport function rxResource<T, R>(opts: RxResourceOptions<T, R>): ResourceRef<T | undefined>;\nexport function rxResource<T, R>(opts: RxResourceOptions<T, R>): ResourceRef<T | undefined> {\n opts?.injector || assertInInjectionContext(rxResource);\n return resource<T, R>({\n ...opts,\n loader: undefined,\n stream: (params) => {\n let sub: Subscription;\n\n // Track the abort listener so it can be removed if the Observable completes (as a memory\n // optimization).\n const onAbort = () => sub.unsubscribe();\n params.abortSignal.addEventListener('abort', onAbort);\n\n // Start off stream as undefined.\n const stream = signal<{value: T} | {error: unknown}>({value: undefined as T});\n let resolve: ((value: Signal<{value: T} | {error: unknown}>) => void) | undefined;\n const promise = new Promise<Signal<{value: T} | {error: unknown}>>((r) => (resolve = r));\n\n function send(value: {value: T} | {error: unknown}): void {\n stream.set(value);\n resolve?.(stream);\n resolve = undefined;\n }\n\n sub = opts.loader(params).subscribe({\n next: (value) => send({value}),\n error: (error) => send({error}),\n complete: () => {\n if (resolve) {\n send({error: new Error('Resource completed before producing a value')});\n }\n params.abortSignal.removeEventListener('abort', onAbort);\n },\n });\n\n return promise;\n },\n });\n}\n"],"names":["ɵRuntimeError","ɵgetOutputDestroyRef"],"mappings":";;;;;;;;;;;;;;;;AAYA;;;;;;;;;AASG;AACG,SAAU,kBAAkB,CAAI,UAAuB,EAAA;IAC3D,IAAI,CAAC,UAAU,EAAE;QACf,wBAAwB,CAAC,kBAAkB,CAAC;AAC5C,QAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;IAGjC,MAAM,UAAU,GAAG,IAAI,UAAU,CAAO,CAAC,QAAQ,KAAI;AACnD,QAAA,MAAM,YAAY,GAAG,UAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACxE,QAAA,OAAO,YAAY;AACrB,KAAC,CAAC;IAEF,OAAO,CAAI,MAAqB,KAAI;QAClC,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAC3C,KAAC;AACH;;ACdA;;;;;AAKG;AACH,MAAM,uBAAuB,CAAA;AAKP,IAAA,MAAA;IAJZ,SAAS,GAAG,KAAK;AAEzB,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAE/B,IAAA,WAAA,CAAoB,MAAqB,EAAA;QAArB,IAAM,CAAA,MAAA,GAAN,MAAM;AACxB,QAAA,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,MAAK;AAC7B,YAAA,IAAI,CAAC,SAAS,GAAG,IAAI;AACvB,SAAC,CAAC;;AAGJ,IAAA,SAAS,CAAC,UAA8B,EAAA;AACtC,QAAA,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,MAAM,IAAIA,YAAa,CAAA,GAAA,+CAErB,SAAS;gBACP,oDAA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