From d05eec464377ff5a64ef397fb6e573ba06adf1b1 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Wed, 5 Aug 2026 11:05:42 -0500 Subject: [PATCH 1/7] refactor: remove callback thisArg support --- docs/rxjs-next/COMPATIBILITY.md | 10 +-- docs/rxjs-next/DECISIONS.md | 24 ++++++- docs/rxjs-next/OPEN_QUESTIONS.md | 15 ++--- docs/rxjs-next/PROJECT_PLAN.md | 60 +++++++++++++++++- docs/rxjs-next/RxJS-7-parity.md | 12 ++-- packages/rxjs/MIGRATION.md | 14 ++++- .../rxjs/docs/MIGRATION_EVIDENCE_LEDGER.md | 8 +-- packages/rxjs/src/every.spec.ts | 21 ++++--- packages/rxjs/src/every.ts | 13 +--- packages/rxjs/src/filter.spec.ts | 10 +-- packages/rxjs/src/filter.ts | 16 +---- packages/rxjs/src/find-index.spec.ts | 30 +++++---- packages/rxjs/src/find-index.ts | 13 +--- packages/rxjs/src/find.spec.ts | 30 +++++---- packages/rxjs/src/find.ts | 19 +----- packages/rxjs/src/map.spec.ts | 14 ----- packages/rxjs/src/map.ts | 11 +--- packages/rxjs/src/partition.spec.ts | 14 ++--- packages/rxjs/src/partition.ts | 26 +------- packages/rxjs/test/kernel/contract.mjs | 10 +-- .../rxjs/test/ported/capability-registry.json | 20 +++--- .../ported/cold/observables/partition.spec.ts | 4 +- .../test/ported/cold/operators/filter.spec.ts | 12 +--- .../ported/cold/operators/find-index.spec.ts | 4 +- .../test/ported/cold/operators/find.spec.ts | 4 +- .../test/ported/cold/operators/map.spec.ts | 24 +++---- .../rxjs/test/ported/manifest.generated.json | 36 +++++------ .../migration-evidence-ledger.generated.json | 24 ++++--- .../platform/observables/partition.spec.ts | 4 +- .../ported/platform/operators/filter.spec.ts | 12 +--- .../platform/operators/find-index.spec.ts | 4 +- .../ported/platform/operators/find.spec.ts | 4 +- .../ported/platform/operators/map.spec.ts | 24 +++---- .../ported/tools/generate-port-manifest.mjs | 63 ++++++++++++++++++- packages/rxjs/test/types/usage.ts | 19 ++++++ 35 files changed, 342 insertions(+), 286 deletions(-) diff --git a/docs/rxjs-next/COMPATIBILITY.md b/docs/rxjs-next/COMPATIBILITY.md index b9dfc15252..e5eee51fdb 100644 --- a/docs/rxjs-next/COMPATIBILITY.md +++ b/docs/rxjs-next/COMPATIBILITY.md @@ -400,10 +400,12 @@ whether the RxJS form delegates, which additional functionality it supplies, and which behavior or types intentionally differ. It must also prove that installing the Symbol does not alter the platform method. -The P2.4 `map` pilot is the first recorded overlap. `observable[map](project, -thisArg?)` owns an RxJS projection index and optional callback receiver, -constructs through the RxJS `[create]` protocol, and participates in the -platform layer's shared activation lifecycle. It does not delegate to +The P2.4 `map` pilot is the first recorded overlap. `observable[map](project)` +owns an RxJS projection index, constructs through the RxJS `[create]` protocol, +and participates in the platform layer's shared activation lifecycle. D-059 +removes the inherited RxJS 7 callback-receiver argument from this and every +other RxJS Next callback API; migration uses a closure or +`Function.prototype.bind`. The Symbol form does not delegate to `observable.map(project)`, and installing it leaves that platform-owned string method unchanged. Focused and native/fallback kernel tests cover both the additional Symbol behavior and non-interference. diff --git a/docs/rxjs-next/DECISIONS.md b/docs/rxjs-next/DECISIONS.md index 8fa787d248..b532ed4129 100644 --- a/docs/rxjs-next/DECISIONS.md +++ b/docs/rxjs-next/DECISIONS.md @@ -476,7 +476,7 @@ Status meanings: ## D-023 — Keep RxJS map and filter overloads on exact Symbol keys -- **Status:** Accepted +- **Status:** Superseded by D-059 - **Decision:** The RxJS `map` and `filter` contracts are installed only under their exported exact Symbol keys. Their RxJS forms preserve the projection or predicate index and optional `thisArg`; `filter` also preserves Boolean @@ -492,6 +492,10 @@ Status meanings: distinction for `filter`. Projection and predicate errors terminate the shared operator activation. Concurrent observers share one upstream activation and one index sequence under the platform lifecycle. +- **Reason superseded:** RxJS Next removes callback `thisArg` parameters rather + than carrying this RxJS 7 convenience into the new API. Closures and + `Function.prototype.bind` express the same receiver capture without forcing + every operator notification through `Function.prototype.call`. ## D-024 — Let finite take cancel synchronous upstream work before its limit @@ -1491,3 +1495,21 @@ Status meanings: operational and bootstrap costs for the current sole-maintainer release. - **Scope:** Stable `9.0.0`, promotion to `latest`, and future reconsideration of registry-supported trusted publishing remain separate decisions. + +## D-059 — Remove callback `thisArg` parameters from RxJS Next + +- **Status:** Accepted +- **Decision:** RxJS Next callback APIs do not accept a separate `thisArg`. + Remove the parameter and receiver-aware overloads from Symbol-keyed `every`, + `filter`, `find`, `findIndex`, `map`, and static `partition`. Invoke their + predicates and projectors directly. +- **Rationale:** A closure or `Function.prototype.bind` expresses an intentional + receiver at the call site. Retaining `thisArg` forces RxJS to dispatch every + value through `.call`, adding API and hot-path implementation cost for a + redundant convenience inherited from RxJS 7. +- **Consequence:** Migration must rewrite a second callback-receiver argument + to a closure or bound function. The callback value/index/source arguments, + type-guard and Boolean-constructor overloads, cancellation, result + construction, and platform string-named methods are unchanged. Historical + RxJS 7 evidence retains its source identity, while active migrated specs use + closures or bound functions instead of asserting the removed overload. diff --git a/docs/rxjs-next/OPEN_QUESTIONS.md b/docs/rxjs-next/OPEN_QUESTIONS.md index 8ab79014a4..0dcc1b0b5a 100644 --- a/docs/rxjs-next/OPEN_QUESTIONS.md +++ b/docs/rxjs-next/OPEN_QUESTIONS.md @@ -108,13 +108,14 @@ Decide per overlapping operator: - documentation that prevents false parity claims; - native and fallback evidence that the platform method remains untouched. -P2.4 settles the pilot `map` case. The exact RxJS Symbol form supplies the -RxJS projection index and optional `thisArg`, constructs through `[create]`, -and follows the platform layer's shared activation contract. It does not -delegate to or replace the string-named platform `map`; native and fallback -kernel evidence verifies that the original method and descriptor remain -unchanged. Other overlapping operators still require the same per-capability -record before they are restored. +P2.4 settled the pilot `map` overlap and D-059 later removed its inherited +RxJS 7 callback-receiver argument. The exact RxJS Symbol form supplies the +RxJS projection index, constructs through `[create]`, and follows the platform +layer's shared activation contract. It does not delegate to or replace the +string-named platform `map`; native and fallback kernel evidence verifies that +the original method and descriptor remain unchanged. Other overlapping +operators still require the same per-capability record before they are +restored. ### 6. What is the canonical extension implementation pattern? diff --git a/docs/rxjs-next/PROJECT_PLAN.md b/docs/rxjs-next/PROJECT_PLAN.md index cdf47fc508..f33b06389c 100644 --- a/docs/rxjs-next/PROJECT_PLAN.md +++ b/docs/rxjs-next/PROJECT_PLAN.md @@ -80,9 +80,11 @@ wrappers in favor of direct D-037 `[create]` calls and recorded a further bundle-size reduction. P6.8 completed durable pull-request and `master` CI ownership for every accepted RxJS 9 test and release check. P6.9 implemented truthful status signals and security automation and validated their first live -GitHub results. The user has now prioritized P6.10: one understandable, -interactive single-maintainer beta publication command with npm two-factor -authentication and no CI publishing credential. +GitHub results. The user then explicitly prioritized P6.11, which removed +inherited callback `thisArg` parameters and their hot-path dispatch cost. P6.10 +remains the sole `NEXT` item: one understandable, interactive single-maintainer +beta publication command with npm two-factor authentication and no CI +publishing credential. RxJS 9 and `9.0.0-beta.0` are selected under D-007. D-053 defines runtime, browser, bundler, channel, and RxJS 7 maintenance policy. Dates and staffing @@ -1569,6 +1571,7 @@ names. | `DONE` | P6.8 | Complete RxJS 9 CI coverage and validate the resulting pull-request workflow matrix | | `DONE` | P6.9 | Validate the first live dependency-review and Scorecard runs on GitHub | | `NEXT` | P6.10 | Publish and verify the first beta with the interactive release command | +| `DONE` | P6.11 | Remove inherited callback `thisArg` parameters and direct-call callback hot paths | #### P6.9 completion bar @@ -1647,6 +1650,41 @@ review`. This completes P6.9; the later P6.10 ruleset migration must preserve OTP/WebAuthn publication, package-access hardening, registry verification, and the immutable GitHub Release remain required before `DONE`. +#### P6.11 completion bar + +- Every RxJS Next callback API is audited for a separate `thisArg`; the exact + affected API inventory is recorded. +- Receiver-aware overloads, implementation parameters, and `.call` dispatch + are removed from all affected APIs without changing platform-polyfill + receiver binding required by Web IDL and iterator protocols. +- Focused and migrated tests no longer assert library-provided callback + receivers; source-pinned RxJS 7 identifiers remain historical evidence, and + active replacements demonstrate closures or `Function.prototype.bind`. +- Focused source, migrated cold/polyfill, public type, package, kernel, + migration-document freshness, lint, and diff gates pass. + +#### P6.11 completion evidence + +- Audited RxJS production source and found exactly six APIs with a separate + callback receiver argument: Symbol-keyed `every`, `filter`, `find`, + `findIndex`, and `map`, plus static Symbol-keyed `partition`. Removed every + receiver-aware overload, implementation parameter, and callback `.call`. +- Replaced active receiver assertions with ordinary value/index/source tests, + closures, or explicitly bound callbacks. Added public declaration checks + that reject the removed second or third arguments. Classified all six + source-pinned RxJS 7 cases as intentional divergences and made their + executable migrated programs bind callbacks instead of exercising the + removed overload. +- Passed all 750 RxJS source tests, the 76 affected cold and 76 affected + polyfill migrated tests, lint with zero errors, public types, package build, + migration-document freshness, 97-Symbol installation, and all package import + fixtures. Exact complete audits retained the reviewed 2,299/39 cold and + 2,316/22 polyfill outcomes. +- Passed the eight-case packaged fallback/native Chrome 150 kernel contract. + The release performance gate measured approximately 63.0 million map values + and 140,627 cancellations per second. Marked P6.11 `DONE`; the completed + execution queue has no `NEXT` marker. + #### P6.1 completion bar - All release packages share the accepted RxJS 9 prerelease identity and exact @@ -3680,3 +3718,19 @@ conformance implementation depends on a runnable harness. remains the sole `NEXT` item until the command publishes and verifies `9.0.0-beta.0`, package access disallows automation tokens, and the immutable GitHub Release is recorded. +### 2026-08-05 — P6.11 callback receiver removal + +- Audited the complete RxJS production source and removed callback `thisArg` + overloads and `.call` dispatch from `every`, `filter`, `find`, `findIndex`, + `map`, and `partition`; no platform-polyfill protocol receiver binding was + changed. +- Reworked focused and migrated tests to use ordinary closures or bound + callbacks, added negative public-type assertions, and classified the six + source-pinned RxJS 7 receiver cases as intentional divergences while + preserving their historical IDs. +- Passed 750 source tests, both 76-test affected migrated suites, exact complete + cold/polyfill audit baselines, public types, lint, package/build/import and + migration freshness gates, the packaged fallback/native Chrome kernel, and + the release performance floor. +- Recorded D-059, marked P6.11 `DONE`, and retained P6.10 as the sole `NEXT` + item. diff --git a/docs/rxjs-next/RxJS-7-parity.md b/docs/rxjs-next/RxJS-7-parity.md index 2562077e84..ab41a48519 100644 --- a/docs/rxjs-next/RxJS-7-parity.md +++ b/docs/rxjs-next/RxJS-7-parity.md @@ -70,22 +70,22 @@ pnpm --filter rxjs run test:unit:parity:check | `distinctUntilKeyChanged` | Present; parity unverified | `source[distinctUntilKeyChanged](key, comparator?)` | 21 | Delegates property-key comparison to the exact distinctUntilChanged Symbol contract. Symbol source: `packages/rxjs/src/distinct-until-key-changed.ts`; executable adapter: `identity`. | | `elementAt` | Present; partial empty behavior | `source[elementAt](index, defaultValue?)` | 12 | The default-value overload is present; the no-default out-of-range error remains compatibility evidence. Symbol source: `packages/rxjs/src/element-at.ts`; executable adapter: `elementAt`. | | `endWith` | Partial unified mapping | `source[concat]([values])` | 16 | Adapts trailing values to one iterable concat source; a trailing SchedulerLike is retained as an explicit unsupported-overload failure. Symbol source: `packages/rxjs/src/concat.ts`; executable adapter: `endWith`. | -| `every` | Present; parity unverified | `source[every](predicate, thisArg?)` | 22 | Evaluates value, index, and source and cancels upstream before emitting the first false result. Symbol source: `packages/rxjs/src/every.ts`; executable adapter: `identity`. | +| `every` | Present; parity unverified | `source[every](predicate)` | 22 | Evaluates value, index, and source and cancels upstream before emitting the first false result. Symbol source: `packages/rxjs/src/every.ts`; executable adapter: `identity`. | | `exhaust` | Partial unified mapping | `source[exhaustMap](identity)` | 0 | Legacy flattening alias maps to exhaustMap. Symbol source: `packages/rxjs/src/exhaust-map.ts`; executable adapter: `flattenIdentity`. | | `exhaustAll` | Partial unified mapping | `source[exhaustMap](identity)` | 15 | Flattening is expressed through exhaustMap. Symbol source: `packages/rxjs/src/exhaust-map.ts`; executable adapter: `flattenIdentity`. | | `exhaustMap` | Present; parity unverified | `source[exhaustMap](project)` | 18 | Legacy result-selector overloads are not represented. Symbol source: `packages/rxjs/src/exhaust-map.ts`; executable adapter: `firstArgument`. | | `expand` | Present; scheduler overload deferred | `source[expand](project, { concurrent })` | 13 | Adapts legacy numeric concurrency to the options contract. Scheduler arguments are not a public platform contract; their ported behavioral claims use explicit test-harness timing rewrites. Symbol source: `packages/rxjs/src/expand.ts`; executable adapter: `expand`. | -| `filter` | Present; parity unverified | `source[filter](predicate, thisArg?)` | 21 | The RxJS Symbol form preserves predicate index, thisArg, type guards, errors, and cancellation without replacing the platform string method. Symbol source: `packages/rxjs/src/filter.ts`; executable adapter: `identity`. | +| `filter` | Present; parity unverified | `source[filter](predicate)` | 21 | The RxJS Symbol form preserves predicate index, type guards, errors, and cancellation without replacing the platform string method; callback receivers must use closures or Function.prototype.bind. Symbol source: `packages/rxjs/src/filter.ts`; executable adapter: `identity`. | | `finalize` | Present; parity unverified | `source[finalize](callback)` | 8 | Runs once after completion, error, or last-observer cancellation without replacing the platform finally method. Symbol source: `packages/rxjs/src/finalize.ts`; executable adapter: `identity`. | -| `find` | Present; parity unverified | `source[find](predicate, thisArg?)` | 12 | Emits the first matching value or undefined with predicate index, source identity, thisArg, early cancellation, and no replacement of the platform find() Promise consumer. Symbol source: `packages/rxjs/src/find.ts`; executable adapter: `identity`. | -| `findIndex` | Present; parity unverified | `source[findIndex](predicate, thisArg?)` | 12 | Emits the first matching index or -1 with predicate source identity, thisArg, errors, and early cancellation. Symbol source: `packages/rxjs/src/find-index.ts`; executable adapter: `identity`. | +| `find` | Present; parity unverified | `source[find](predicate)` | 12 | Emits the first matching value or undefined with predicate index, source identity, and early cancellation, without replacing the platform find() Promise consumer; callback receivers must use closures or Function.prototype.bind. Symbol source: `packages/rxjs/src/find.ts`; executable adapter: `identity`. | +| `findIndex` | Present; parity unverified | `source[findIndex](predicate)` | 12 | Emits the first matching index or -1 with predicate source identity, errors, and early cancellation; callback receivers must use closures or Function.prototype.bind. Symbol source: `packages/rxjs/src/find-index.ts`; executable adapter: `identity`. | | `first` | Present; parity unverified | `source[first](predicate?, defaultValue?)` | 17 | Preserves predicate, default-value arity, EmptyError, early cancellation, and the distinct RxJS Symbol contract without replacing the platform first() Promise consumer. Symbol source: `packages/rxjs/src/first.ts`; executable adapter: `identity`. | | `flatMap` | Partial unified mapping | `source[mergeMap](project, options?)` | 0 | RxJS 7 flatMap is an alias of mergeMap. Symbol source: `packages/rxjs/src/merge-map.ts`; executable adapter: `mergeMap`. | | `groupBy` | Present; scheduler-internal cases deferred | `source[groupBy](keySelector, optionsOrElement?, duration?, connector?)` | 36 | Emits hot read-only keyed group views with options and deprecated positional selector forms; active group observers may retain source work after outer cancellation. Symbol source: `packages/rxjs/src/group-by.ts`; executable adapter: `identity`. | | `ignoreElements` | Partial unified mapping | `source[mergeMap](() => Observable.from([]))` | 9 | Maps each input to an ambient empty Observable while retaining source completion and error behavior. Symbol source: `packages/rxjs/src/merge-map.ts`; executable adapter: `ignoreElements`. | | `isEmpty` | Present; parity unverified | `source[isEmpty]()` | 7 | Emits false and cancels upstream on the first value, or emits true after successful empty completion. Symbol source: `packages/rxjs/src/is-empty.ts`; executable adapter: `identity`. | | `last` | Present; parity unverified | `source[last](predicate?, defaultValue?)` | 11 | Preserves predicate, default-value arity, EmptyError, completion-time selection, and the distinct RxJS Symbol contract without replacing the platform last() Promise consumer. Symbol source: `packages/rxjs/src/last.ts`; executable adapter: `identity`. | -| `map` | Present; parity unverified | `source[map](project, thisArg?)` | 93 | The RxJS Symbol form preserves projection index, thisArg, errors, and cancellation without replacing the platform string method. Symbol source: `packages/rxjs/src/map.ts`; executable adapter: `identity`. | +| `map` | Present; parity unverified | `source[map](project)` | 93 | The RxJS Symbol form preserves projection index, errors, and cancellation without replacing the platform string method; callback receivers must use closures or Function.prototype.bind. Symbol source: `packages/rxjs/src/map.ts`; executable adapter: `identity`. | | `mapTo` | Partial unified mapping | `source[mergeMap](() => Observable.from([value]))` | 11 | Expresses constant projection through mergeMap and an ambient single-value Observable. Symbol source: `packages/rxjs/src/merge-map.ts`; executable adapter: `mapTo`. | | `materialize` | Present; parity unverified | `source[materialize]()` | 10 | Converts every source signal into a Notification next value and completes after materialized error or completion. Symbol source: `packages/rxjs/src/materialize.ts`; executable adapter: `identity`. | | `max` | Present; parity unverified | `source[max](comparer?)` | 18 | Delegates unseeded maximum selection and lifecycle behavior to the exact reduce Symbol. Symbol source: `packages/rxjs/src/max.ts`; executable adapter: `identity`. | @@ -178,7 +178,7 @@ pnpm --filter rxjs run test:unit:parity:check | `of` | Partial platform mapping | `Observable.from(values)` | 400 | Adapts variadic values to the platform Observable.from contract. Uses the ambient platform Observable. Executable adapter: `of`. | | `onErrorResumeNext` | Partial unified mapping | `Observable[onErrorResumeNext](sources)` | 3 | Adapts variadic or single-array source arguments to the current array form. Symbol source: `packages/rxjs/src/on-error-resume-next.ts`. Executable adapter: `staticSourcesArrayOrSingleArray`. | | `pairs` | Partial platform mapping | `Observable.from(Object.entries(object))` | 2 | Scheduler arguments are not represented. Uses the ambient platform Observable. Executable adapter: `pairs`. | -| `partition` | Present; parity unverified | `Observable[partition](source, predicate, thisArg?)` | 16 | Returns matching and rejected branches with independent predicate state over the platform source's shared, ref-counted activation. Symbol source: `packages/rxjs/src/partition.ts`. Executable adapter: `identity`. | +| `partition` | Present; parity unverified | `Observable[partition](source, predicate)` | 16 | Returns matching and rejected branches with independent predicate state over the platform source's shared, ref-counted activation. Symbol source: `packages/rxjs/src/partition.ts`. Executable adapter: `identity`. | | `race` | Partial unified mapping | `Observable[race](sources)` | 15 | Adapts variadic or single-array sources to the current array form. Symbol source: `packages/rxjs/src/race.ts`. Executable adapter: `staticSourcesArrayOrSingleArray`. | | `range` | Partial platform mapping | `Observable.from(Array.from({ length: count }, (_, i) => start + i))` | 3 | Scheduler arguments are not represented. Uses the ambient platform Observable. Executable adapter: `range`. | | `scheduled` | **Missing** | — | 5 | No current RxJS Next function mapping. | diff --git a/packages/rxjs/MIGRATION.md b/packages/rxjs/MIGRATION.md index bd4b428be5..e86b005987 100644 --- a/packages/rxjs/MIGRATION.md +++ b/packages/rxjs/MIGRATION.md @@ -78,8 +78,18 @@ const names = users[filter]((user) => user.active)[map]((user) => user.name); The platform and RxJS forms can coexist. For example, `source.map(project)` is the platform contract while -`source[map](project, thisArg)` is the RxJS contract. Importing the RxJS Symbol -must not replace the platform string-named method. +`source[map](project)` is the RxJS contract. Importing the RxJS Symbol must not +replace the platform string-named method. + +RxJS 9 does not accept the RxJS 7 callback `thisArg` parameter on `every`, +`filter`, `find`, `findIndex`, `map`, or `partition`. Capture state with a +closure or bind the callback explicitly: + +```ts +const offset = 10; +const closedOver = source[map]((value) => value + offset); +const bound = source[map](project.bind(context)); +``` Use the exact `pipe` Symbol only when deliberate multi-step composition is clearer than direct Symbol chaining: diff --git a/packages/rxjs/docs/MIGRATION_EVIDENCE_LEDGER.md b/packages/rxjs/docs/MIGRATION_EVIDENCE_LEDGER.md index 3716f59f0f..f38d148b6a 100644 --- a/packages/rxjs/docs/MIGRATION_EVIDENCE_LEDGER.md +++ b/packages/rxjs/docs/MIGRATION_EVIDENCE_LEDGER.md @@ -62,10 +62,10 @@ pnpm --filter rxjs run test:unit:ledger:check | `exhaustAll` | Partial unified mapping | source-pinned | 15 | 15/15 | 15/15 | portable | shared-active-platform | AbortSignal | changed | mechanical-change-and-semantic-review | D-003, D-048, D-049 | | `exhaustMap` | Present; parity unverified | source-pinned | 18 | 17/18 | 17/18 | compatibility-only, portable | shared-active-platform | AbortSignal | changed | mechanical-change | D-003, D-048, D-049 | | `expand` | Present; scheduler overload deferred | source-pinned | 13 | 13/13 | 13/13 | harness-rewrite, portable | shared-active-platform | AbortSignal | changed | mechanical-change-and-semantic-review | D-003, D-033, D-034, D-048, D-049 | -| `filter` | Present; parity unverified | source-pinned | 21 | 21/21 | 21/21 | portable | shared-active-platform | AbortSignal | changed | mechanical-change | D-003, D-048, D-049 | +| `filter` | Present; parity unverified | source-pinned | 21 | 21/21 | 21/21 | intentional-divergence, portable | shared-active-platform | AbortSignal | changed | mechanical-change | D-003, D-048, D-049 | | `finalize` | Present; parity unverified | source-pinned | 8 | 8/8 | 8/8 | portable | shared-active-platform | AbortSignal | changed | mechanical-change | D-003, D-048, D-049 | -| `find` | Present; parity unverified | source-pinned | 12 | 12/12 | 12/12 | portable | shared-active-platform | AbortSignal | changed | mechanical-change | D-003, D-048, D-049 | -| `findIndex` | Present; parity unverified | source-pinned | 12 | 12/12 | 12/12 | portable | shared-active-platform | AbortSignal | changed | mechanical-change | D-003, D-048, D-049 | +| `find` | Present; parity unverified | source-pinned | 12 | 12/12 | 12/12 | intentional-divergence, portable | shared-active-platform | AbortSignal | changed | mechanical-change | D-003, D-048, D-049 | +| `findIndex` | Present; parity unverified | source-pinned | 12 | 12/12 | 12/12 | intentional-divergence, portable | shared-active-platform | AbortSignal | changed | mechanical-change | D-003, D-048, D-049 | | `first` | Present; parity unverified | source-pinned | 17 | 17/17 | 17/17 | portable | shared-active-platform | AbortSignal | changed | mechanical-change | D-003, D-048, D-049 | | `flatMap` | Partial unified mapping | source-pinned-alias | 149 | 143/149 | 143/149 | compatibility-only, harness-rewrite, intentional-divergence, portable | shared-active-platform | AbortSignal | changed | mechanical-change-and-semantic-review | D-003, D-048, D-049 | | `groupBy` | Present; scheduler-internal cases deferred | source-pinned | 36 | 36/36 | 36/36 | harness-rewrite, portable | shared-active-platform | AbortSignal | changed | mechanical-change-and-semantic-review | D-003, D-033, D-034, D-048, D-049 | @@ -160,7 +160,7 @@ pnpm --filter rxjs run test:unit:ledger:check | `of` | Partial platform mapping | source-pinned | 400 | 394/400 | 394/400 | compatibility-only, harness-rewrite, intentional-divergence, portable | shared-active-platform | AbortSignal | changed | mechanical-change-and-semantic-review | D-040 | | `onErrorResumeNext` | Partial unified mapping | source-pinned | 3 | 3/3 | 3/3 | portable | shared-active-platform | AbortSignal | changed | mechanical-change-and-semantic-review | D-003, D-040, D-048, D-049 | | `pairs` | Partial platform mapping | source-pinned | 2 | 2/2 | 2/2 | portable | shared-active-platform | AbortSignal | changed | mechanical-change-and-semantic-review | D-040 | -| `partition` | Present; parity unverified | source-pinned | 16 | 16/16 | 16/16 | harness-rewrite, portable | shared-active-platform | AbortSignal | changed | mechanical-change | D-003, D-040, D-048, D-049 | +| `partition` | Present; parity unverified | source-pinned | 16 | 16/16 | 16/16 | harness-rewrite, intentional-divergence, portable | shared-active-platform | AbortSignal | changed | mechanical-change | D-003, D-040, D-048, D-049 | | `race` | Partial unified mapping | source-pinned | 15 | 15/15 | 15/15 | portable | shared-active-platform | AbortSignal | changed | mechanical-change-and-semantic-review | D-003, D-040, D-048, D-049 | | `range` | Partial platform mapping | source-pinned | 3 | 3/3 | 3/3 | harness-rewrite | shared-active-platform | AbortSignal | changed | mechanical-change-and-semantic-review | D-040 | | `throwError` | Partial platform mapping | source-pinned | 31 | 31/31 | 31/31 | harness-rewrite, intentional-divergence, portable | shared-active-platform | AbortSignal | changed | mechanical-change-and-semantic-review | D-040 | diff --git a/packages/rxjs/src/every.spec.ts b/packages/rxjs/src/every.spec.ts index e3c09f338e..8dd36dec9d 100644 --- a/packages/rxjs/src/every.spec.ts +++ b/packages/rxjs/src/every.spec.ts @@ -17,10 +17,12 @@ describe('every', () => { const emptyResults: Array = []; const matchingResults: Array = []; - new Observable((subscriber) => subscriber.complete())[every]((value) => value > 0).subscribe({ - next: (value) => emptyResults.push(value), - complete: () => emptyResults.push('complete'), - }); + new Observable((subscriber) => subscriber.complete()) + [every]((value) => value > 0) + .subscribe({ + next: (value) => emptyResults.push(value), + complete: () => emptyResults.push('complete'), + }); fromValues(2, 4, 6) [every]((value) => value % 2 === 0) @@ -33,17 +35,16 @@ describe('every', () => { expect(matchingResults).toEqual([true, 'complete']); }); - it('passes the value, zero-based index, source, and optional thisArg to the predicate', () => { - const context = { maximum: 10 }; + it('passes the value, zero-based index, and source to the predicate', () => { + const maximum = 10; const source = fromValues(2, 4, 6); const calls: Array<[number, number, Observable]> = []; const results: boolean[] = []; - source[every](function (value, index, predicateSource) { - expect(this).toBe(context); + source[every]((value, index, predicateSource) => { calls.push([value, index, predicateSource]); - return value < this.maximum; - }, context).subscribe((value) => results.push(value)); + return value < maximum; + }).subscribe((value) => results.push(value)); expect(calls).toEqual([ [2, 0, source], diff --git a/packages/rxjs/src/every.ts b/packages/rxjs/src/every.ts index 30a1528ea3..a4ecaedd77 100644 --- a/packages/rxjs/src/every.ts +++ b/packages/rxjs/src/every.ts @@ -9,25 +9,16 @@ declare global { interface Observable { [every]: { (predicate: BooleanConstructor): Observable extends never ? false : boolean>; - (predicate: BooleanConstructor, thisArg: unknown): Observable extends never ? false : boolean>; - (predicate: (this: A, value: T, index: number, source: Observable) => boolean, thisArg: A): Observable; (predicate: (value: T, index: number, source: Observable) => boolean): Observable; }; } } function everyOperator(this: Observable, predicate: BooleanConstructor): Observable; -function everyOperator(this: Observable, predicate: BooleanConstructor, thisArg: unknown): Observable; -function everyOperator( - this: Observable, - predicate: (this: A, value: T, index: number, source: Observable) => boolean, - thisArg: A -): Observable; function everyOperator(this: Observable, predicate: (value: T, index: number, source: Observable) => boolean): Observable; function everyOperator( this: Observable, - predicate: (this: unknown, value: T, index: number, source: Observable) => boolean, - thisArg?: unknown + predicate: (value: T, index: number, source: Observable) => boolean ): Observable { const source = this; @@ -46,7 +37,7 @@ function everyOperator( subscriber, { next: (value) => { - if (!predicate.call(thisArg, value, index++, source)) { + if (!predicate(value, index++, source)) { conclude(false); } }, diff --git a/packages/rxjs/src/filter.spec.ts b/packages/rxjs/src/filter.spec.ts index 9d43d7230e..9ef067a95e 100644 --- a/packages/rxjs/src/filter.spec.ts +++ b/packages/rxjs/src/filter.spec.ts @@ -3,8 +3,8 @@ import '@rxjs/observable-polyfill'; import { filter } from './filter.js'; describe('filter', () => { - it('emits accepted values and supplies a zero-based index and thisArg', () => { - const context = { minimum: 2 }; + it('emits accepted values and supplies a zero-based index', () => { + const minimum = 2; const calls: Array<[number, number]> = []; const results: Array = []; const source = new Observable((subscriber) => { @@ -14,10 +14,10 @@ describe('filter', () => { subscriber.complete(); }); - source[filter](function (value, index) { + source[filter]((value, index) => { calls.push([value, index]); - return value >= this.minimum; - }, context).subscribe({ + return value >= minimum; + }).subscribe({ next: (value) => results.push(value), complete: () => results.push('complete'), }); diff --git a/packages/rxjs/src/filter.ts b/packages/rxjs/src/filter.ts index e5a83bbcca..f4a58cf060 100644 --- a/packages/rxjs/src/filter.ts +++ b/packages/rxjs/src/filter.ts @@ -9,35 +9,23 @@ export const filter: unique symbol = Symbol('filter'); declare global { interface Observable { [filter]: { - (predicate: (this: A, value: T, index: number) => value is S, thisArg: A): Observable; (predicate: (value: T, index: number) => value is S): Observable; (predicate: BooleanConstructor): Observable>; - (predicate: (this: A, value: T, index: number) => boolean, thisArg: A): Observable; (predicate: (value: T, index: number) => boolean): Observable; }; } } -function filterOperator( - this: Observable, - predicate: (this: A, value: T, index: number) => value is S, - thisArg: A -): Observable; function filterOperator(this: Observable, predicate: (value: T, index: number) => value is S): Observable; function filterOperator(this: Observable, predicate: BooleanConstructor): Observable>; -function filterOperator(this: Observable, predicate: (this: A, value: T, index: number) => boolean, thisArg: A): Observable; function filterOperator(this: Observable, predicate: (value: T, index: number) => boolean): Observable; -function filterOperator( - this: Observable, - predicate: (this: unknown, value: T, index: number) => boolean, - thisArg?: unknown -): Observable { +function filterOperator(this: Observable, predicate: (value: T, index: number) => boolean): Observable { return this[create]((subscriber) => { let index = 0; subscribeToSource(this, subscriber, { next: (value) => { - if (predicate.call(thisArg, value, index++)) { + if (predicate(value, index++)) { subscriber.next(value); } }, diff --git a/packages/rxjs/src/find-index.spec.ts b/packages/rxjs/src/find-index.spec.ts index 8759273714..180fd42d5d 100644 --- a/packages/rxjs/src/find-index.spec.ts +++ b/packages/rxjs/src/find-index.spec.ts @@ -58,7 +58,9 @@ describe('findIndex', () => { const emptyValues: number[] = []; const nonmatchingValues: number[] = []; - Observable.from([] as number[])[findIndex](() => true).subscribe((value) => emptyValues.push(value)); + Observable.from([] as number[]) + [findIndex](() => true) + .subscribe((value) => emptyValues.push(value)); Observable.from([1, 2, 3]) [findIndex]((value) => value > 10) .subscribe((value) => nonmatchingValues.push(value)); @@ -67,21 +69,21 @@ describe('findIndex', () => { expect(nonmatchingValues).toEqual([-1]); }); - it('passes value, index, and the exact source and supports thisArg', () => { + it('passes value, index, and the exact source', () => { const source = Observable.from(['a', 'bb', 'ccc']); - const context = { length: 2 }; - const calls: Array<[string, number, Observable, unknown]> = []; + const length = 2; + const calls: Array<[string, number, Observable]> = []; const values: number[] = []; - source[findIndex](function (value, index, receivedSource) { - calls.push([value, index, receivedSource, this]); - return value.length === this.length; - }, context).subscribe((value) => values.push(value)); + source[findIndex]((value, index, receivedSource) => { + calls.push([value, index, receivedSource]); + return value.length === length; + }).subscribe((value) => values.push(value)); expect(values).toEqual([1]); expect(calls).toEqual([ - ['a', 0, source, context], - ['bb', 1, source, context], + ['a', 0, source], + ['bb', 1, source], ]); }); @@ -92,9 +94,11 @@ describe('findIndex', () => { const predicateErrors: unknown[] = []; const produced: number[] = []; - new Observable((subscriber) => subscriber.error(sourceFailure))[findIndex](() => true).subscribe({ - error: (error) => sourceErrors.push(error), - }); + new Observable((subscriber) => subscriber.error(sourceFailure)) + [findIndex](() => true) + .subscribe({ + error: (error) => sourceErrors.push(error), + }); new Observable((subscriber) => { for (const value of [1, 2, 3]) { if (!subscriber.active) { diff --git a/packages/rxjs/src/find-index.ts b/packages/rxjs/src/find-index.ts index 42c27e95fe..1cbadb8683 100644 --- a/packages/rxjs/src/find-index.ts +++ b/packages/rxjs/src/find-index.ts @@ -6,25 +6,14 @@ export const findIndex: unique symbol = Symbol('findIndex'); declare global { interface Observable { [findIndex]: { - (predicate: (this: A, value: T, index: number, source: Observable) => boolean, thisArg: A): Observable; (predicate: (value: T, index: number, source: Observable) => boolean): Observable; }; } } -function findIndexOperator( - this: Observable, - predicate: (this: A, value: T, index: number, source: Observable) => boolean, - thisArg: A -): Observable; function findIndexOperator( this: Observable, predicate: (value: T, index: number, source: Observable) => boolean -): Observable; -function findIndexOperator( - this: Observable, - predicate: (this: unknown, value: T, index: number, source: Observable) => boolean, - thisArg?: unknown ): Observable { const source = this; @@ -44,7 +33,7 @@ function findIndexOperator( { next: (value) => { const currentIndex = index++; - if (predicate.call(thisArg, value, currentIndex, source)) { + if (predicate(value, currentIndex, source)) { conclude(currentIndex); } }, diff --git a/packages/rxjs/src/find.spec.ts b/packages/rxjs/src/find.spec.ts index 37c15e9ef5..7842991261 100644 --- a/packages/rxjs/src/find.spec.ts +++ b/packages/rxjs/src/find.spec.ts @@ -56,7 +56,9 @@ describe('find', () => { const emptyValues: Array = []; const nonmatchingValues: Array = []; - Observable.from([] as number[])[find](() => true).subscribe((value) => emptyValues.push(value)); + Observable.from([] as number[]) + [find](() => true) + .subscribe((value) => emptyValues.push(value)); Observable.from([1, 2, 3]) [find]((value) => value > 10) .subscribe((value) => nonmatchingValues.push(value)); @@ -65,21 +67,21 @@ describe('find', () => { expect(nonmatchingValues).toEqual([undefined]); }); - it('passes value, index, and the exact source and supports thisArg', () => { + it('passes value, index, and the exact source', () => { const source = Observable.from([2, 4, 6]); - const context = { target: 4 }; - const calls: Array<[number, number, Observable, unknown]> = []; + const target = 4; + const calls: Array<[number, number, Observable]> = []; const values: Array = []; - source[find](function (value, index, receivedSource) { - calls.push([value, index, receivedSource, this]); - return value === this.target; - }, context).subscribe((value) => values.push(value)); + source[find]((value, index, receivedSource) => { + calls.push([value, index, receivedSource]); + return value === target; + }).subscribe((value) => values.push(value)); expect(values).toEqual([4]); expect(calls).toEqual([ - [2, 0, source, context], - [4, 1, source, context], + [2, 0, source], + [4, 1, source], ]); }); @@ -97,9 +99,11 @@ describe('find', () => { const predicateErrors: unknown[] = []; const produced: number[] = []; - new Observable((subscriber) => subscriber.error(sourceFailure))[find](() => true).subscribe({ - error: (error) => sourceErrors.push(error), - }); + new Observable((subscriber) => subscriber.error(sourceFailure)) + [find](() => true) + .subscribe({ + error: (error) => sourceErrors.push(error), + }); new Observable((subscriber) => { for (const value of [1, 2, 3]) { if (!subscriber.active) { diff --git a/packages/rxjs/src/find.ts b/packages/rxjs/src/find.ts index ed2f58ee67..6f69343ab7 100644 --- a/packages/rxjs/src/find.ts +++ b/packages/rxjs/src/find.ts @@ -6,38 +6,23 @@ export const find: unique symbol = Symbol('find'); declare global { interface Observable { [find]: { - (predicate: (this: A, value: T, index: number, source: Observable) => value is S, thisArg: A): Observable< - S | undefined - >; (predicate: (value: T, index: number, source: Observable) => value is S): Observable; - (predicate: (this: A, value: T, index: number, source: Observable) => boolean, thisArg: A): Observable; (predicate: (value: T, index: number, source: Observable) => boolean): Observable; }; } } -function findOperator( - this: Observable, - predicate: (this: A, value: T, index: number, source: Observable) => value is S, - thisArg: A -): Observable; function findOperator( this: Observable, predicate: (value: T, index: number, source: Observable) => value is S ): Observable; -function findOperator( - this: Observable, - predicate: (this: A, value: T, index: number, source: Observable) => boolean, - thisArg: A -): Observable; function findOperator( this: Observable, predicate: (value: T, index: number, source: Observable) => boolean ): Observable; function findOperator( this: Observable, - predicate: (this: unknown, value: T, index: number, source: Observable) => boolean, - thisArg?: unknown + predicate: (value: T, index: number, source: Observable) => boolean ): Observable { const source = this; @@ -56,7 +41,7 @@ function findOperator( subscriber, { next: (value) => { - if (predicate.call(thisArg, value, index++, source)) { + if (predicate(value, index++, source)) { conclude(value); } }, diff --git a/packages/rxjs/src/map.spec.ts b/packages/rxjs/src/map.spec.ts index 5e6bb6cd8f..93a0b13b4a 100644 --- a/packages/rxjs/src/map.spec.ts +++ b/packages/rxjs/src/map.spec.ts @@ -43,20 +43,6 @@ describe('map', () => { expect(results).toEqual(['0:20', '1:40', '2:60', 'complete']); }); - it('supports the RxJS 7 thisArg projection contract', () => { - const context = { offset: 10 }; - const results: number[] = []; - - fromValues(1, 2) - [map](function (this: typeof context, value, index) { - expect(this).toBe(context); - return this.offset + value + index; - }, context) - .subscribe((value) => results.push(value)); - - expect(results).toEqual([11, 13]); - }); - it('does not invoke the projector for an empty source and forwards completion', () => { const project = () => { throw new Error('project should not run'); diff --git a/packages/rxjs/src/map.ts b/packages/rxjs/src/map.ts index 000e67cd95..e25577509a 100644 --- a/packages/rxjs/src/map.ts +++ b/packages/rxjs/src/map.ts @@ -7,24 +7,17 @@ declare global { interface Observable { [map]: { (project: (value: T, index: number) => R): Observable; - (project: (this: A, value: T, index: number) => R, thisArg: A): Observable; }; } } -function mapOperator(this: Observable, project: (value: T, index: number) => R): Observable; -function mapOperator(this: Observable, project: (this: A, value: T, index: number) => R, thisArg: A): Observable; -function mapOperator( - this: Observable, - project: (this: A | undefined, value: T, index: number) => R, - thisArg?: A -): Observable { +function mapOperator(this: Observable, project: (value: T, index: number) => R): Observable { return this[create]((subscriber) => { let index = 0; subscribeToSource(this, subscriber, { next(value) { - subscriber.next(project.call(thisArg, value, index++)); + subscriber.next(project(value, index++)); }, }); }); diff --git a/packages/rxjs/src/partition.spec.ts b/packages/rxjs/src/partition.spec.ts index 1b92772859..4926063d25 100644 --- a/packages/rxjs/src/partition.spec.ts +++ b/packages/rxjs/src/partition.spec.ts @@ -24,15 +24,11 @@ describe('partition', () => { it('splits an ObservableValue and gives each branch an independent index', () => { const calls: Array<[string, number]> = []; - const context = { minimumLength: 2 }; - const [matching, rejected] = Observable[partition]( - ['a', 'bb', 'ccc'], - function (value, index) { - calls.push([value, index]); - return value.length >= this.minimumLength; - }, - context - ); + const minimumLength = 2; + const [matching, rejected] = Observable[partition](['a', 'bb', 'ccc'], (value, index) => { + calls.push([value, index]); + return value.length >= minimumLength; + }); const matchingEvents: Array = []; const rejectedEvents: Array = []; diff --git a/packages/rxjs/src/partition.ts b/packages/rxjs/src/partition.ts index ce90fa7384..1dc1bf027b 100644 --- a/packages/rxjs/src/partition.ts +++ b/packages/rxjs/src/partition.ts @@ -2,15 +2,10 @@ import { create } from './create.js'; import { subscribeToSource } from './util/observable-helpers.js'; interface PartitionMethod { - (source: ObservableValue, predicate: (this: A, value: T, index: number) => value is U, thisArg: A): [ - Observable, - Observable> - ]; (source: ObservableValue, predicate: (value: T, index: number) => value is U): [ Observable, Observable> ]; - (source: ObservableValue, predicate: (this: A, value: T, index: number) => boolean, thisArg: A): [Observable, Observable]; (source: ObservableValue, predicate: (value: T, index: number) => boolean): [Observable, Observable]; } @@ -22,34 +17,17 @@ declare global { } } -function partitionImpl( - this: ObservableCtor, - source: ObservableValue, - predicate: (this: A, value: T, index: number) => value is U, - thisArg: A -): [Observable, Observable>]; function partitionImpl( this: ObservableCtor, source: ObservableValue, predicate: (value: T, index: number) => value is U ): [Observable, Observable>]; -function partitionImpl( - this: ObservableCtor, - source: ObservableValue, - predicate: (this: A, value: T, index: number) => boolean, - thisArg: A -): [Observable, Observable]; function partitionImpl( this: ObservableCtor, source: ObservableValue, predicate: (value: T, index: number) => boolean ): [Observable, Observable]; -function partitionImpl( - this: ObservableCtor, - source: ObservableValue, - predicate: (this: A, value: T, index: number) => boolean, - thisArg?: A -): any { +function partitionImpl(this: ObservableCtor, source: ObservableValue, predicate: (value: T, index: number) => boolean): any { const ObservableCtor = this; const input = ObservableCtor.from(source); @@ -59,7 +37,7 @@ function partitionImpl( subscribeToSource(input, subscriber, { next: (value) => { - if (predicate.call(thisArg as A, value, index++) === matchesBranch) { + if (predicate(value, index++) === matchesBranch) { subscriber.next(value); } }, diff --git a/packages/rxjs/test/kernel/contract.mjs b/packages/rxjs/test/kernel/contract.mjs index d996f30c70..6ee938faec 100644 --- a/packages/rxjs/test/kernel/contract.mjs +++ b/packages/rxjs/test/kernel/contract.mjs @@ -98,13 +98,9 @@ export async function runExtensionKernelContract({ ObservableCtor, platformMap, assert(!Object.hasOwn(ObservableCtor, 'timer'), 'RxJS installed string-named timer'); completeCase('installation and platform overlap'); - const context = { offset: 10 }; - const mapped = await collect( - fromValues(1, 2, 3)[symbols.map](function (value, index) { - return this.offset + value + index; - }, context) - ); - assertDeepEqual(mapped, [11, 13, 15], 'RxJS map index/thisArg behavior changed'); + const offset = 10; + const mapped = await collect(fromValues(1, 2, 3)[symbols.map]((value, index) => offset + value + index)); + assertDeepEqual(mapped, [11, 13, 15], 'RxJS map index behavior changed'); const scanned = await collect(fromValues(1, 2, 3)[symbols.scan]((total, value) => total + value, 0)); assertDeepEqual(scanned, [1, 3, 6], 'RxJS scan behavior changed'); completeCase('map and scan semantics'); diff --git a/packages/rxjs/test/ported/capability-registry.json b/packages/rxjs/test/ported/capability-registry.json index 62ba39839b..b46ec3652a 100644 --- a/packages/rxjs/test/ported/capability-registry.json +++ b/packages/rxjs/test/ported/capability-registry.json @@ -229,7 +229,7 @@ "symbol": "every", "module": "every", "adapter": "identity", - "mapping": "source[every](predicate, thisArg?)", + "mapping": "source[every](predicate)", "status": "Present; parity unverified", "note": "Evaluates value, index, and source and cancels upstream before emitting the first false result." }, @@ -285,25 +285,25 @@ "symbol": "filter", "module": "filter", "adapter": "identity", - "mapping": "source[filter](predicate, thisArg?)", + "mapping": "source[filter](predicate)", "status": "Present; parity unverified", - "note": "The RxJS Symbol form preserves predicate index, thisArg, type guards, errors, and cancellation without replacing the platform string method." + "note": "The RxJS Symbol form preserves predicate index, type guards, errors, and cancellation without replacing the platform string method; callback receivers must use closures or Function.prototype.bind." }, "find": { "symbol": "find", "module": "find", "adapter": "identity", - "mapping": "source[find](predicate, thisArg?)", + "mapping": "source[find](predicate)", "status": "Present; parity unverified", - "note": "Emits the first matching value or undefined with predicate index, source identity, thisArg, early cancellation, and no replacement of the platform find() Promise consumer." + "note": "Emits the first matching value or undefined with predicate index, source identity, and early cancellation, without replacing the platform find() Promise consumer; callback receivers must use closures or Function.prototype.bind." }, "findIndex": { "symbol": "findIndex", "module": "find-index", "adapter": "identity", - "mapping": "source[findIndex](predicate, thisArg?)", + "mapping": "source[findIndex](predicate)", "status": "Present; parity unverified", - "note": "Emits the first matching index or -1 with predicate source identity, thisArg, errors, and early cancellation." + "note": "Emits the first matching index or -1 with predicate source identity, errors, and early cancellation; callback receivers must use closures or Function.prototype.bind." }, "flatMap": { "symbol": "mergeMap", @@ -357,9 +357,9 @@ "symbol": "map", "module": "map", "adapter": "identity", - "mapping": "source[map](project, thisArg?)", + "mapping": "source[map](project)", "status": "Present; parity unverified", - "note": "The RxJS Symbol form preserves projection index, thisArg, errors, and cancellation without replacing the platform string method." + "note": "The RxJS Symbol form preserves projection index, errors, and cancellation without replacing the platform string method; callback receivers must use closures or Function.prototype.bind." }, "mapTo": { "symbol": "mergeMap", @@ -1028,7 +1028,7 @@ "symbol": "partition", "module": "partition", "adapter": "identity", - "mapping": "Observable[partition](source, predicate, thisArg?)", + "mapping": "Observable[partition](source, predicate)", "status": "Present; parity unverified", "note": "Returns matching and rejected branches with independent predicate state over the platform source's shared, ref-counted activation." }, diff --git a/packages/rxjs/test/ported/cold/observables/partition.spec.ts b/packages/rxjs/test/ported/cold/observables/partition.spec.ts index 15fb60e0b9..411907fff9 100644 --- a/packages/rxjs/test/ported/cold/observables/partition.spec.ts +++ b/packages/rxjs/test/ported/cold/observables/partition.spec.ts @@ -64,7 +64,7 @@ describe('partition (cold)', () => { expectSubscriptions(e1.subscriptions).toBe([e1subs, e1subs]); }); }); - it('should partition an observable into two using a predicate and thisArg', async () => { + it('should partition an observable into two using a bound predicate', async () => { await rxTest(({ hot, expectSubscriptions, expectObservable }) => { const e1 = hot(' --a-b---a------d--a---c--|'); const e1subs = ' ^------------------------!'; @@ -80,7 +80,7 @@ describe('partition (cold)', () => { for (let index_1 = 0; index_1 < result_1.length; index_1++) { expectObservable(result_1[index_1]).toBe(expected_1[index_1]); } - })(ColdObservable[partition](e1, predicate, { value: 'a' }), expected); + })(ColdObservable[partition](e1, predicate.bind({ value: 'a' })), expected); expectSubscriptions(e1.subscriptions).toBe([e1subs, e1subs]); }); }); diff --git a/packages/rxjs/test/ported/cold/operators/filter.spec.ts b/packages/rxjs/test/ported/cold/operators/filter.spec.ts index 16ecc75568..e66c66de1b 100644 --- a/packages/rxjs/test/ported/cold/operators/filter.spec.ts +++ b/packages/rxjs/test/ported/cold/operators/filter.spec.ts @@ -364,7 +364,7 @@ describe('filter (cold)', () => { expectSubscriptions(e1.subscriptions).toBe(e1subs); }); }); - it('should be able to accept and use a thisArg', async () => { + it('should be able to use closed-over predicates', async () => { function oddFilter(x) { return +x % 2 === 1; } @@ -389,15 +389,7 @@ describe('filter (cold)', () => { filter2 = (x) => +x % 3 === 0; } const filterer = new Filterer(); - const result = e1[filter](function (x) { - return this.filter1(x); - }, filterer) - [filter](function (x) { - return this.filter2(x); - }, filterer) - [filter](function (x) { - return this.filter1(x); - }, filterer); + const result = e1[filter](filterer.filter1)[filter](filterer.filter2)[filter](filterer.filter1); expectObservable(result).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); }); diff --git a/packages/rxjs/test/ported/cold/operators/find-index.spec.ts b/packages/rxjs/test/ported/cold/operators/find-index.spec.ts index c84b7edff1..b12bceb589 100644 --- a/packages/rxjs/test/ported/cold/operators/find-index.spec.ts +++ b/packages/rxjs/test/ported/cold/operators/find-index.spec.ts @@ -78,7 +78,7 @@ describe('findIndex (cold)', () => { expectSubscriptions(e1.subscriptions).toBe(e1subs); }); }); - it('should work with a custom thisArg', async () => { + it('should work with a bound predicate', async () => { function truePredicate(x) { return true; } @@ -90,7 +90,7 @@ describe('findIndex (cold)', () => { const predicate = function (value) { return value === this.b; }; - const result = e1[findIndex](predicate, sourceValues); + const result = e1[findIndex](predicate.bind(sourceValues)); expectObservable(result).toBe(expected, { x: 1 }); expectSubscriptions(e1.subscriptions).toBe(e1subs); }); diff --git a/packages/rxjs/test/ported/cold/operators/find.spec.ts b/packages/rxjs/test/ported/cold/operators/find.spec.ts index d031a5c432..39cdade792 100644 --- a/packages/rxjs/test/ported/cold/operators/find.spec.ts +++ b/packages/rxjs/test/ported/cold/operators/find.spec.ts @@ -78,7 +78,7 @@ describe('find (cold)', () => { expectSubscriptions(e1.subscriptions).toBe(e1subs); }); }); - it('should work with a custom thisArg', async () => { + it('should work with a bound predicate', async () => { function truePredicate(x) { return true; } @@ -92,7 +92,7 @@ describe('find (cold)', () => { const predicate = function (value) { return value === this.target; }; - expectObservable(e1[find](predicate, finder)).toBe(expected); + expectObservable(e1[find](predicate.bind(finder))).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); }); }); diff --git a/packages/rxjs/test/ported/cold/operators/map.spec.ts b/packages/rxjs/test/ported/cold/operators/map.spec.ts index 8b934a2d91..13ee2a108c 100644 --- a/packages/rxjs/test/ported/cold/operators/map.spec.ts +++ b/packages/rxjs/test/ported/cold/operators/map.spec.ts @@ -170,7 +170,7 @@ describe('map (cold)', () => { expectSubscriptions(e1.subscriptions).toBe(e1subs); }); }); - it('should map using a custom thisArg', async () => { + it('should map using a bound projector', async () => { const addDrama = (x) => x + '!'; await rxTest(({ hot, expectObservable, expectSubscriptions }) => { const e1 = hot('-5-^-4--3---2----1--|'); @@ -180,10 +180,12 @@ describe('map (cold)', () => { const foo = { value: 42, }; - const result = e1[map](function (x, index) { - expect(this).toBe(foo); - return parseInt(x) + foo.value + index * 10; - }, foo); + const result = e1[map]( + function (x, index) { + expect(this).toBe(foo); + return parseInt(x) + foo.value + index * 10; + }.bind(foo) + ); expectObservable(result).toBe(expected, values); expectSubscriptions(e1.subscriptions).toBe(e1subs); }); @@ -215,7 +217,7 @@ describe('map (cold)', () => { expectSubscriptions(e1.subscriptions).toBe(e1subs); }); }); - it('should do multiple maps using a custom thisArg', async () => { + it('should do multiple maps using closed-over projectors', async () => { const addDrama = (x) => x + '!'; await rxTest(({ hot, expectObservable, expectSubscriptions }) => { const e1 = hot(' --1--2--3--4--|'); @@ -227,15 +229,7 @@ describe('map (cold)', () => { selector2 = (x) => parseInt(x) * 3; } const filterer = new Filterer(); - const result = e1[map](function (x) { - return this.selector1(x); - }, filterer) - [map](function (x) { - return this.selector2(x); - }, filterer) - [map](function (x) { - return this.selector1(x); - }, filterer); + const result = e1[map](filterer.selector1)[map](filterer.selector2)[map](filterer.selector1); expectObservable(result).toBe(expected, values); expectSubscriptions(e1.subscriptions).toBe(e1subs); }); diff --git a/packages/rxjs/test/ported/manifest.generated.json b/packages/rxjs/test/ported/manifest.generated.json index 0f00c2df3e..e7742d0a10 100644 --- a/packages/rxjs/test/ported/manifest.generated.json +++ b/packages/rxjs/test/ported/manifest.generated.json @@ -13741,14 +13741,14 @@ "title": "should partition an observable into two using a predicate and thisArg" }, "behavioralClaim": "should partition an observable into two using a predicate and thisArg", - "classification": "portable", + "classification": "intentional-divergence", "disposition": "active", "modes": [ "cold", "polyfill", "native" ], - "reason": "Mechanically migrated and verified against the ColdObservable mode.", + "reason": "Intentional RxJS Next divergence: the callback receiver argument is removed; the active migrated spec binds the predicate explicitly.", "duplicateOf": null, "imports": [ { @@ -13763,7 +13763,7 @@ "expectSubscriptions" ], "reviewFlags": [], - "migratedProgram": "async function migrated(runtime) {\nconst { rxTest, applyOperators, partition } = runtime;\n const __subscriptionFrame = (marbles, marker, parseTime) => {\n const markerIndex = marbles.indexOf(marker);\n if (markerIndex < 0)\n return Infinity;\n const prefix = marbles.slice(0, markerIndex).replace(/[!^]/g, '-');\n return parseTime(prefix + '|');\n };\n await rxTest(async ({ hot, expectSubscriptions, cold: __rxCold, hot: __rxHot, time: __rxTime, expectObservable, flush: __rxFlush, now: __rxNow, schedule: __rxSchedule }) => {\n const e1 = hot(' --a-b---a------d--a---c--|');\n const e1subs = ' ^------------------------!';\n // prettier-ignore\n const expected = [\n ' --a-----a---------a------|',\n ' ----b----------d------c--|',\n ];\n function predicate(x) {\n return x === this.value;\n }\n ((result_1, expected_1) => {\n for (let index_1 = 0; index_1 < result_1.length; index_1++) {\n expectObservable(result_1[index_1]).toBe(expected_1[index_1]);\n }\n })(partition(e1, predicate, { value: 'a' }), expected);\n expectSubscriptions(e1.subscriptions).toBe([e1subs, e1subs]);\n });\n}\n", + "migratedProgram": "async function migrated(runtime) {\nconst { rxTest, applyOperators, partition } = runtime;\n const __subscriptionFrame = (marbles, marker, parseTime) => {\n const markerIndex = marbles.indexOf(marker);\n if (markerIndex < 0)\n return Infinity;\n const prefix = marbles.slice(0, markerIndex).replace(/[!^]/g, '-');\n return parseTime(prefix + '|');\n };\n await rxTest(async ({ hot, expectSubscriptions, cold: __rxCold, hot: __rxHot, time: __rxTime, expectObservable, flush: __rxFlush, now: __rxNow, schedule: __rxSchedule }) => {\n const e1 = hot(' --a-b---a------d--a---c--|');\n const e1subs = ' ^------------------------!';\n // prettier-ignore\n const expected = [\n ' --a-----a---------a------|',\n ' ----b----------d------c--|',\n ];\n function predicate(x) {\n return x === this.value;\n }\n ((result_1, expected_1) => {\n for (let index_1 = 0; index_1 < result_1.length; index_1++) {\n expectObservable(result_1[index_1]).toBe(expected_1[index_1]);\n }\n })(partition(e1, predicate.bind({ value: 'a' })), expected);\n expectSubscriptions(e1.subscriptions).toBe([e1subs, e1subs]);\n });\n}\n", "originalSource": "it('should partition an observable into two using a predicate and thisArg', () => {\n rxTestScheduler.run(({ hot, expectSubscriptions }) => {\n const e1 = hot(' --a-b---a------d--a---c--|');\n const e1subs = ' ^------------------------!';\n // prettier-ignore\n const expected = [\n ' --a-----a---------a------|',\n ' ----b----------d------c--|',\n ];\n\n function predicate(this: any, x: string) {\n return x === this.value;\n }\n\n expectObservableArray(partition(e1, predicate, { value: 'a' }), expected);\n expectSubscriptions(e1.subscriptions).toBe([e1subs, e1subs]);\n });\n })" }, { @@ -43938,14 +43938,14 @@ "title": "should be able to accept and use a thisArg" }, "behavioralClaim": "should be able to accept and use a thisArg", - "classification": "portable", + "classification": "intentional-divergence", "disposition": "active", "modes": [ "cold", "polyfill", "native" ], - "reason": "Mechanically migrated and verified against the ColdObservable mode.", + "reason": "Intentional RxJS Next divergence: the callback receiver argument is removed; the active migrated spec uses closed-over predicates.", "duplicateOf": null, "imports": [ { @@ -43961,7 +43961,7 @@ "expectSubscriptions" ], "reviewFlags": [], - "migratedProgram": "async function migrated(runtime) {\nconst { rxTest, applyOperators, filter } = runtime;\n const __subscriptionFrame = (marbles, marker, parseTime) => {\n const markerIndex = marbles.indexOf(marker);\n if (markerIndex < 0)\n return Infinity;\n const prefix = marbles.slice(0, markerIndex).replace(/[!^]/g, '-');\n return parseTime(prefix + '|');\n };\n function oddFilter(x) {\n return +x % 2 === 1;\n }\n function isPrime(i) {\n if (+i <= 1) {\n return false;\n }\n const max = Math.floor(Math.sqrt(+i));\n for (let j = 2; j <= max; ++j) {\n if (+i % j === 0) {\n return false;\n }\n }\n return true;\n }\n await rxTest(async ({ hot, expectObservable, expectSubscriptions, cold: __rxCold, hot: __rxHot, time: __rxTime, flush: __rxFlush, now: __rxNow, schedule: __rxSchedule }) => {\n const e1 = hot('-1--2--^-3-4-5-6--7-8--9--|');\n const e1subs = ' ^------------------!';\n const expected = ' --------6----------|';\n class Filterer {\n filter1 = (x) => +x % 2 === 0;\n filter2 = (x) => +x % 3 === 0;\n }\n const filterer = new Filterer();\n const result = applyOperators(e1, [filter(function (x) {\n return this.filter1(x);\n }, filterer),\n filter(function (x) {\n return this.filter2(x);\n }, filterer),\n filter(function (x) {\n return this.filter1(x);\n }, filterer)]);\n expectObservable(result).toBe(expected);\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n}\n", + "migratedProgram": "async function migrated(runtime) {\nconst { rxTest, applyOperators, filter } = runtime;\n const __subscriptionFrame = (marbles, marker, parseTime) => {\n const markerIndex = marbles.indexOf(marker);\n if (markerIndex < 0)\n return Infinity;\n const prefix = marbles.slice(0, markerIndex).replace(/[!^]/g, '-');\n return parseTime(prefix + '|');\n };\n function oddFilter(x) {\n return +x % 2 === 1;\n }\n function isPrime(i) {\n if (+i <= 1) {\n return false;\n }\n const max = Math.floor(Math.sqrt(+i));\n for (let j = 2; j <= max; ++j) {\n if (+i % j === 0) {\n return false;\n }\n }\n return true;\n }\n await rxTest(async ({ hot, expectObservable, expectSubscriptions, cold: __rxCold, hot: __rxHot, time: __rxTime, flush: __rxFlush, now: __rxNow, schedule: __rxSchedule }) => {\n const e1 = hot('-1--2--^-3-4-5-6--7-8--9--|');\n const e1subs = ' ^------------------!';\n const expected = ' --------6----------|';\n class Filterer {\n filter1 = (x) => +x % 2 === 0;\n filter2 = (x) => +x % 3 === 0;\n }\n const filterer = new Filterer();\n const result = applyOperators(e1, [filter(function (x) {\n return this.filter1(x);\n }.bind(filterer)),\n filter(function (x) {\n return this.filter2(x);\n }.bind(filterer)),\n filter(function (x) {\n return this.filter1(x);\n }.bind(filterer))]);\n expectObservable(result).toBe(expected);\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n}\n", "originalSource": "it('should be able to accept and use a thisArg', () => {\n testScheduler.run(({ hot, expectObservable, expectSubscriptions }) => {\n const e1 = hot('-1--2--^-3-4-5-6--7-8--9--|');\n const e1subs = ' ^------------------!';\n const expected = ' --------6----------|';\n\n class Filterer {\n filter1 = (x: string) => +x % 2 === 0;\n filter2 = (x: string) => +x % 3 === 0;\n }\n\n const filterer = new Filterer();\n\n const result = e1.pipe(\n filter(function (this: any, x) {\n return this.filter1(x);\n }, filterer),\n filter(function (this: any, x) {\n return this.filter2(x);\n }, filterer),\n filter(function (this: any, x) {\n return this.filter1(x);\n }, filterer)\n );\n\n expectObservable(result).toBe(expected);\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n })" }, { @@ -44890,14 +44890,14 @@ "title": "should work with a custom thisArg" }, "behavioralClaim": "should work with a custom thisArg", - "classification": "portable", + "classification": "intentional-divergence", "disposition": "active", "modes": [ "cold", "polyfill", "native" ], - "reason": "Mechanically migrated and verified against the ColdObservable mode.", + "reason": "Intentional RxJS Next divergence: the callback receiver argument is removed; the active migrated spec binds the predicate explicitly.", "duplicateOf": null, "imports": [ { @@ -44913,7 +44913,7 @@ "expectSubscriptions" ], "reviewFlags": [], - "migratedProgram": "async function migrated(runtime) {\nconst { rxTest, applyOperators, find } = runtime;\n const __subscriptionFrame = (marbles, marker, parseTime) => {\n const markerIndex = marbles.indexOf(marker);\n if (markerIndex < 0)\n return Infinity;\n const prefix = marbles.slice(0, markerIndex).replace(/[!^]/g, '-');\n return parseTime(prefix + '|');\n };\n function truePredicate(x) {\n return true;\n }\n await rxTest(async ({ hot, expectObservable, expectSubscriptions, cold: __rxCold, hot: __rxHot, time: __rxTime, flush: __rxFlush, now: __rxNow, schedule: __rxSchedule }) => {\n const e1 = hot(' --a--b---c-|');\n const e1subs = ' ^----! ';\n const expected = '-----(b|) ';\n const finder = {\n target: 'b',\n };\n const predicate = function (value) {\n return value === this.target;\n };\n expectObservable(applyOperators(e1, [find(predicate, finder)])).toBe(expected);\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n}\n", + "migratedProgram": "async function migrated(runtime) {\nconst { rxTest, applyOperators, find } = runtime;\n const __subscriptionFrame = (marbles, marker, parseTime) => {\n const markerIndex = marbles.indexOf(marker);\n if (markerIndex < 0)\n return Infinity;\n const prefix = marbles.slice(0, markerIndex).replace(/[!^]/g, '-');\n return parseTime(prefix + '|');\n };\n function truePredicate(x) {\n return true;\n }\n await rxTest(async ({ hot, expectObservable, expectSubscriptions, cold: __rxCold, hot: __rxHot, time: __rxTime, flush: __rxFlush, now: __rxNow, schedule: __rxSchedule }) => {\n const e1 = hot(' --a--b---c-|');\n const e1subs = ' ^----! ';\n const expected = '-----(b|) ';\n const finder = {\n target: 'b',\n };\n const predicate = function (value) {\n return value === this.target;\n };\n expectObservable(applyOperators(e1, [find(predicate.bind(finder))])).toBe(expected);\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n}\n", "originalSource": "it('should work with a custom thisArg', () => {\n testScheduler.run(({ hot, expectObservable, expectSubscriptions }) => {\n const e1 = hot(' --a--b---c-|');\n const e1subs = ' ^----! ';\n const expected = '-----(b|) ';\n\n const finder = {\n target: 'b',\n };\n const predicate = function (this: typeof finder, value: string) {\n return value === this.target;\n };\n\n expectObservable(e1.pipe(find(predicate, finder))).toBe(expected);\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n })" }, { @@ -45377,14 +45377,14 @@ "title": "should work with a custom thisArg" }, "behavioralClaim": "should work with a custom thisArg", - "classification": "portable", + "classification": "intentional-divergence", "disposition": "active", "modes": [ "cold", "polyfill", "native" ], - "reason": "Mechanically migrated and verified against the ColdObservable mode.", + "reason": "Intentional RxJS Next divergence: the callback receiver argument is removed; the active migrated spec binds the predicate explicitly.", "duplicateOf": null, "imports": [ { @@ -45400,7 +45400,7 @@ "expectSubscriptions" ], "reviewFlags": [], - "migratedProgram": "async function migrated(runtime) {\nconst { rxTest, applyOperators, findIndex } = runtime;\n const __subscriptionFrame = (marbles, marker, parseTime) => {\n const markerIndex = marbles.indexOf(marker);\n if (markerIndex < 0)\n return Infinity;\n const prefix = marbles.slice(0, markerIndex).replace(/[!^]/g, '-');\n return parseTime(prefix + '|');\n };\n function truePredicate(x) {\n return true;\n }\n await rxTest(async ({ hot, expectObservable, expectSubscriptions, cold: __rxCold, hot: __rxHot, time: __rxTime, flush: __rxFlush, now: __rxNow, schedule: __rxSchedule }) => {\n const sourceValues = { b: 7 };\n const e1 = hot(' --a--b---c-|', sourceValues);\n const e1subs = ' ^----! ';\n const expected = '-----(x|) ';\n const predicate = function (value) {\n return value === this.b;\n };\n const result = applyOperators(e1, [findIndex(predicate, sourceValues)]);\n expectObservable(result).toBe(expected, { x: 1 });\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n}\n", + "migratedProgram": "async function migrated(runtime) {\nconst { rxTest, applyOperators, findIndex } = runtime;\n const __subscriptionFrame = (marbles, marker, parseTime) => {\n const markerIndex = marbles.indexOf(marker);\n if (markerIndex < 0)\n return Infinity;\n const prefix = marbles.slice(0, markerIndex).replace(/[!^]/g, '-');\n return parseTime(prefix + '|');\n };\n function truePredicate(x) {\n return true;\n }\n await rxTest(async ({ hot, expectObservable, expectSubscriptions, cold: __rxCold, hot: __rxHot, time: __rxTime, flush: __rxFlush, now: __rxNow, schedule: __rxSchedule }) => {\n const sourceValues = { b: 7 };\n const e1 = hot(' --a--b---c-|', sourceValues);\n const e1subs = ' ^----! ';\n const expected = '-----(x|) ';\n const predicate = function (value) {\n return value === this.b;\n };\n const result = applyOperators(e1, [findIndex(predicate.bind(sourceValues))]);\n expectObservable(result).toBe(expected, { x: 1 });\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n}\n", "originalSource": "it('should work with a custom thisArg', () => {\n testScheduler.run(({ hot, expectObservable, expectSubscriptions }) => {\n const sourceValues = { b: 7 };\n const e1 = hot(' --a--b---c-|', sourceValues);\n const e1subs = ' ^----! ';\n const expected = '-----(x|) ';\n\n const predicate = function (this: typeof sourceValues, value: number) {\n return value === this.b;\n };\n const result = e1.pipe(findIndex(predicate, sourceValues));\n\n expectObservable(result).toBe(expected, { x: 1 });\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n })" }, { @@ -49615,14 +49615,14 @@ "title": "should map using a custom thisArg" }, "behavioralClaim": "should map using a custom thisArg", - "classification": "portable", + "classification": "intentional-divergence", "disposition": "active", "modes": [ "cold", "polyfill", "native" ], - "reason": "Mechanically migrated and verified against the ColdObservable mode.", + "reason": "Intentional RxJS Next divergence: the callback receiver argument is removed; the active migrated spec binds the projector explicitly.", "duplicateOf": null, "imports": [ { @@ -49644,7 +49644,7 @@ "expectSubscriptions" ], "reviewFlags": [], - "migratedProgram": "async function migrated(runtime) {\nconst { rxTest, applyOperators, expect, map } = runtime;\n const __subscriptionFrame = (marbles, marker, parseTime) => {\n const markerIndex = marbles.indexOf(marker);\n if (markerIndex < 0)\n return Infinity;\n const prefix = marbles.slice(0, markerIndex).replace(/[!^]/g, '-');\n return parseTime(prefix + '|');\n };\n const addDrama = (x) => x + '!';\n await rxTest(async ({ hot, expectObservable, expectSubscriptions, cold: __rxCold, hot: __rxHot, time: __rxTime, flush: __rxFlush, now: __rxNow, schedule: __rxSchedule }) => {\n const e1 = hot('-5-^-4--3---2----1--|');\n const e1subs = ' ^----------------!';\n const expected = ' --a--b---c----d--|';\n const values = { a: 46, b: 55, c: 64, d: 73 };\n const foo = {\n value: 42,\n };\n const result = applyOperators(e1, [map(function (x, index) {\n expect(this).to.equal(foo);\n return parseInt(x) + foo.value + index * 10;\n }, foo)]);\n expectObservable(result).toBe(expected, values);\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n}\n", + "migratedProgram": "async function migrated(runtime) {\nconst { rxTest, applyOperators, expect, map } = runtime;\n const __subscriptionFrame = (marbles, marker, parseTime) => {\n const markerIndex = marbles.indexOf(marker);\n if (markerIndex < 0)\n return Infinity;\n const prefix = marbles.slice(0, markerIndex).replace(/[!^]/g, '-');\n return parseTime(prefix + '|');\n };\n const addDrama = (x) => x + '!';\n await rxTest(async ({ hot, expectObservable, expectSubscriptions, cold: __rxCold, hot: __rxHot, time: __rxTime, flush: __rxFlush, now: __rxNow, schedule: __rxSchedule }) => {\n const e1 = hot('-5-^-4--3---2----1--|');\n const e1subs = ' ^----------------!';\n const expected = ' --a--b---c----d--|';\n const values = { a: 46, b: 55, c: 64, d: 73 };\n const foo = {\n value: 42,\n };\n const result = applyOperators(e1, [map(function (x, index) {\n expect(this).to.equal(foo);\n return parseInt(x) + foo.value + index * 10;\n }.bind(foo))]);\n expectObservable(result).toBe(expected, values);\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n}\n", "originalSource": "it('should map using a custom thisArg', () => {\n testScheduler.run(({ hot, expectObservable, expectSubscriptions }) => {\n const e1 = hot('-5-^-4--3---2----1--|');\n const e1subs = ' ^----------------!';\n const expected = ' --a--b---c----d--|';\n const values = { a: 46, b: 55, c: 64, d: 73 };\n\n const foo = {\n value: 42,\n };\n const result = e1.pipe(\n map(function (this: typeof foo, x: string, index: number) {\n expect(this).to.equal(foo);\n return parseInt(x) + foo.value + index * 10;\n }, foo)\n );\n\n expectObservable(result).toBe(expected, values);\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n })" }, { @@ -49711,14 +49711,14 @@ "title": "should do multiple maps using a custom thisArg" }, "behavioralClaim": "should do multiple maps using a custom thisArg", - "classification": "portable", + "classification": "intentional-divergence", "disposition": "active", "modes": [ "cold", "polyfill", "native" ], - "reason": "Mechanically migrated and verified against the ColdObservable mode.", + "reason": "Intentional RxJS Next divergence: the callback receiver argument is removed; the active migrated spec uses closed-over projectors.", "duplicateOf": null, "imports": [ { @@ -49734,7 +49734,7 @@ "expectSubscriptions" ], "reviewFlags": [], - "migratedProgram": "async function migrated(runtime) {\nconst { rxTest, applyOperators, map } = runtime;\n const __subscriptionFrame = (marbles, marker, parseTime) => {\n const markerIndex = marbles.indexOf(marker);\n if (markerIndex < 0)\n return Infinity;\n const prefix = marbles.slice(0, markerIndex).replace(/[!^]/g, '-');\n return parseTime(prefix + '|');\n };\n const addDrama = (x) => x + '!';\n await rxTest(async ({ hot, expectObservable, expectSubscriptions, cold: __rxCold, hot: __rxHot, time: __rxTime, flush: __rxFlush, now: __rxNow, schedule: __rxSchedule }) => {\n const e1 = hot(' --1--2--3--4--|');\n const e1subs = ' ^-------------!';\n const expected = '--a--b--c--d--|';\n const values = { a: 11, b: 14, c: 17, d: 20 };\n class Filterer {\n selector1 = (x) => parseInt(x) + 2;\n selector2 = (x) => parseInt(x) * 3;\n }\n const filterer = new Filterer();\n const result = applyOperators(e1, [map(function (x) {\n return this.selector1(x);\n }, filterer),\n map(function (x) {\n return this.selector2(x);\n }, filterer),\n map(function (x) {\n return this.selector1(x);\n }, filterer)]);\n expectObservable(result).toBe(expected, values);\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n}\n", + "migratedProgram": "async function migrated(runtime) {\nconst { rxTest, applyOperators, map } = runtime;\n const __subscriptionFrame = (marbles, marker, parseTime) => {\n const markerIndex = marbles.indexOf(marker);\n if (markerIndex < 0)\n return Infinity;\n const prefix = marbles.slice(0, markerIndex).replace(/[!^]/g, '-');\n return parseTime(prefix + '|');\n };\n const addDrama = (x) => x + '!';\n await rxTest(async ({ hot, expectObservable, expectSubscriptions, cold: __rxCold, hot: __rxHot, time: __rxTime, flush: __rxFlush, now: __rxNow, schedule: __rxSchedule }) => {\n const e1 = hot(' --1--2--3--4--|');\n const e1subs = ' ^-------------!';\n const expected = '--a--b--c--d--|';\n const values = { a: 11, b: 14, c: 17, d: 20 };\n class Filterer {\n selector1 = (x) => parseInt(x) + 2;\n selector2 = (x) => parseInt(x) * 3;\n }\n const filterer = new Filterer();\n const result = applyOperators(e1, [map(function (x) {\n return this.selector1(x);\n }.bind(filterer)),\n map(function (x) {\n return this.selector2(x);\n }.bind(filterer)),\n map(function (x) {\n return this.selector1(x);\n }.bind(filterer))]);\n expectObservable(result).toBe(expected, values);\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n}\n", "originalSource": "it('should do multiple maps using a custom thisArg', () => {\n testScheduler.run(({ hot, expectObservable, expectSubscriptions }) => {\n const e1 = hot(' --1--2--3--4--|');\n const e1subs = ' ^-------------!';\n const expected = '--a--b--c--d--|';\n const values = { a: 11, b: 14, c: 17, d: 20 };\n\n class Filterer {\n selector1 = (x: string) => parseInt(x) + 2;\n selector2 = (x: string) => parseInt(x) * 3;\n }\n const filterer = new Filterer();\n\n const result = e1.pipe(\n map(function (this: any, x) {\n return this.selector1(x);\n }, filterer),\n map(function (this: any, x) {\n return this.selector2(x);\n }, filterer),\n map(function (this: any, x) {\n return this.selector1(x);\n }, filterer)\n );\n\n expectObservable(result).toBe(expected, values);\n expectSubscriptions(e1.subscriptions).toBe(e1subs);\n });\n })" }, { diff --git a/packages/rxjs/test/ported/migration-evidence-ledger.generated.json b/packages/rxjs/test/ported/migration-evidence-ledger.generated.json index 5afff51664..3087ac2731 100644 --- a/packages/rxjs/test/ported/migration-evidence-ledger.generated.json +++ b/packages/rxjs/test/ported/migration-evidence-ledger.generated.json @@ -1872,6 +1872,7 @@ "localEvidence": [], "testClassifications": [ "harness-rewrite", + "intentional-divergence", "portable" ], "modeResults": { @@ -1892,7 +1893,7 @@ "next": { "surface": "static-symbol", "module": "partition", - "mapping": "Observable[partition](source, predicate, thisArg?)", + "mapping": "Observable[partition](source, predicate)", "status": "Present; parity unverified", "sharingModel": "shared-active-platform", "cancellationModel": "AbortSignal", @@ -4592,7 +4593,7 @@ "next": { "surface": "instance-symbol", "module": "every", - "mapping": "source[every](predicate, thisArg?)", + "mapping": "source[every](predicate)", "status": "Present; parity unverified", "sharingModel": "shared-active-platform", "cancellationModel": "AbortSignal", @@ -4938,6 +4939,7 @@ ], "localEvidence": [], "testClassifications": [ + "intentional-divergence", "portable" ], "modeResults": { @@ -4958,7 +4960,7 @@ "next": { "surface": "instance-symbol", "module": "filter", - "mapping": "source[filter](predicate, thisArg?)", + "mapping": "source[filter](predicate)", "status": "Present; parity unverified", "sharingModel": "shared-active-platform", "cancellationModel": "AbortSignal", @@ -4968,7 +4970,7 @@ "action": "mechanical-change", "semanticReviewRequired": true, "adapter": "identity", - "note": "The RxJS Symbol form preserves predicate index, thisArg, type guards, errors, and cancellation without replacing the platform string method." + "note": "The RxJS Symbol form preserves predicate index, type guards, errors, and cancellation without replacing the platform string method; callback receivers must use closures or Function.prototype.bind." }, "decisions": [ "D-003", @@ -5069,6 +5071,7 @@ ], "localEvidence": [], "testClassifications": [ + "intentional-divergence", "portable" ], "modeResults": { @@ -5089,7 +5092,7 @@ "next": { "surface": "instance-symbol", "module": "find", - "mapping": "source[find](predicate, thisArg?)", + "mapping": "source[find](predicate)", "status": "Present; parity unverified", "sharingModel": "shared-active-platform", "cancellationModel": "AbortSignal", @@ -5099,7 +5102,7 @@ "action": "mechanical-change", "semanticReviewRequired": true, "adapter": "identity", - "note": "Emits the first matching value or undefined with predicate index, source identity, thisArg, early cancellation, and no replacement of the platform find() Promise consumer." + "note": "Emits the first matching value or undefined with predicate index, source identity, and early cancellation, without replacing the platform find() Promise consumer; callback receivers must use closures or Function.prototype.bind." }, "decisions": [ "D-003", @@ -5136,6 +5139,7 @@ ], "localEvidence": [], "testClassifications": [ + "intentional-divergence", "portable" ], "modeResults": { @@ -5156,7 +5160,7 @@ "next": { "surface": "instance-symbol", "module": "find-index", - "mapping": "source[findIndex](predicate, thisArg?)", + "mapping": "source[findIndex](predicate)", "status": "Present; parity unverified", "sharingModel": "shared-active-platform", "cancellationModel": "AbortSignal", @@ -5166,7 +5170,7 @@ "action": "mechanical-change", "semanticReviewRequired": true, "adapter": "identity", - "note": "Emits the first matching index or -1 with predicate source identity, thisArg, errors, and early cancellation." + "note": "Emits the first matching index or -1 with predicate source identity, errors, and early cancellation; callback receivers must use closures or Function.prototype.bind." }, "decisions": [ "D-003", @@ -6010,7 +6014,7 @@ "next": { "surface": "instance-symbol", "module": "map", - "mapping": "source[map](project, thisArg?)", + "mapping": "source[map](project)", "status": "Present; parity unverified", "sharingModel": "shared-active-platform", "cancellationModel": "AbortSignal", @@ -6020,7 +6024,7 @@ "action": "mechanical-change", "semanticReviewRequired": true, "adapter": "identity", - "note": "The RxJS Symbol form preserves projection index, thisArg, errors, and cancellation without replacing the platform string method." + "note": "The RxJS Symbol form preserves projection index, errors, and cancellation without replacing the platform string method; callback receivers must use closures or Function.prototype.bind." }, "decisions": [ "D-003", diff --git a/packages/rxjs/test/ported/platform/observables/partition.spec.ts b/packages/rxjs/test/ported/platform/observables/partition.spec.ts index c5967f7bdc..e6ac43e7b6 100644 --- a/packages/rxjs/test/ported/platform/observables/partition.spec.ts +++ b/packages/rxjs/test/ported/platform/observables/partition.spec.ts @@ -63,7 +63,7 @@ describe('partition (platform)', () => { expectSubscriptions(e1.subscriptions).toBe([e1subs, e1subs]); }); }); - it('should partition an observable into two using a predicate and thisArg', async () => { + it('should partition an observable into two using a bound predicate', async () => { await rxTest(({ hot, expectSubscriptions, expectObservable }) => { const e1 = hot(' --a-b---a------d--a---c--|'); const e1subs = ' ^------------------------!'; @@ -79,7 +79,7 @@ describe('partition (platform)', () => { for (let index_1 = 0; index_1 < result_1.length; index_1++) { expectObservable(result_1[index_1]).toBe(expected_1[index_1]); } - })(Observable[partition](e1, predicate, { value: 'a' }), expected); + })(Observable[partition](e1, predicate.bind({ value: 'a' })), expected); expectSubscriptions(e1.subscriptions).toBe([e1subs, e1subs]); }); }); diff --git a/packages/rxjs/test/ported/platform/operators/filter.spec.ts b/packages/rxjs/test/ported/platform/operators/filter.spec.ts index 976bfb2434..73af3b1faf 100644 --- a/packages/rxjs/test/ported/platform/operators/filter.spec.ts +++ b/packages/rxjs/test/ported/platform/operators/filter.spec.ts @@ -363,7 +363,7 @@ describe('filter (platform)', () => { expectSubscriptions(e1.subscriptions).toBe(e1subs); }); }); - it('should be able to accept and use a thisArg', async () => { + it('should be able to use closed-over predicates', async () => { function oddFilter(x) { return +x % 2 === 1; } @@ -388,15 +388,7 @@ describe('filter (platform)', () => { filter2 = (x) => +x % 3 === 0; } const filterer = new Filterer(); - const result = e1[filter](function (x) { - return this.filter1(x); - }, filterer) - [filter](function (x) { - return this.filter2(x); - }, filterer) - [filter](function (x) { - return this.filter1(x); - }, filterer); + const result = e1[filter](filterer.filter1)[filter](filterer.filter2)[filter](filterer.filter1); expectObservable(result).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); }); diff --git a/packages/rxjs/test/ported/platform/operators/find-index.spec.ts b/packages/rxjs/test/ported/platform/operators/find-index.spec.ts index 85c62cd6e7..59ad954bda 100644 --- a/packages/rxjs/test/ported/platform/operators/find-index.spec.ts +++ b/packages/rxjs/test/ported/platform/operators/find-index.spec.ts @@ -77,7 +77,7 @@ describe('findIndex (platform)', () => { expectSubscriptions(e1.subscriptions).toBe(e1subs); }); }); - it('should work with a custom thisArg', async () => { + it('should work with a bound predicate', async () => { function truePredicate(x) { return true; } @@ -89,7 +89,7 @@ describe('findIndex (platform)', () => { const predicate = function (value) { return value === this.b; }; - const result = e1[findIndex](predicate, sourceValues); + const result = e1[findIndex](predicate.bind(sourceValues)); expectObservable(result).toBe(expected, { x: 1 }); expectSubscriptions(e1.subscriptions).toBe(e1subs); }); diff --git a/packages/rxjs/test/ported/platform/operators/find.spec.ts b/packages/rxjs/test/ported/platform/operators/find.spec.ts index 6c2c4a3df2..fc30f88b4d 100644 --- a/packages/rxjs/test/ported/platform/operators/find.spec.ts +++ b/packages/rxjs/test/ported/platform/operators/find.spec.ts @@ -77,7 +77,7 @@ describe('find (platform)', () => { expectSubscriptions(e1.subscriptions).toBe(e1subs); }); }); - it('should work with a custom thisArg', async () => { + it('should work with a bound predicate', async () => { function truePredicate(x) { return true; } @@ -91,7 +91,7 @@ describe('find (platform)', () => { const predicate = function (value) { return value === this.target; }; - expectObservable(e1[find](predicate, finder)).toBe(expected); + expectObservable(e1[find](predicate.bind(finder))).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); }); }); diff --git a/packages/rxjs/test/ported/platform/operators/map.spec.ts b/packages/rxjs/test/ported/platform/operators/map.spec.ts index 9b37ad8ea5..b7903bada0 100644 --- a/packages/rxjs/test/ported/platform/operators/map.spec.ts +++ b/packages/rxjs/test/ported/platform/operators/map.spec.ts @@ -169,7 +169,7 @@ describe('map (platform)', () => { expectSubscriptions(e1.subscriptions).toBe(e1subs); }); }); - it('should map using a custom thisArg', async () => { + it('should map using a bound projector', async () => { const addDrama = (x) => x + '!'; await rxTest(({ hot, expectObservable, expectSubscriptions }) => { const e1 = hot('-5-^-4--3---2----1--|'); @@ -179,10 +179,12 @@ describe('map (platform)', () => { const foo = { value: 42, }; - const result = e1[map](function (x, index) { - expect(this).toBe(foo); - return parseInt(x) + foo.value + index * 10; - }, foo); + const result = e1[map]( + function (x, index) { + expect(this).toBe(foo); + return parseInt(x) + foo.value + index * 10; + }.bind(foo) + ); expectObservable(result).toBe(expected, values); expectSubscriptions(e1.subscriptions).toBe(e1subs); }); @@ -214,7 +216,7 @@ describe('map (platform)', () => { expectSubscriptions(e1.subscriptions).toBe(e1subs); }); }); - it('should do multiple maps using a custom thisArg', async () => { + it('should do multiple maps using closed-over projectors', async () => { const addDrama = (x) => x + '!'; await rxTest(({ hot, expectObservable, expectSubscriptions }) => { const e1 = hot(' --1--2--3--4--|'); @@ -226,15 +228,7 @@ describe('map (platform)', () => { selector2 = (x) => parseInt(x) * 3; } const filterer = new Filterer(); - const result = e1[map](function (x) { - return this.selector1(x); - }, filterer) - [map](function (x) { - return this.selector2(x); - }, filterer) - [map](function (x) { - return this.selector1(x); - }, filterer); + const result = e1[map](filterer.selector1)[map](filterer.selector2)[map](filterer.selector1); expectObservable(result).toBe(expected, values); expectSubscriptions(e1.subscriptions).toBe(e1subs); }); diff --git a/packages/rxjs/test/ported/tools/generate-port-manifest.mjs b/packages/rxjs/test/ported/tools/generate-port-manifest.mjs index d0899bf98e..7c2e10cf8d 100644 --- a/packages/rxjs/test/ported/tools/generate-port-manifest.mjs +++ b/packages/rxjs/test/ported/tools/generate-port-manifest.mjs @@ -662,6 +662,30 @@ const harnessRewritesReplacingUnavailableImports = new Set([ 'spec/observables/from-spec.ts:21:from > should create an observable from an array', ]); const intentionalDivergenceReasons = new Map([ + [ + 'spec/observables/partition-spec.ts:77:partition > should partition an observable into two using a predicate and thisArg', + 'Intentional RxJS Next divergence: the callback receiver argument is removed; the active migrated spec binds the predicate explicitly.', + ], + [ + 'spec/operators/filter-spec.ts:235:filter > should be able to accept and use a thisArg', + 'Intentional RxJS Next divergence: the callback receiver argument is removed; the active migrated spec uses closed-over predicates.', + ], + [ + 'spec/operators/find-spec.ts:89:find > should work with a custom thisArg', + 'Intentional RxJS Next divergence: the callback receiver argument is removed; the active migrated spec binds the predicate explicitly.', + ], + [ + 'spec/operators/findIndex-spec.ts:89:findIndex > should work with a custom thisArg', + 'Intentional RxJS Next divergence: the callback receiver argument is removed; the active migrated spec binds the predicate explicitly.', + ], + [ + 'spec/operators/map-spec.ts:216:map > should map using a custom thisArg', + 'Intentional RxJS Next divergence: the callback receiver argument is removed; the active migrated spec binds the projector explicitly.', + ], + [ + 'spec/operators/map-spec.ts:269:map > should do multiple maps using a custom thisArg', + 'Intentional RxJS Next divergence: the callback receiver argument is removed; the active migrated spec uses closed-over projectors.', + ], [ 'spec/operators/delay-spec.ts:227:delay > should unsubscribe scheduled actions after execution', 'Intentional RxJS Next divergence: the executable replacement asserts AbortSignal cancellation and virtual host-timer cleanup instead of removed RxJS 7 source and Subscription._finalizers internals.', @@ -7033,7 +7057,7 @@ function buildMigratedProgram({ caseId, callback, imports, sourceFile, support, ? `await rxTest(async (${manualContext}) => {\n${rewriteManualHelperCalls(callbackBody)}\n});` : callbackBody; const input = `async function migrated(runtime) {\n${helperPrelude}\n${supportSource}\n${migratedBody}\n}`; - return transpileMigratedProgram( + const program = transpileMigratedProgram( input, imports, [], @@ -7043,6 +7067,43 @@ function buildMigratedProgram({ caseId, callback, imports, sourceFile, support, modeAwareSubscriptionExpectations.get(caseId), expectedValueDictionaries.get(caseId) ); + return rewriteRemovedCallbackReceiver(caseId, program); +} + +function rewriteRemovedCallbackReceiver(caseId, program) { + switch (caseId) { + case 'spec/observables/partition-spec.ts:77:partition > should partition an observable into two using a predicate and thisArg': + return replaceRemovedCallbackReceiver( + caseId, + program, + "partition(e1, predicate, { value: 'a' })", + "partition(e1, predicate.bind({ value: 'a' }))" + ); + case 'spec/operators/filter-spec.ts:235:filter > should be able to accept and use a thisArg': + case 'spec/operators/map-spec.ts:269:map > should do multiple maps using a custom thisArg': + return replaceRemovedCallbackReceiver(caseId, program, '}, filterer)', '}.bind(filterer))', 3); + case 'spec/operators/find-spec.ts:89:find > should work with a custom thisArg': + return replaceRemovedCallbackReceiver(caseId, program, 'find(predicate, finder)', 'find(predicate.bind(finder))'); + case 'spec/operators/findIndex-spec.ts:89:findIndex > should work with a custom thisArg': + return replaceRemovedCallbackReceiver( + caseId, + program, + 'findIndex(predicate, sourceValues)', + 'findIndex(predicate.bind(sourceValues))' + ); + case 'spec/operators/map-spec.ts:216:map > should map using a custom thisArg': + return replaceRemovedCallbackReceiver(caseId, program, '}, foo)', '}.bind(foo))'); + default: + return program; + } +} + +function replaceRemovedCallbackReceiver(caseId, program, receiverArgument, boundCallback, expectedCount = 1) { + const actualCount = program.split(receiverArgument).length - 1; + if (actualCount !== expectedCount) { + throw new Error(`Expected ${expectedCount} callback receiver rewrite(s) for ${caseId}; found ${actualCount}.`); + } + return program.replaceAll(receiverArgument, boundCallback); } function getPortedSchedulerAdapterReason({ imports, source }) { diff --git a/packages/rxjs/test/types/usage.ts b/packages/rxjs/test/types/usage.ts index a4253c0094..02f16d68e0 100644 --- a/packages/rxjs/test/types/usage.ts +++ b/packages/rxjs/test/types/usage.ts @@ -1,5 +1,10 @@ import { ColdObservable, Subject, TimeoutError } from 'rxjs'; +import { every } from 'rxjs/every'; +import { filter } from 'rxjs/filter'; +import { find } from 'rxjs/find'; +import { findIndex } from 'rxjs/find-index'; import { map } from 'rxjs/map'; +import { partition } from 'rxjs/partition'; import { pipe } from 'rxjs/pipe'; import { scan } from 'rxjs/scan'; import { switchMap } from 'rxjs/switch-map'; @@ -18,6 +23,20 @@ const timerResult: Observable = Observable[timer](10); const piped: Observable = source[pipe]((value) => value[map]((item) => String(item))); const staticPiped: Observable = Observable[pipe]([1, 2], (value) => value[map]((item) => String(item))); +const callbackContext = {}; +// @ts-expect-error RxJS 9 callback APIs do not accept a thisArg. +source[every](() => true, callbackContext); +// @ts-expect-error RxJS 9 callback APIs do not accept a thisArg. +source[filter](() => true, callbackContext); +// @ts-expect-error RxJS 9 callback APIs do not accept a thisArg. +source[find](() => true, callbackContext); +// @ts-expect-error RxJS 9 callback APIs do not accept a thisArg. +source[findIndex](() => true, callbackContext); +// @ts-expect-error RxJS 9 callback APIs do not accept a thisArg. +source[map]((value) => value, callbackContext); +// @ts-expect-error RxJS 9 callback APIs do not accept a thisArg. +Observable[partition](source, () => true, callbackContext); + const cold = new ColdObservable((subscriber) => subscriber.next(1)); const subject = new Subject(); const timeoutError = new TimeoutError({ lastValue: 1, meta: undefined, seen: 1 }); From 7cd8e89e20121b98d40050578e26418674894fc3 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Thu, 6 Aug 2026 11:26:14 -0500 Subject: [PATCH 2/7] feat(rxjs): add pipeable rx pilot --- packages/rxjs/package.json | 2 +- packages/rxjs/src/index.ts | 4 + packages/rxjs/src/pipeable/filter.spec.ts | 72 ++++++++++ packages/rxjs/src/pipeable/filter.ts | 48 +++++++ packages/rxjs/src/pipeable/map.spec.ts | 103 ++++++++++++++ packages/rxjs/src/pipeable/map.ts | 43 ++++++ packages/rxjs/src/pipeable/operate.spec.ts | 25 ++++ packages/rxjs/src/pipeable/operate.ts | 24 ++++ packages/rxjs/src/pipeable/types.ts | 61 ++++++++ packages/rxjs/src/rx.spec.ts | 75 ++++++++++ packages/rxjs/src/rx.ts | 134 ++++++++++++++++++ packages/rxjs/test/import/commonjs.cjs | 13 +- packages/rxjs/test/import/esm.mjs | 13 +- .../rxjs/test/import/fixture-scenario.mjs | 14 +- packages/rxjs/test/types/pipeable-api.ts | 33 +++++ 15 files changed, 651 insertions(+), 13 deletions(-) create mode 100644 packages/rxjs/src/pipeable/filter.spec.ts create mode 100644 packages/rxjs/src/pipeable/filter.ts create mode 100644 packages/rxjs/src/pipeable/map.spec.ts create mode 100644 packages/rxjs/src/pipeable/map.ts create mode 100644 packages/rxjs/src/pipeable/operate.spec.ts create mode 100644 packages/rxjs/src/pipeable/operate.ts create mode 100644 packages/rxjs/src/pipeable/types.ts create mode 100644 packages/rxjs/src/rx.spec.ts create mode 100644 packages/rxjs/src/rx.ts create mode 100644 packages/rxjs/test/types/pipeable-api.ts diff --git a/packages/rxjs/package.json b/packages/rxjs/package.json index 4bbd7a0183..e333395d0a 100644 --- a/packages/rxjs/package.json +++ b/packages/rxjs/package.json @@ -1,7 +1,7 @@ { "name": "rxjs", "version": "9.0.0-beta.0", - "description": "Symbol-based reactive extensions for the Web Platform Observable", + "description": "Reactive extensions for the Web Platform Observable", "license": "Apache-2.0", "bugs": { "url": "https://github.com/ReactiveX/rxjs/issues" diff --git a/packages/rxjs/src/index.ts b/packages/rxjs/src/index.ts index c5a4becfba..6215d84eb2 100644 --- a/packages/rxjs/src/index.ts +++ b/packages/rxjs/src/index.ts @@ -21,7 +21,11 @@ export { type ValueFromNotification, } from './notification.js'; export { PerSubscriptionSubjectBase } from './per-subscription-subject-base.js'; +export { filter } from './pipeable/filter.js'; +export { map } from './pipeable/map.js'; +export type { MonoTypeOperatorFunction, ObservableInput, OperatorFunction, UnaryFunction } from './pipeable/types.js'; export { replaySubject, type ReplaySubjectConfig } from './replay-subject.js'; +export { rx } from './rx.js'; export { SequenceError } from './sequence-error.js'; export { Subject } from './subject.js'; export { TimeoutError, type TimeoutInfo } from './timeout-error.js'; diff --git a/packages/rxjs/src/pipeable/filter.spec.ts b/packages/rxjs/src/pipeable/filter.spec.ts new file mode 100644 index 0000000000..43c5b97afa --- /dev/null +++ b/packages/rxjs/src/pipeable/filter.spec.ts @@ -0,0 +1,72 @@ +import { describe, expect, expectTypeOf, it } from 'vitest'; +import { rx } from '../rx.js'; +import { filter } from './filter.js'; + +describe('pipeable filter', () => { + it('emits accepted values and supplies a zero-based index', () => { + const calls: Array<[number, number]> = []; + const values: number[] = []; + const source = fromValues(1, 2, 3); + const filtered = filter((value: number, index) => { + calls.push([value, index]); + return value >= 2; + })(source); + + filtered.subscribe((value) => values.push(value)); + + expect(calls).toEqual([ + [1, 0], + [2, 1], + [3, 2], + ]); + expect(values).toEqual([2, 3]); + }); + + it('delivers predicate errors and cancels synchronous source work', () => { + const failure = new Error('predicate failed'); + const produced: number[] = []; + const errors: unknown[] = []; + const source = new Observable((subscriber) => { + for (const value of [1, 2, 3]) { + if (!subscriber.active) { + break; + } + produced.push(value); + subscriber.next(value); + } + }); + + filter((value: number) => { + if (value === 2) { + throw failure; + } + return true; + })(source).subscribe({ error: (error) => errors.push(error) }); + + expect(errors).toEqual([failure]); + expect(produced).toEqual([1, 2]); + }); + + it('preserves type-guard and Boolean narrowing through rx', () => { + const mixed = new Observable(() => {}); + const nullable = new Observable<0 | 1 | '' | 'value' | null | undefined>(() => {}); + + const strings = rx( + mixed, + filter((value): value is string => typeof value === 'string') + ); + const truthy = rx(nullable, filter(Boolean)); + + expectTypeOf(strings).toEqualTypeOf>(); + expectTypeOf(truthy).toEqualTypeOf>(); + }); +}); + +function fromValues(...values: T[]): Observable { + return new Observable((subscriber) => { + for (const value of values) { + subscriber.next(value); + } + subscriber.complete(); + }); +} diff --git a/packages/rxjs/src/pipeable/filter.ts b/packages/rxjs/src/pipeable/filter.ts new file mode 100644 index 0000000000..3ef53c5599 --- /dev/null +++ b/packages/rxjs/src/pipeable/filter.ts @@ -0,0 +1,48 @@ +import { subscribeToSource } from '../util/observable-helpers.js'; +import { operate } from './operate.js'; +import type { MonoTypeOperatorFunction, OperatorFunction, TruthyTypesOf } from './types.js'; + +/** + * Emits only source values accepted by a predicate. + * + * The predicate receives the source value and a zero-based index scoped to one + * active producer run. Type-guard predicates narrow the result type, and + * passing `Boolean` removes values that are always falsy. + * + * Errors thrown by `predicate` are delivered to the result Observable and + * close the active upstream work. + * + * @typeParam T The source value type. + * @typeParam S The narrowed result value type. + * @param predicate Tests each source value and index. + * @returns A unary operator for use with `rx` or another composition helper. + * + * @example Keep odd numbers and include the source index in a later operator + * ```ts + * import { filter, map, rx } from 'rxjs'; + * + * const labels = rx( + * [1, 2, 3, 4], + * filter((value) => value % 2 === 1), + * map((value, index) => `${index}: ${value}`) + * ); + * + * labels.subscribe(console.log); // '0: 1', '1: 3' + * ``` + */ +export function filter(predicate: (value: T, index: number) => value is S): OperatorFunction; +export function filter(predicate: BooleanConstructor): OperatorFunction>; +export function filter(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction; +export function filter(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction { + return operate((source, subscriber) => { + let index = 0; + + subscribeToSource(source, subscriber, { + next(value) { + if (predicate(value, index++)) { + subscriber.next(value); + } + }, + }); + }); +} diff --git a/packages/rxjs/src/pipeable/map.spec.ts b/packages/rxjs/src/pipeable/map.spec.ts new file mode 100644 index 0000000000..31e7044a2b --- /dev/null +++ b/packages/rxjs/src/pipeable/map.spec.ts @@ -0,0 +1,103 @@ +import { describe, expect, expectTypeOf, it } from 'vitest'; +import { map } from './map.js'; + +describe('pipeable map', () => { + it('maps values with a zero-based activation index', () => { + const calls: Array<[number, number]> = []; + const values: string[] = []; + const source = fromValues(2, 4, 6); + const mapped = map((value: number, index) => { + calls.push([value, index]); + return `${index}:${value * 10}`; + })(source); + + mapped.subscribe((value) => values.push(value)); + + expectTypeOf(mapped).toEqualTypeOf>(); + expect(calls).toEqual([ + [2, 0], + [4, 1], + [6, 2], + ]); + expect(values).toEqual(['0:20', '1:40', '2:60']); + }); + + it('delivers projector errors and cancels synchronous source work', () => { + const failure = new Error('projection failed'); + const produced: number[] = []; + const errors: unknown[] = []; + const source = new Observable((subscriber) => { + for (const value of [1, 2, 3]) { + if (!subscriber.active) { + break; + } + produced.push(value); + subscriber.next(value); + } + }); + + map((value: number) => { + if (value === 2) { + throw failure; + } + return value; + })(source).subscribe({ error: (error) => errors.push(error) }); + + expect(errors).toEqual([failure]); + expect(produced).toEqual([1, 2]); + }); + + it('shares work, ref-counts cancellation, and resets its index after restart', () => { + let activeSubscriber: Subscriber | undefined; + let activations = 0; + let teardowns = 0; + let projections = 0; + const source = new Observable((subscriber) => { + activations++; + activeSubscriber = subscriber; + subscriber.addTeardown(() => teardowns++); + }); + const mapped = map((value: number, index) => { + projections++; + return `${index}:${value}`; + })(source); + const firstController = new AbortController(); + const secondController = new AbortController(); + const first: string[] = []; + const second: string[] = []; + + mapped.subscribe((value) => first.push(value), { signal: firstController.signal }); + mapped.subscribe((value) => second.push(value), { signal: secondController.signal }); + activeSubscriber?.next(1); + + expect(activations).toBe(1); + expect(projections).toBe(1); + expect(first).toEqual(['0:1']); + expect(second).toEqual(['0:1']); + + firstController.abort(); + activeSubscriber?.next(2); + expect(first).toEqual(['0:1']); + expect(second).toEqual(['0:1', '1:2']); + expect(teardowns).toBe(0); + + secondController.abort(); + expect(teardowns).toBe(1); + + const restarted: string[] = []; + mapped.subscribe((value) => restarted.push(value)); + activeSubscriber?.next(3); + + expect(activations).toBe(2); + expect(restarted).toEqual(['0:3']); + }); +}); + +function fromValues(...values: T[]): Observable { + return new Observable((subscriber) => { + for (const value of values) { + subscriber.next(value); + } + subscriber.complete(); + }); +} diff --git a/packages/rxjs/src/pipeable/map.ts b/packages/rxjs/src/pipeable/map.ts new file mode 100644 index 0000000000..19a2437f4d --- /dev/null +++ b/packages/rxjs/src/pipeable/map.ts @@ -0,0 +1,43 @@ +import { subscribeToSource } from '../util/observable-helpers.js'; +import { operate } from './operate.js'; +import type { OperatorFunction } from './types.js'; + +/** + * Projects every source value into a new value. + * + * The projector receives the source value and a zero-based index scoped to one + * active producer run. Concurrent observers of a platform Observable share + * that producer run and index; after ref-count closure, a later activation + * starts again at index `0`. + * + * Errors thrown by `project` are delivered to the result Observable and close + * the active upstream work. + * + * @typeParam T The source value type. + * @typeParam R The projected value type. + * @param project Converts each source value and index into a result value. + * @returns A unary operator for use with `rx` or another composition helper. + * + * @example Double a sequence of numbers + * ```ts + * import { map, rx } from 'rxjs'; + * + * const doubled = rx( + * [1, 2, 3], + * map((value) => value * 2) + * ); + * + * doubled.subscribe(console.log); // 2, 4, 6 + * ``` + */ +export function map(project: (value: T, index: number) => R): OperatorFunction { + return operate((source, subscriber) => { + let index = 0; + + subscribeToSource(source, subscriber, { + next(value) { + subscriber.next(project(value, index++)); + }, + }); + }); +} diff --git a/packages/rxjs/src/pipeable/operate.spec.ts b/packages/rxjs/src/pipeable/operate.spec.ts new file mode 100644 index 0000000000..a8f06a261e --- /dev/null +++ b/packages/rxjs/src/pipeable/operate.spec.ts @@ -0,0 +1,25 @@ +import { describe, expect, it } from 'vitest'; +import { ColdObservable } from '../cold-observable.js'; +import { operate } from './operate.js'; + +describe('operate', () => { + it('constructs through the source protocol', () => { + const source = new ColdObservable(() => {}); + const operator = operate(() => {}); + + expect(operator(source)).toBeInstanceOf(ColdObservable); + }); + + it('delivers synchronous setup errors through the result subscriber', () => { + const failure = new Error('setup failed'); + const errors: unknown[] = []; + const source = new Observable(() => {}); + const operator = operate(() => { + throw failure; + }); + + operator(source).subscribe({ error: (error) => errors.push(error) }); + + expect(errors).toEqual([failure]); + }); +}); diff --git a/packages/rxjs/src/pipeable/operate.ts b/packages/rxjs/src/pipeable/operate.ts new file mode 100644 index 0000000000..e8fa89f8b0 --- /dev/null +++ b/packages/rxjs/src/pipeable/operate.ts @@ -0,0 +1,24 @@ +import { create } from '../create.js'; +import type { OperatorFunction } from './types.js'; + +/** + * Creates a pipeable operator on the receiver's RxJS construction protocol. + * + * The operator setup callback runs when the result Observable activates. Any + * synchronous error thrown while connecting the source is delivered through + * `subscriber.error`. Notification callbacks should subscribe through + * `subscribeToSource`, which provides the corresponding asynchronous callback + * safety and signal ownership. + * + * @internal + */ +export function operate(init: (source: Observable, subscriber: Subscriber) => void): OperatorFunction { + return (source) => + source[create]((subscriber) => { + try { + init(source, subscriber); + } catch (error) { + subscriber.error(error); + } + }); +} diff --git a/packages/rxjs/src/pipeable/types.ts b/packages/rxjs/src/pipeable/types.ts new file mode 100644 index 0000000000..209a9cd2df --- /dev/null +++ b/packages/rxjs/src/pipeable/types.ts @@ -0,0 +1,61 @@ +/** + * Any value accepted by the active realm's platform `Observable.from`. + * + * @typeParam T The values produced after conversion. + * + * @example Convert an iterable before applying RxJS operators + * ```ts + * import { rx, map, type ObservableInput } from 'rxjs'; + * + * const input: ObservableInput = [1, 2, 3]; + * const doubled = rx(input, map((value) => value * 2)); + * + * doubled.subscribe(console.log); // 2, 4, 6 + * ``` + */ +export type ObservableInput = ObservableValue; + +/** + * A function that accepts one value and returns another. + * + * `rx` composes unary functions from left to right. RxJS operators are the + * common case, but the final function may return any value. + * + * @typeParam T The input type. + * @typeParam R The output type. + */ +export interface UnaryFunction { + (source: T): R; +} + +/** + * A pipeable RxJS operator that transforms an `Observable` into an + * `Observable`. + * + * @typeParam T The source value type. + * @typeParam R The result value type. + * + * @example Declare a reusable operator + * ```ts + * import { map, rx, type OperatorFunction } from 'rxjs'; + * + * const stringify: OperatorFunction = map(String); + * const values = rx([1, 2, 3], stringify); + * + * values.subscribe(console.log); // '1', '2', '3' + * ``` + */ +export type OperatorFunction = UnaryFunction, Observable>; + +/** + * A pipeable operator that preserves its source value type. + * + * @typeParam T The source and result value type. + */ +export type MonoTypeOperatorFunction = OperatorFunction; + +/** @internal */ +export type Falsy = null | undefined | false | 0 | -0 | 0n | ''; + +/** @internal */ +export type TruthyTypesOf = T extends Falsy ? never : T; diff --git a/packages/rxjs/src/rx.spec.ts b/packages/rxjs/src/rx.spec.ts new file mode 100644 index 0000000000..ed7d90888b --- /dev/null +++ b/packages/rxjs/src/rx.spec.ts @@ -0,0 +1,75 @@ +import { describe, expect, expectTypeOf, it } from 'vitest'; +import { filter, map, rx } from './index.js'; +import { map as mapSymbol } from './map.js'; + +describe('rx', () => { + it('converts an ObservableInput before applying functions from left to right', () => { + const values: number[] = []; + + const result = rx( + [1, 2, 3, 4], + filter((value) => value % 2 === 0), + map((value) => value * 10) + ); + result.subscribe((value) => values.push(value)); + + expectTypeOf(result).toEqualTypeOf>(); + expect(values).toEqual([20, 40]); + }); + + it('returns the converted Observable when no functions are supplied', () => { + const result = rx(Promise.resolve(42)); + + expect(result).toBeInstanceOf(Observable); + expectTypeOf(result).toEqualTypeOf>(); + }); + + it('coexists with the exact Symbol operator form', () => { + const source = Observable.from([1, 2]); + const pipeableValues: number[] = []; + const symbolValues: number[] = []; + + rx( + source, + map((value) => value * 10) + ).subscribe((value) => pipeableValues.push(value)); + source[mapSymbol]((value) => value * 100).subscribe((value) => symbolValues.push(value)); + + expect(typeof map).toBe('function'); + expect(typeof mapSymbol).toBe('symbol'); + expect(pipeableValues).toEqual([10, 20]); + expect(symbolValues).toEqual([100, 200]); + }); + + it('returns an arbitrary final function result', () => { + const calls: string[] = []; + const result = rx( + [1, 2, 3], + (source) => { + calls.push('first'); + return source; + }, + () => { + calls.push('second'); + return 'ready' as const; + } + ); + + expect(result).toBe('ready'); + expect(calls).toEqual(['first', 'second']); + expectTypeOf(result).toEqualTypeOf<'ready'>(); + }); + + it('tracks nine transformations and returns unknown beyond the overload horizon', () => { + const increment = (value: number) => value + 1; + const first = (source: Observable) => 0; + + const nine = rx([1], first, increment, increment, increment, increment, increment, increment, increment, increment); + const ten = rx([1], first, increment, increment, increment, increment, increment, increment, increment, increment, increment); + + expect(nine).toBe(8); + expect(ten).toBe(9); + expectTypeOf(nine).toEqualTypeOf(); + expectTypeOf(ten).toBeUnknown(); + }); +}); diff --git a/packages/rxjs/src/rx.ts b/packages/rxjs/src/rx.ts new file mode 100644 index 0000000000..8cb550b01d --- /dev/null +++ b/packages/rxjs/src/rx.ts @@ -0,0 +1,134 @@ +import type { ObservableInput, UnaryFunction } from './pipeable/types.js'; + +/** + * Converts an input with the active platform `Observable.from`, then applies + * unary functions from left to right. + * + * The first function receives `Observable`. Each following function + * receives the exact result of the preceding function, so `rx` can return an + * Observable, a subscription handle, or any other final value. + * + * TypeScript tracks the first nine transformations precisely. Longer chains + * are accepted, but their result is `unknown` because TypeScript cannot express + * an unbounded heterogeneous function chain without either an overload horizon + * or materially more expensive recursive tuple types. Every overload also + * adds work to overload resolution; for exceptionally large pipelines, split + * the chain into named, typed functions to improve diagnostics and checking + * time. + * + * @typeParam T The value produced by the converted input. + * @param input A platform Observable, iterable, async iterable, or Promise-like + * value accepted by `Observable.from`. + * @param functions Unary functions applied from left to right. + * @returns The converted Observable when no functions are supplied, otherwise + * the final function's result. + * + * @example Compose pipeable operators over an iterable + * ```ts + * import { filter, map, rx } from 'rxjs'; + * + * const result = rx( + * [1, 2, 3, 4], + * filter((value) => value % 2 === 0), + * map((value) => value * 10) + * ); + * + * result.subscribe(console.log); // 20, 40 + * ``` + * + * @example Return a non-Observable final value + * ```ts + * import { rx } from 'rxjs'; + * + * const label = rx([1, 2, 3], () => 'ready' as const); + * // label has type 'ready' + * ``` + */ +export function rx(input: ObservableInput): Observable; +export function rx(input: ObservableInput, fn1: UnaryFunction, A>): A; +export function rx(input: ObservableInput, fn1: UnaryFunction, A>, fn2: UnaryFunction): B; +export function rx( + input: ObservableInput, + fn1: UnaryFunction, A>, + fn2: UnaryFunction, + fn3: UnaryFunction +): C; +export function rx( + input: ObservableInput, + fn1: UnaryFunction, A>, + fn2: UnaryFunction, + fn3: UnaryFunction, + fn4: UnaryFunction +): D; +export function rx( + input: ObservableInput, + fn1: UnaryFunction, A>, + fn2: UnaryFunction, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction +): E; +export function rx( + input: ObservableInput, + fn1: UnaryFunction, A>, + fn2: UnaryFunction, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction +): F; +export function rx( + input: ObservableInput, + fn1: UnaryFunction, A>, + fn2: UnaryFunction, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction, + fn7: UnaryFunction +): G; +export function rx( + input: ObservableInput, + fn1: UnaryFunction, A>, + fn2: UnaryFunction, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction, + fn7: UnaryFunction, + fn8: UnaryFunction +): H; +export function rx( + input: ObservableInput, + fn1: UnaryFunction, A>, + fn2: UnaryFunction, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction, + fn7: UnaryFunction, + fn8: UnaryFunction, + fn9: UnaryFunction +): I; +export function rx( + input: ObservableInput, + fn1: UnaryFunction, A>, + fn2: UnaryFunction, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction, + fn7: UnaryFunction, + fn8: UnaryFunction, + fn9: UnaryFunction, + ...functions: UnaryFunction[] +): unknown; +export function rx(input: ObservableInput, ...functions: UnaryFunction[]): unknown { + let result: unknown = Observable.from(input); + + for (const fn of functions) { + result = fn(result); + } + + return result; +} diff --git a/packages/rxjs/test/import/commonjs.cjs b/packages/rxjs/test/import/commonjs.cjs index b147b941d4..9a5aad0b19 100644 --- a/packages/rxjs/test/import/commonjs.cjs +++ b/packages/rxjs/test/import/commonjs.cjs @@ -1,6 +1,6 @@ const assert = require('node:assert/strict'); -const { ColdObservable, Subject, TimeoutError } = require('rxjs'); -const { map } = require('rxjs/map'); +const { ColdObservable, Subject, TimeoutError, filter, map, rx } = require('rxjs'); +const { map: mapSymbol } = require('rxjs/map'); const { pipe } = require('rxjs/pipe'); const { scan } = require('rxjs/scan'); const { switchMap } = require('rxjs/switch-map'); @@ -11,12 +11,15 @@ assert.equal(typeof globalThis.Observable, 'function'); assert.equal(typeof ColdObservable, 'function'); assert.equal(typeof Subject, 'function'); assert.equal(typeof TimeoutError, 'function'); -assert.equal(typeof map, 'symbol'); -assert.equal(typeof globalThis.Observable.prototype[map], 'function'); +assert.equal(typeof rx, 'function'); +assert.equal(typeof map, 'function'); +assert.equal(typeof filter, 'function'); +assert.equal(typeof mapSymbol, 'symbol'); +assert.equal(typeof globalThis.Observable.prototype[mapSymbol], 'function'); for (const symbol of [pipe, scan, switchMap, timeout, timer]) { assert.equal(typeof symbol, 'symbol'); } -for (const symbol of [map, pipe, scan, switchMap, timeout]) { +for (const symbol of [mapSymbol, pipe, scan, switchMap, timeout]) { assert.equal(typeof globalThis.Observable.prototype[symbol], 'function'); assert.equal(Object.getOwnPropertyDescriptor(globalThis.Observable.prototype, symbol).enumerable, true); } diff --git a/packages/rxjs/test/import/esm.mjs b/packages/rxjs/test/import/esm.mjs index ccc58165e9..20e5de9f2f 100644 --- a/packages/rxjs/test/import/esm.mjs +++ b/packages/rxjs/test/import/esm.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict'; -import { ColdObservable, Subject, TimeoutError } from 'rxjs'; -import { map } from 'rxjs/map'; +import { ColdObservable, Subject, TimeoutError, filter, map, rx } from 'rxjs'; +import { map as mapSymbol } from 'rxjs/map'; import { pipe } from 'rxjs/pipe'; import { scan } from 'rxjs/scan'; import { switchMap } from 'rxjs/switch-map'; @@ -11,12 +11,15 @@ assert.equal(typeof globalThis.Observable, 'function'); assert.equal(typeof ColdObservable, 'function'); assert.equal(typeof Subject, 'function'); assert.equal(typeof TimeoutError, 'function'); -assert.equal(typeof map, 'symbol'); -assert.equal(typeof globalThis.Observable.prototype[map], 'function'); +assert.equal(typeof rx, 'function'); +assert.equal(typeof map, 'function'); +assert.equal(typeof filter, 'function'); +assert.equal(typeof mapSymbol, 'symbol'); +assert.equal(typeof globalThis.Observable.prototype[mapSymbol], 'function'); for (const symbol of [pipe, scan, switchMap, timeout, timer]) { assert.equal(typeof symbol, 'symbol'); } -for (const symbol of [map, pipe, scan, switchMap, timeout]) { +for (const symbol of [mapSymbol, pipe, scan, switchMap, timeout]) { assert.equal(typeof globalThis.Observable.prototype[symbol], 'function'); assert.equal(Object.getOwnPropertyDescriptor(globalThis.Observable.prototype, symbol).enumerable, true); } diff --git a/packages/rxjs/test/import/fixture-scenario.mjs b/packages/rxjs/test/import/fixture-scenario.mjs index ea694eaf69..5dfe50482a 100644 --- a/packages/rxjs/test/import/fixture-scenario.mjs +++ b/packages/rxjs/test/import/fixture-scenario.mjs @@ -45,8 +45,18 @@ if (scenario === 'missing-global-subpath') { const prototypeDescriptions = Object.getOwnPropertySymbols(globalThis.Observable.prototype).map((symbol) => symbol.description); assert.equal(typeof root.Subject, 'function'); - assert.equal('map' in root, false); - assert.equal('filter' in root, false); + assert.equal(typeof root.rx, 'function'); + assert.equal(typeof root.map, 'function'); + assert.equal(typeof root.filter, 'function'); + const values = []; + root + .rx( + [1, 2, 3], + root.filter((value) => value > 1), + root.map((value) => value * 10) + ) + .subscribe((value) => values.push(value)); + assert.deepEqual(values, [20, 30]); assert.deepEqual(constructorDescriptions, ['rxjs.observable.polyfill.info.v1', 'rxjs.kernel.create.v1']); assert.deepEqual(prototypeDescriptions, ['Symbol.toStringTag', 'rxjs.kernel.create.v1']); } else if (scenario === 'foreign-constructor') { diff --git a/packages/rxjs/test/types/pipeable-api.ts b/packages/rxjs/test/types/pipeable-api.ts new file mode 100644 index 0000000000..80e189bb60 --- /dev/null +++ b/packages/rxjs/test/types/pipeable-api.ts @@ -0,0 +1,33 @@ +import { filter, map, rx, type MonoTypeOperatorFunction, type ObservableInput, type OperatorFunction, type UnaryFunction } from 'rxjs'; + +const input: ObservableInput = [1, 2, 3]; +const stringify: OperatorFunction = map((value) => String(value)); +const positive: MonoTypeOperatorFunction = filter((value) => value > 0); +const length: UnaryFunction = (value) => value.length; + +const strings: Observable = rx(input, positive, stringify); +const finalLength: number = rx(input, positive, stringify, () => 'done', length); + +const mixed: ObservableInput = [1, 'two']; +const narrowed: Observable = rx( + mixed, + filter((value): value is string => typeof value === 'string') +); + +const nullable: ObservableInput<0 | 1 | '' | 'value' | null | undefined> = [0, 1, '', 'value', null, undefined]; +const truthy: Observable<1 | 'value'> = rx(nullable, filter(Boolean)); + +const increment = (value: number) => value + 1; +const first = (_source: Observable) => 0; +const nine: number = rx(input, first, increment, increment, increment, increment, increment, increment, increment, increment); +const ten = rx(input, first, increment, increment, increment, increment, increment, increment, increment, increment, increment); + +// @ts-expect-error Chains beyond nine transformations deliberately return unknown. +const unsafeTen: number = ten; + +void strings; +void finalLength; +void narrowed; +void truthy; +void nine; +void unsafeTen; From a95d10a18639dde8ed633a39f33a84f8bad7f256 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Thu, 6 Aug 2026 11:26:26 -0500 Subject: [PATCH 3/7] docs(rxjs): compare pipeable and symbol APIs --- docs/rxjs-next/ARCHITECTURE.md | 36 ++++++ docs/rxjs-next/COMPATIBILITY.md | 34 +++-- docs/rxjs-next/DECISIONS.md | 29 +++++ docs/rxjs-next/OPEN_QUESTIONS.md | 21 +++ docs/rxjs-next/PROJECT_CHARTER.md | 9 +- docs/rxjs-next/PROJECT_PLAN.md | 80 +++++++++--- docs/rxjs-next/WHY_SYMBOL_OPERATORS.md | 26 ++-- packages/rxjs/README.md | 35 +++-- packages/rxjs/docs/API.md | 44 ++++++- packages/rxjs/docs/PIPEABLE_EXPERIMENT.md | 150 ++++++++++++++++++++++ 10 files changed, 399 insertions(+), 65 deletions(-) create mode 100644 packages/rxjs/docs/PIPEABLE_EXPERIMENT.md diff --git a/docs/rxjs-next/ARCHITECTURE.md b/docs/rxjs-next/ARCHITECTURE.md index e39bcf6dbb..5c0c4264a3 100644 --- a/docs/rxjs-next/ARCHITECTURE.md +++ b/docs/rxjs-next/ARCHITECTURE.md @@ -557,6 +557,42 @@ been removed, and public declarations use explicit `unique symbol` types. D-037. D-048 records the version, duplicate-copy, realm, and collision consequences of that split. +## Proposed all-pipeable beta experiment + +D-060 proposes exposing ordinary pipeable functions from the `rxjs` root while +retaining exact Symbols during beta. The first review slice is intentionally +smaller than the proposed destination: + +- `rx(input, ...functions)` converts `input` through the active platform + `Observable.from` and applies unary functions from left to right; +- public `ObservableInput`, `UnaryFunction`, `OperatorFunction`, and + `MonoTypeOperatorFunction` types describe the initial composition boundary; +- pipeable `map` and `filter` are root exports and use an internal `operate` + helper; +- `operate` creates through the source's D-037 `[create]` protocol and catches + synchronous connection failures, while `subscribeToSource` continues to own + signal propagation and notification-callback safety; +- all current Symbol modules, imports, installations, and tests remain intact. + +The pilot does not settle the package layout. In particular, `rxjs/map` and +`rxjs/filter` still export their existing Symbols even though the root exports +pipeable functions with those names. Moving exact Symbols to an +`rxjs/symbol` boundary and making ordinary deep imports pipeable would alter +public exports and package side effects and remains gated on maintainer review. + +The initial `rx` declaration uses explicit overloads through nine +transformations and an `unknown` fallback after that point. This makes the +type-safety horizon and overload-resolution cost visible. The alternative of +recursive variadic-tuple typing remains a proposal until representative +TypeScript projects measure checking time and diagnostic quality. + +This experiment does not change Observable lifecycle semantics. Pipeable +results use the same construction protocol, active-producer sharing, +AbortSignal cancellation, and source-subscription safety as the corresponding +platform-layer Symbol design. See +`packages/rxjs/docs/PIPEABLE_EXPERIMENT.md` for the detailed comparison and +open review gates. + ## Current API inventory This inventory documents what exists in source, not a supported public API. diff --git a/docs/rxjs-next/COMPATIBILITY.md b/docs/rxjs-next/COMPATIBILITY.md index e5eee51fdb..5623d4f7ca 100644 --- a/docs/rxjs-next/COMPATIBILITY.md +++ b/docs/rxjs-next/COMPATIBILITY.md @@ -4,8 +4,10 @@ RxJS Next reuses the behavioral knowledge in RxJS 7 tests where the represented expectations remain meaningful. It does not ship a separate runtime package -that emulates RxJS 7 imports, `Subscription`, pipeable operators, schedulers, or -deprecated aliases. +that emulates RxJS 7, schedulers, or deprecated aliases. The accepted baseline +uses exact Symbols; D-060 now proposes a real RxJS Next pipeable surface in the +same package during beta. That proposal is a new public contract, not an RxJS 7 +runtime-emulation package. Useful APIs such as `ColdObservable`, Subjects, and the Symbol-keyed `pipe` may remain in `rxjs` as intentional RxJS Next capabilities with their own explicit @@ -55,8 +57,8 @@ The table describes architectural defaults, not every edge case. | Teardown registration | Producer may return teardown logic; subscriptions aggregate finalizers | Producer calls `subscriber.addTeardown()` | Rewrite custom producers rather than relying on returned teardown functions | | Teardown order | RxJS 7 subscription finalizers follow RxJS aggregation semantics | The platform specification closes teardown callbacks in reverse insertion order | Treat order-sensitive teardown as a semantic migration | | Error reporting | RxJS configuration and host error reporting rules | Platform exception reporting and Web IDL callback behavior | Audit unhandled, late, and observer-callback errors | -| Operators | Mostly standalone pipeable functions returning Observables | Platform string methods plus exact RxJS Symbol extensions | Migrate imports and invocation shape; verify lifecycle-sensitive behavior | -| Pipe | `pipe(...)`, `source.pipe(...)`, and `OperatorFunction` types | Exact Symbol-keyed `pipe` may remain as a Next API | Do not assume RxJS 7 pipeable functions or types exist | +| Operators | Mostly standalone pipeable functions returning Observables | Exact Symbols plus D-060's proposed root pipeable surface | Familiar syntax does not remove lifecycle and overload review | +| Pipe | `pipe(...)`, `source.pipe(...)`, and `OperatorFunction` types | Exact Symbol-keyed `pipe`; proposed `rx` and new Next composition types | Do not assume RxJS 7 imports, overloads, or lifecycle behavior | | Subjects | Subject family with established RxJS 7 semantics | Intentional Next Subject APIs with directly documented contracts | Verify late-observer, replay, terminal, and cancellation semantics | | Scheduling | Scheduler arguments and scheduler classes affect many APIs | Host APIs and `@rxjs/test`; no general public RxJS scheduler abstraction | Remove scheduler arguments and review timing-sensitive code | | Input conversion | Broad `ObservableInput` ecosystem and interop protocols | Platform `Observable.from` conversion order and categories | Audit custom subscribables and legacy interop | @@ -102,8 +104,11 @@ helpers, and other APIs when they are useful on their own terms. They must: shared platform lifecycle; - keep unsupported RxJS 7 behavior visible in migration guidance. -They do not provide an RxJS 7 `Subscription` facade, pipeable-operator import -surface, scheduler system, deprecated aliases, or compatibility package. +The accepted APIs do not provide an RxJS 7 `Subscription` facade, scheduler +system, deprecated aliases, or compatibility package. D-060's pipeable pilot +adds new root functions and familiar composition types on their own RxJS Next +contracts; the full catalog, deep-import layout, and lite `subscribe` facade +remain unimplemented review items. D-050 stabilizes `ColdObservable`, `PerSubscriptionSubjectBase`, the Subject family, and the Symbol-keyed `pipe` as this intentional Next surface. @@ -117,6 +122,7 @@ family, and the Symbol-keyed `pipe` as this intentional Next surface. | Replay subject | Root and `rxjs/replay-subject` lowercase factory | Hot size/host-time-bounded replay followed by live fanout | | `PerSubscriptionSubjectBase` | Root and explicit advanced-base subpath | Protected per-direct-observer setup hook for specialized hot Subject implementations | | Exact Symbol-keyed `pipe` | `rxjs/pipe` static and instance Symbol | Typed one-to-seven-step composition; no `.pipe`, pipeable imports, or `OperatorFunction` claim | +| Pipeable pilot | Root `rx`, `map`, `filter`, and composition types | New Next contracts with a nine-transformation `rx` type horizon | `PerSubscriptionSubjectBase` is hot: its Subject producer exists as soon as the instance is constructed. Its distinction from `Subject` is that it inherits @@ -227,11 +233,17 @@ support: - explicit selection when the pipeline moves between shared platform and producer-per-subscription Next semantics. -The exact Symbol-addressed `[pipe]` is an intentional Next API. It does not -promise RxJS 7 `OperatorFunction` types, standalone pipeable imports, or the -string-named `.pipe`. Skills may transform an old pipeline to imported Symbols -and `[pipe]` or to direct Symbol composition, then flag lifecycle-sensitive -segments for review. +The exact Symbol-addressed `[pipe]` remains an intentional Next API. D-060's +parallel pilot now adds root `rx`, pipeable `map` and `filter`, plus +`UnaryFunction`, `OperatorFunction`, and `MonoTypeOperatorFunction`. These are +new Next contracts and do not imply that RxJS 7 import paths, scheduler +overloads, broad `ObservableInput`, or `Subscription` behavior are restored. + +The initial `rx` overloads preserve exact types through nine transformations +and return `unknown` for longer chains. Migration tooling must not hide that +boundary with `any`. It may split a longer pipeline into typed segments, but it +must retain lifecycle-sensitive review and cannot treat familiar pipeable +syntax as proof of RxJS 7 semantic compatibility. ## Testing and migration-evidence boundary diff --git a/docs/rxjs-next/DECISIONS.md b/docs/rxjs-next/DECISIONS.md index b532ed4129..78e279f68f 100644 --- a/docs/rxjs-next/DECISIONS.md +++ b/docs/rxjs-next/DECISIONS.md @@ -1513,3 +1513,32 @@ Status meanings: construction, and platform string-named methods are unchanged. Historical RxJS 7 evidence retains its source identity, while active migrated specs use closures or bound functions instead of asserting the removed overload. + +## D-060 — Evaluate an all-pipeable beta surface alongside exact Symbols + +- **Status:** Proposed +- **Direction under review:** Add ordinary pipeable operator functions at the + `rxjs` root and compose them with `rx(input, ...functions)`. `rx` converts its + first input through the active platform `Observable.from` and returns the + final unary function's result. Exact Symbol operators remain available + during beta so both forms can be evaluated rather than deleting one before + user and ecosystem feedback exists. +- **Pilot boundary:** The first slice contains root `rx`, pipeable `map` and + `filter`, public unary/operator types, and an internal `operate` helper. It + does not move current Symbol subpaths, convert the full catalog, replace + Promise-returning platform consumers, or add the compatibility `subscribe` + facade. +- **Typing:** The pilot tracks nine transformations with explicit overloads + and returns `unknown` beyond that horizon. Longer precise chains, additional + fixed overloads, or recursive tuple typing require representative + TypeScript checking-cost evidence before acceptance. +- **Rationale:** User feedback finds pipeable syntax more readable and more + familiar than bracketed Symbol invocation. The beta can gather useful + evidence only if the two real surfaces coexist. The Symbol form retains + material advantages in unbounded stepwise inference, diagnostic locality, + native-overlap visibility, and exact-key collision isolation. +- **Consequence if accepted:** D-003, D-039, D-040, and D-050 require narrow + supersession rather than deletion. Package exports, documentation, migration + guidance, bundle gates, and the root operator-isolation contract must be + revised together. The final `rxjs/map` versus `rxjs/symbol` layout and + implementation sharing model remain open until the pilot review. diff --git a/docs/rxjs-next/OPEN_QUESTIONS.md b/docs/rxjs-next/OPEN_QUESTIONS.md index 0dcc1b0b5a..8e1c22912c 100644 --- a/docs/rxjs-next/OPEN_QUESTIONS.md +++ b/docs/rxjs-next/OPEN_QUESTIONS.md @@ -174,3 +174,24 @@ and Cursor. P0.M5 records a Codex `0.146.0-alpha.3.1` outcome snapshot with marketplace distribution, harness support windows, and requalification beyond the committed beta evidence remain open. Adding MCP later would require a new accepted decision and product contract. + +### 10. How should pipeable functions and exact Symbols coexist during beta? + +D-060 proposes both surfaces and the first pilot proves only root `rx`, `map`, +and `filter`. The existing `rxjs/map` and `rxjs/filter` deep imports still +export exact Symbols. Before expanding the catalog, decide: + +- whether ordinary deep imports become pipeable functions; +- whether Symbols move to one `rxjs/symbol` barrel, per-operator + `rxjs/symbol/map` paths, or both; +- whether Symbol implementations delegate to pipeable implementations, both + call shared internal logic, or they remain independently specified; +- whether `operate` is internal or public; +- whether nine fixed transformations is the accepted `rx` type horizon or a + different design passes representative type-check performance gates; +- which Observable-returning terminal consumer and lite `subscribe` contract + should be the next review slice. + +Do not answer these questions implicitly through bulk file moves or operator +conversion. The first pilot and its comparison document are the evidence for +maintainer review. diff --git a/docs/rxjs-next/PROJECT_CHARTER.md b/docs/rxjs-next/PROJECT_CHARTER.md index 272c7c901b..2a822d3985 100644 --- a/docs/rxjs-next/PROJECT_CHARTER.md +++ b/docs/rxjs-next/PROJECT_CHARTER.md @@ -28,6 +28,12 @@ Safari, Webpack 5, Deno, and Bun. Node 26 is advisory during beta. Browser, Webpack, `import`, and the Node `require(esm)` bridge resolve the same files; no CommonJS or runtime-specific code copy is published. +D-060 is an active proposed beta experiment, not yet a replacement for the +accepted Symbol goals below. It evaluates root-level pipeable functions and +`rx(input, ...functions)` alongside exact Symbols, beginning with a small +review-gated pilot. Any durable charter change follows that review and must +state explicitly which earlier decisions it supersedes. + ## Why this work exists RxJS 8 development stopped while Observable was being standardized for the web @@ -78,7 +84,8 @@ Restarting the library on top of the platform primitive has three benefits: deterministic engine, and supported harness adapters selected for the foundation release. - Shipping a runtime package that emulates the RxJS 7 public API, import map, - subscription facade, pipeable-operator surface, or scheduler system. + subscription facade, or scheduler system. D-060's proposed pipeable surface + is a new RxJS Next contract in `rxjs`, not a compatibility package. - Claiming complete RxJS 7 behavioral compatibility on the platform `Observable`. - Preserving every RxJS 7 internal class, scheduler mechanism, import path, or diff --git a/docs/rxjs-next/PROJECT_PLAN.md b/docs/rxjs-next/PROJECT_PLAN.md index f33b06389c..01310e4c52 100644 --- a/docs/rxjs-next/PROJECT_PLAN.md +++ b/docs/rxjs-next/PROJECT_PLAN.md @@ -81,10 +81,11 @@ bundle-size reduction. P6.8 completed durable pull-request and `master` CI ownership for every accepted RxJS 9 test and release check. P6.9 implemented truthful status signals and security automation and validated their first live GitHub results. The user then explicitly prioritized P6.11, which removed -inherited callback `thisArg` parameters and their hot-path dispatch cost. P6.10 -remains the sole `NEXT` item: one understandable, interactive single-maintainer -beta publication command with npm two-factor authentication and no CI -publishing credential. +inherited callback `thisArg` parameters and their hot-path dispatch cost. The +user has now paused first-beta publication to evaluate an all-pipeable public +surface alongside the exact-Symbol surface. P6.12 is the sole `NEXT` item and +is review-gated after a small pilot; P6.10 returns to `PLANNED` until that beta +architecture is settled. RxJS 9 and `9.0.0-beta.0` are selected under D-007. D-053 defines runtime, browser, bundler, channel, and RxJS 7 maintenance policy. Dates and staffing @@ -1559,19 +1560,20 @@ names. ### Phase 6 — Release readiness -| Status | ID | Outcome | -| ------ | ----- | ------------------------------------------------------------------------------------- | -| `DONE` | P6.1 | Finalize version naming, supported environments, support policy, and release channels | -| `DONE` | P6.2 | Complete package, type, bundle, performance, and conformance gates | -| `DONE` | P6.3 | Publish package-local API, migration, and contributor documentation | -| `DONE` | P6.4 | Run pre-release adoption, resolve blockers, and approve the major release | -| `DONE` | P6.5 | Complete the terminal plan, verification, and documentation-site exclusion audit | -| `DONE` | P6.6 | Centralize eligible source subscriptions and record bundle-size evidence | -| `DONE` | P6.7 | Use direct `[create]` construction and record bundle-size evidence | -| `DONE` | P6.8 | Complete RxJS 9 CI coverage and validate the resulting pull-request workflow matrix | -| `DONE` | P6.9 | Validate the first live dependency-review and Scorecard runs on GitHub | -| `NEXT` | P6.10 | Publish and verify the first beta with the interactive release command | -| `DONE` | P6.11 | Remove inherited callback `thisArg` parameters and direct-call callback hot paths | +| Status | ID | Outcome | +| --------- | ----- | ------------------------------------------------------------------------------------- | +| `DONE` | P6.1 | Finalize version naming, supported environments, support policy, and release channels | +| `DONE` | P6.2 | Complete package, type, bundle, performance, and conformance gates | +| `DONE` | P6.3 | Publish package-local API, migration, and contributor documentation | +| `DONE` | P6.4 | Run pre-release adoption, resolve blockers, and approve the major release | +| `DONE` | P6.5 | Complete the terminal plan, verification, and documentation-site exclusion audit | +| `DONE` | P6.6 | Centralize eligible source subscriptions and record bundle-size evidence | +| `DONE` | P6.7 | Use direct `[create]` construction and record bundle-size evidence | +| `DONE` | P6.8 | Complete RxJS 9 CI coverage and validate the resulting pull-request workflow matrix | +| `DONE` | P6.9 | Validate the first live dependency-review and Scorecard runs on GitHub | +| `PLANNED` | P6.10 | Publish and verify the first beta with the interactive release command | +| `DONE` | P6.11 | Remove inherited callback `thisArg` parameters and direct-call callback hot paths | +| `NEXT` | P6.12 | Implement and review the first all-pipeable architecture pilot | #### P6.9 completion bar @@ -1685,6 +1687,26 @@ review`. This completes P6.9; the later P6.10 ruleset migration must preserve and 140,627 cancellations per second. Marked P6.11 `DONE`; the completed execution queue has no `NEXT` marker. +#### P6.12 completion bar + +- A dedicated branch adds `rx`, a typed `operate` foundation, and only two + representative pipeable operators without removing or changing the existing + exact-Symbol implementations or their tests. +- The pipeable APIs are available from the `rxjs` root, accept platform + `ObservableInput` through `Observable.from`, construct through the accepted + D-037 creation protocol, and preserve signal-owned source cancellation and + stream error forwarding. +- Focused runtime tests cover composition, shared activation, cancellation, + restart, callback errors, and coexistence with the existing Symbol forms; + public declaration tests cover inference and the initial overload boundary. +- Documentation records the experiment separately from the accepted Symbol + architecture, including TypeScript overload limits and checking cost. No + Symbol file move, full-catalog conversion, Promise-consumer replacement, or + compatibility `subscribe` facade is attempted before maintainer review. +- Stop after presenting the pilot implementation and evidence to the user. + Any broader file layout, export, helper, or operator-family structure remains + gated on that review. + #### P6.1 completion bar - All release packages share the accepted RxJS 9 prerelease identity and exact @@ -3718,6 +3740,7 @@ conformance implementation depends on a runnable harness. remains the sole `NEXT` item until the command publishes and verifies `9.0.0-beta.0`, package access disallows automation tokens, and the immutable GitHub Release is recorded. + ### 2026-08-05 — P6.11 callback receiver removal - Audited the complete RxJS production source and removed callback `thisArg` @@ -3734,3 +3757,26 @@ conformance implementation depends on a runnable harness. the release performance floor. - Recorded D-059, marked P6.11 `DONE`, and retained P6.10 as the sole `NEXT` item. + +### 2026-08-06 — P6.12 first all-pipeable pilot + +- Created `codex/all-pipeable-experiment` from the completed callback-receiver + branch, moved P6.10 back to `PLANNED`, and made the review-gated P6.12 pilot + the sole `NEXT` item. +- Added root `rx`, pipeable `map` and `filter`, public composition types, and an + internal `operate` helper. The pilot uses D-037 derived construction and the + existing guarded source-subscription helper without changing the 97 exact + Symbol implementations or their tests. +- Added 13 focused runtime tests plus a published-declaration consumer covering + conversion, left-to-right arbitrary results, nine-step typing, the explicit + `unknown` fallback, narrowing, setup and notification errors, shared + activation, ref-count cancellation, restart, and Symbol coexistence. +- Added the critical pipeable/Symbol/platform comparison, TypeScript checking + tradeoffs, D-060 proposal, architecture and compatibility records, and the + unresolved deep-import, implementation-sharing, terminal-consumer, and lite + subscription review gates. +- Passed 110 focused files and 763 tests, the complete RxJS package gate, + public types, migration-document freshness, all 97 Symbol installation + audits, ESM and Node `require(esm)` imports, package documentation links, + build, lint with zero errors, and diff hygiene. P6.12 remains `NEXT` and work + stops here for the requested maintainer review. diff --git a/docs/rxjs-next/WHY_SYMBOL_OPERATORS.md b/docs/rxjs-next/WHY_SYMBOL_OPERATORS.md index 66d883f6c2..26a31624cc 100644 --- a/docs/rxjs-next/WHY_SYMBOL_OPERATORS.md +++ b/docs/rxjs-next/WHY_SYMBOL_OPERATORS.md @@ -1,5 +1,11 @@ # Why RxJS is moving to Symbol operators +This document explains the exact-Symbol design that entered the RxJS 9 beta. +D-060 now proposes evaluating an all-pipeable surface alongside it rather than +assuming either form wins before beta feedback. The pilot, TypeScript limits, +and a more critical side-by-side comparison are recorded in the +[all-pipeable experiment](../../packages/rxjs/docs/PIPEABLE_EXPERIMENT.md). + The short version: RxJS operators are becoming methods addressed by imported Symbols. @@ -129,10 +135,9 @@ const positive = (source) => source[filter]((value) => value > 0); const result = source[pipe](double, positive); ``` -The compatibility layer can use this composition point to preserve familiar -RxJS 7-style pipeable operator functions and types. Existing applications do -not need to rewrite every pipeline at once, and libraries can continue to pass -reusable operator functions across an API boundary. +D-060's pilot instead tests real root-level pipeable functions and `rx` as +RxJS Next contracts. The existing Symbol-addressed `pipe` remains available +while the two composition surfaces are evaluated during beta. ## This is not a new mental model @@ -142,13 +147,12 @@ The important parts of RxJS do not change: - operators compose in order; - pipelines remain readable and reusable; - operator behavior remains backed by the RxJS test corpus; -- a compatibility path remains available for pipeable code. - -The visible migration is usually mechanical: import the operator's Symbol and -invoke it on the source. In return, RxJS gets collision-safe extension, -coexists cleanly with the web platform, and gains one uniform operator syntax. +- the beta can compare exact-Symbol and pipeable code with real implementations. -It is a meaningful architectural improvement, but for day-to-day RxJS code, -it is no big deal. +The exact-Symbol form remains collision-safe and composes directly on the +platform value. The pipeable form is more familiar to existing users and avoids +bracket syntax. The beta experiment exists because those are both material +facts, and a final decision should compare typing, checking cost, bundles, +diagnostics, and user feedback rather than treating syntax as the only input. [tc39-pipe]: https://github.com/tc39/proposals#stage-2 diff --git a/packages/rxjs/README.md b/packages/rxjs/README.md index d014458954..e0cd18742a 100644 --- a/packages/rxjs/README.md +++ b/packages/rxjs/README.md @@ -21,29 +21,25 @@ finalized. RxJS 9 is a new platform-based generation, not a release of that paused implementation. The version communicates that architectural break and prevents the old RxJS 8 work from being mistaken for this product. -## Use an operator +## Try the pipeable pilot ```ts -import { ColdObservable } from 'rxjs'; -import { map } from 'rxjs/map'; -import { pipe } from 'rxjs/pipe'; -import { scan } from 'rxjs/scan'; - -const source = new ColdObservable((subscriber) => { - subscriber.next(1); - subscriber.next(2); - subscriber.next(3); - subscriber.complete(); -}); - -source[pipe]( - (values) => values[map]((value) => value * 2), - (values) => values[scan]((total, value) => total + value, 0) -).subscribe(console.log); // 2, 6, 12 +import { filter, map, rx } from 'rxjs'; + +const result = rx( + [1, 2, 3, 4], + filter((value) => value % 2 === 0), + map((value) => value * 10) +); + +result.subscribe(console.log); // 20, 40 ``` -Each operator subpath exports its exact Symbol and installs only that -capability. Importing the root does not install the operator catalog. +This branch is evaluating the root-level pipeable surface alongside the +existing exact-Symbol catalog. The pilot is intentionally limited to `rx`, +`map`, and `filter` until its implementation and typing approach are reviewed. +Existing operator subpaths still export their exact Symbols and install only +those capabilities. ## Choose the lifecycle deliberately @@ -80,6 +76,7 @@ not support legacy CommonJS resolvers. - [Security assurance and release verification](docs/SECURITY_ASSURANCE.md) - [API and import guide](docs/API.md) +- [All-pipeable beta experiment](docs/PIPEABLE_EXPERIMENT.md) - [Migrate from RxJS 7](MIGRATION.md) - [Unsupported RxJS 7 surfaces](docs/UNSUPPORTED_RXJS_7_SURFACES.md) - [Migration evidence ledger](docs/MIGRATION_EVIDENCE_LEDGER.md) diff --git a/packages/rxjs/docs/API.md b/packages/rxjs/docs/API.md index b82d3170f8..70bd31d9dc 100644 --- a/packages/rxjs/docs/API.md +++ b/packages/rxjs/docs/API.md @@ -1,13 +1,24 @@ # RxJS 9 API and import guide RxJS 9 separates the platform Observable contract from RxJS capabilities. -Import the root for intentional core primitives and import each operator or -factory from its own subpath. +This branch also contains a review-gated pipeable pilot at the root; the +existing Symbol catalog remains available from its current subpaths. ## Root exports ```ts -import { AsyncSubject, ColdObservable, ConnectableObservable, Subject, behaviorSubject, connectable, replaySubject } from 'rxjs'; +import { + AsyncSubject, + ColdObservable, + ConnectableObservable, + Subject, + behaviorSubject, + connectable, + filter, + map, + replaySubject, + rx, +} from 'rxjs'; ``` The root also exports notifications and public errors, including @@ -17,7 +28,27 @@ The root also exports notifications and public errors, including claiming that a Subject is cold. Importing `rxjs` conditionally initializes the platform Observable surface. It -does not install every RxJS operator. +does not install every Symbol operator. The experimental `map` and `filter` +root exports are ordinary pipeable functions and do not patch operator keys. + +## Pipeable pilot + +```ts +import { filter, map, rx } from 'rxjs'; + +const result = rx( + [1, 2, 3, 4], + filter((value) => value % 2 === 0), + map((value) => value * 10) +); + +result.subscribe(console.log); // 20, 40 +``` + +The root exports `ObservableInput`, `UnaryFunction`, `OperatorFunction`, and +`MonoTypeOperatorFunction` as supporting types. See the +[all-pipeable experiment](PIPEABLE_EXPERIMENT.md) for the overload horizon, +checking-cost tradeoffs, and unresolved import layout. ## Symbol operators @@ -70,8 +101,9 @@ const doubled = source[pipe]((values) => values[map]((value) => value * 2)); const normalized = Observable[pipe]([1, 2], (values) => values[map](String)); ``` -RxJS 9 does not install `.pipe`, publish RxJS 7 pipeable operator functions, -or restore `OperatorFunction`. +The existing Symbol form does not install `.pipe`. The review-gated root pilot +does publish `rx`, two pipeable operators, and `OperatorFunction`; it does not +yet convert the full catalog. ## Construction and input boundaries diff --git a/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md b/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md new file mode 100644 index 0000000000..501820c55b --- /dev/null +++ b/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md @@ -0,0 +1,150 @@ +# All-pipeable beta experiment + +This branch evaluates an all-pipeable RxJS 9 surface alongside the existing +exact-Symbol surface. It is deliberately small: the first review slice contains +`rx`, pipeable `map` and `filter`, the public composition types, and an internal +`operate` helper. The rest of the operator catalog and the Symbol import move +remain gated on maintainer review. + +The experiment does not change the platform foundation. `rx` converts its +first argument with the active realm's `Observable.from`; pipeable operators +construct through the receiver's RxJS creation protocol; source work remains +owned by the result Subscriber's `AbortSignal`. + +## Pipeable form + +```ts +import { filter, map, rx } from 'rxjs'; + +const result = rx( + [1, 2, 3, 4], + filter((value) => value % 2 === 0), + map((value, index) => `${index}: ${value * 10}`) +); + +result.subscribe(console.log); // '0: 20', '1: 40' +``` + +`rx` is not restricted to Observable-returning functions. The first function +receives the converted `Observable` and each later function receives the +preceding result. The final return type is therefore the final function's +return type. + +## Existing Symbol form + +```ts +import 'rxjs'; +import { filter } from 'rxjs/filter'; +import { map } from 'rxjs/map'; + +const source = Observable.from([1, 2, 3, 4]); +const result = source[filter]((value) => value % 2 === 0)[map]((value, index) => `${index}: ${value * 10}`); + +result.subscribe(console.log); // '0: 20', '1: 40' +``` + +The current deep imports still export Symbols. The proposed eventual shape is +for ordinary deep imports to export pipeable functions and for exact Symbols +to move under a clearly separate `rxjs/symbol` boundary. This pilot does not +perform that move because it would answer package-layout and barrel-versus- +per-operator questions before the implementation pattern is reviewed. + +## Platform method form + +```ts +import 'rxjs'; + +const result = Observable.from([1, 2, 3, 4]) + .filter((value) => value % 2 === 0) + .map((value) => value * 10); + +result.subscribe(console.log); // 20, 40 +``` + +This form is concise for methods the platform defines, but it cannot represent +the complete RxJS catalog. Platform terminal consumers such as `first`, +`last`, `reduce`, and `toArray` return Promises; the proposed RxJS pipeable +counterparts would be separate Observable-returning contracts. + +## Critical comparison + +| Concern | `rx` plus pipeable functions | Exact Symbol chaining | Platform methods | +| -------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| Visual flow | Reads left-to-right as a list of transformations and keeps punctuation light | Reads left-to-right on the value, but bracket access is unfamiliar and visually dense | Familiar method chaining with the least import ceremony | +| Catalog uniformity | One syntax can cover every RxJS operator, factory adapter, and terminal Observable | One syntax can cover the full RxJS catalog without taking string names | Limited to the standardized platform catalog | +| Type inference | Strong within the declared overload horizon; depends on contextual typing across one overloaded call | Each receiver call is inferred independently with no chain-length horizon | Each receiver call is inferred independently | +| Long chains | This pilot preserves nine transformations and returns `unknown` beyond that point | No fixed composition overload limit | No fixed composition overload limit | +| Type-error locality | An incompatibility can be reported at an overload boundary or later argument instead of exactly at the bad handoff | Usually points at the exact Symbol call whose receiver type is incompatible | Usually points at the exact method call | +| TypeScript work | More overloads increase declaration size and overload-resolution work at every call site | Work grows one ordinary call at a time | Work grows one ordinary call at a time | +| Runtime mutation | Pipeable functions do not install operator properties | Importing a capability patches its exact Symbol onto the active constructor or prototype | Owned by the native implementation or fallback | +| Collision behavior | Ordinary lexical imports; no global property collision | Exact module-owned Symbols isolate unrelated libraries and package copies | String names belong to the platform contract | +| Tree shaking | A function import can be removed when unused if the module remains side-effect-free | Capability imports are side effects and must be retained even when the Symbol binding appears unused | No RxJS operator module is needed | +| Native overlap | RxJS owns a distinct function contract even when the platform has the same familiar name | The distinct exact key makes the boundary explicit at the call site | Always selects the platform contract | +| Agent-generated code | Common JavaScript functional-composition syntax is easy to synthesize and refactor | Exact keys are unambiguous but require less familiar syntax | Familiar, but agents must know which names return Promises or lack RxJS behavior | + +Readability is subjective, but the tradeoffs are not. Pipeable syntax removes +the brackets users objected to and matches existing RxJS experience. Symbol +syntax has better unbounded chain inference, more local diagnostics, explicit +contract selection at native-overlap names, and exact-key collision isolation. +Platform methods have the best familiarity but cannot carry the complete RxJS +contract. + +## TypeScript limits and checking cost + +`rx` has explicit overloads for one through nine transformations. At each +position, the output type of one function becomes the input type of the next. +This gives good contextual inference for ordinary operator calls, including +type-guard and `Boolean` narrowing in `filter`. + +A tenth transformation is accepted by a fallback overload whose result is +`unknown`. This is an intentional safety boundary: returning `any` would hide +errors, while claiming a precise type would be false. Users can preserve types +by splitting a large pipeline into named functions or by assigning a segment +an explicit `OperatorFunction`. + +Two alternatives are possible, and neither is free: + +- Adding more fixed overloads extends the horizon but enlarges declarations + and gives TypeScript more candidates to evaluate at every `rx` call. +- A recursive variadic-tuple type can model longer heterogeneous chains, but it + tends to increase instantiation depth, checking time, and diagnostic + complexity. It must be benchmarked on representative Angular and TypeScript + projects before becoming a public contract. + +Overloaded operators can also lose contextual information when stored in an +unannotated variable before composition. An explicit `OperatorFunction` or +callback parameter type restores that information. Symbol and platform method +calls start from a concrete receiver type, so they are less exposed to that +particular failure mode. + +## Initial implementation pattern + +Pipeable operators are built with internal `operate(init)`. It returns an +`OperatorFunction` that creates its result through the source's versioned +RxJS construction protocol. The `init(source, subscriber)` body is wrapped in +`try/catch`, so synchronous connection failures become stream errors. + +Operators subscribe through the existing safe source helper. That helper owns +the result signal, guards notification overrides, forwards source terminal +events, and turns projector or predicate throws into `subscriber.error`. +Together these two boundaries cover setup-time and notification-time failures +without duplicating boilerplate in every operator. + +## Review gates before expanding the catalog + +The pilot intentionally leaves these decisions open: + +1. Whether pipeable deep imports should be `rxjs/map` and Symbols should be a + `rxjs/symbol` barrel, per-operator `rxjs/symbol/map` paths, or both. +2. Whether Symbol implementations delegate to pipeable implementations, both + delegate to shared internal logic, or they remain independent contracts. +3. Whether nine transformations is the right overload horizon and which + representative projects should supply type-check performance evidence. +4. Whether `operate` remains internal or becomes an advanced public API. +5. Which first Promise-returning platform consumer should be reimplemented as + an Observable-returning pipeable operator. +6. The exact lite `subscribe` result and whether `closed` is a snapshot or a + live getter over the backing `AbortSignal`. + +No broader operator conversion or package-path move should begin until this +first implementation is reviewed. From 8548929d7bec2013f141e55963a82df9eafa4648 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Thu, 6 Aug 2026 14:11:46 -0500 Subject: [PATCH 4/7] refactor(rxjs): incorporate pipeable pilot review --- docs/rxjs-next/ARCHITECTURE.md | 12 ++++-- docs/rxjs-next/COMPATIBILITY.md | 5 ++- docs/rxjs-next/DECISIONS.md | 34 +++++++++++++-- docs/rxjs-next/OPEN_QUESTIONS.md | 7 +++- docs/rxjs-next/PROJECT_PLAN.md | 2 +- docs/rxjs-next/RxJS-7-parity.md | 2 +- packages/observable-polyfill/src/index.ts | 28 +++++++++---- packages/rxjs/docs/API.md | 5 ++- packages/rxjs/docs/PIPEABLE_EXPERIMENT.md | 38 +++++++++++++---- .../rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md | 8 ++-- packages/rxjs/src/buffer-toggle.spec.ts | 6 +-- packages/rxjs/src/buffer-toggle.ts | 10 ++--- packages/rxjs/src/buffer.ts | 4 +- packages/rxjs/src/catch-error.spec.ts | 2 +- packages/rxjs/src/catch-error.ts | 4 +- packages/rxjs/src/cold-observable.ts | 8 ++-- packages/rxjs/src/combine-latest-all.spec.ts | 14 +++---- packages/rxjs/src/combine-latest-all.ts | 14 +++---- packages/rxjs/src/combine-latest.ts | 22 +++++----- packages/rxjs/src/combine.ts | 2 +- packages/rxjs/src/concat.ts | 6 +-- packages/rxjs/src/connect.spec.ts | 2 +- packages/rxjs/src/connect.ts | 6 +-- packages/rxjs/src/connectable.ts | 10 ++--- packages/rxjs/src/debounce.ts | 4 +- packages/rxjs/src/delay-when.spec.ts | 4 +- packages/rxjs/src/delay-when.ts | 4 +- packages/rxjs/src/distinct.ts | 4 +- packages/rxjs/src/exhaust-map.ts | 4 +- packages/rxjs/src/expand.spec.ts | 6 +-- packages/rxjs/src/expand.ts | 4 +- packages/rxjs/src/fork-join.ts | 16 +++---- packages/rxjs/src/group-by.ts | 14 +++---- packages/rxjs/src/index.ts | 2 +- packages/rxjs/src/map.ts | 18 +++----- packages/rxjs/src/merge-map.ts | 4 +- packages/rxjs/src/merge-scan.ts | 4 +- packages/rxjs/src/merge.ts | 6 +-- packages/rxjs/src/multicast.spec.ts | 2 +- packages/rxjs/src/multicast.ts | 6 +-- packages/rxjs/src/on-error-resume-next.ts | 8 ++-- packages/rxjs/src/partition.spec.ts | 4 +- packages/rxjs/src/partition.ts | 10 ++--- packages/rxjs/src/pipe.ts | 16 +++---- packages/rxjs/src/pipeable/filter.ts | 6 +-- packages/rxjs/src/pipeable/map.ts | 13 ++++-- packages/rxjs/src/pipeable/operate.ts | 2 +- packages/rxjs/src/pipeable/types.ts | 42 ++++--------------- packages/rxjs/src/publish-replay.spec.ts | 2 +- packages/rxjs/src/publish-replay.ts | 4 +- packages/rxjs/src/publish.spec.ts | 2 +- packages/rxjs/src/publish.ts | 4 +- packages/rxjs/src/race.ts | 8 ++-- packages/rxjs/src/repeat-when.spec.ts | 2 +- packages/rxjs/src/repeat-when.ts | 4 +- packages/rxjs/src/repeat.ts | 4 +- packages/rxjs/src/retry-when.spec.ts | 4 +- packages/rxjs/src/retry-when.ts | 4 +- packages/rxjs/src/retry.ts | 4 +- packages/rxjs/src/rx.ts | 2 +- packages/rxjs/src/sample.ts | 4 +- packages/rxjs/src/share.spec.ts | 4 +- packages/rxjs/src/share.ts | 8 ++-- packages/rxjs/src/skip-until.spec.ts | 2 +- packages/rxjs/src/skip-until.ts | 4 +- packages/rxjs/src/switch-map.ts | 4 +- packages/rxjs/src/switch-scan.ts | 4 +- packages/rxjs/src/take-until.spec.ts | 2 +- packages/rxjs/src/take-until.ts | 4 +- packages/rxjs/src/throttle.ts | 4 +- packages/rxjs/src/timeout.ts | 4 +- packages/rxjs/src/util/observable-helpers.ts | 2 +- packages/rxjs/src/util/types.ts | 8 ++-- packages/rxjs/src/window-toggle.spec.ts | 2 +- packages/rxjs/src/window-toggle.ts | 10 ++--- packages/rxjs/src/window-when.spec.ts | 2 +- packages/rxjs/src/window-when.ts | 6 +-- packages/rxjs/src/window.spec.ts | 4 +- packages/rxjs/src/window.ts | 4 +- packages/rxjs/src/with-latest-from.ts | 10 ++--- packages/rxjs/src/zip-all.spec.ts | 14 +++---- packages/rxjs/src/zip-all.ts | 16 +++---- packages/rxjs/src/zip-with.ts | 8 ++-- packages/rxjs/src/zip.ts | 14 +++---- .../rxjs/test/ported/capability-registry.json | 2 +- .../migration-evidence-ledger.generated.json | 2 +- .../generate-unsupported-surface-doc.mjs | 2 +- .../ported/unsupported-surface-catalog.json | 12 +++--- packages/rxjs/test/types/pipeable-api.ts | 4 +- 89 files changed, 355 insertions(+), 309 deletions(-) diff --git a/docs/rxjs-next/ARCHITECTURE.md b/docs/rxjs-next/ARCHITECTURE.md index 5c0c4264a3..b7ea964769 100644 --- a/docs/rxjs-next/ARCHITECTURE.md +++ b/docs/rxjs-next/ARCHITECTURE.md @@ -565,8 +565,9 @@ smaller than the proposed destination: - `rx(input, ...functions)` converts `input` through the active platform `Observable.from` and applies unary functions from left to right; -- public `ObservableInput`, `UnaryFunction`, `OperatorFunction`, and - `MonoTypeOperatorFunction` types describe the initial composition boundary; +- the ambient `ObservableInput` union names the platform conversion boundary; + public `UnaryFunction` and `OperatorFunction` type aliases + describe composition without a redundant mono-type alias; - pipeable `map` and `filter` are root exports and use an internal `operate` helper; - `operate` creates through the source's D-037 `[create]` protocol and catches @@ -574,6 +575,11 @@ smaller than the proposed destination: signal propagation and notification-callback safety; - all current Symbol modules, imports, installations, and tests remain intact. +The first maintainer review selected a shared internal callback for behavior +implemented by both public forms. Pipeable `map` and exact-Symbol `[map]` now +apply the same `mapOperator(project)` callback through `operate`; neither public +surface delegates through the other. + The pilot does not settle the package layout. In particular, `rxjs/map` and `rxjs/filter` still export their existing Symbols even though the root exports pipeable functions with those names. Moving exact Symbols to an @@ -1037,7 +1043,7 @@ catalog. An operator or factory subpath installs only its exported exact Symbol capability and internal kernel dependencies. The polyfill package owns the ambient TypeScript declarations for -`Observable`, `Subscriber`, `ObservableValue`, and `EventTarget.when`. +`Observable`, `Subscriber`, `ObservableInput`, and `EventTarget.when`. Individual `rxjs` entry points augment those base declarations only with the Symbols they export. `@rxjs/test` imports the public `ColdObservable` entry; that entry preserves an existing constructor or conditionally initializes the diff --git a/docs/rxjs-next/COMPATIBILITY.md b/docs/rxjs-next/COMPATIBILITY.md index 5623d4f7ca..1adf2fb8f8 100644 --- a/docs/rxjs-next/COMPATIBILITY.md +++ b/docs/rxjs-next/COMPATIBILITY.md @@ -235,8 +235,9 @@ support: The exact Symbol-addressed `[pipe]` remains an intentional Next API. D-060's parallel pilot now adds root `rx`, pipeable `map` and `filter`, plus -`UnaryFunction`, `OperatorFunction`, and `MonoTypeOperatorFunction`. These are -new Next contracts and do not imply that RxJS 7 import paths, scheduler +`UnaryFunction` and `OperatorFunction`. `OperatorFunction` replaces the +redundant `MonoTypeOperatorFunction` alias. These are new Next contracts and do +not imply that RxJS 7 import paths, scheduler overloads, broad `ObservableInput`, or `Subscription` behavior are restored. The initial `rx` overloads preserve exact types through nine transformations diff --git a/docs/rxjs-next/DECISIONS.md b/docs/rxjs-next/DECISIONS.md index 78e279f68f..15f0ab3a1d 100644 --- a/docs/rxjs-next/DECISIONS.md +++ b/docs/rxjs-next/DECISIONS.md @@ -606,7 +606,7 @@ Status meanings: - **Decision:** The exact Symbol-keyed `catchError` forwards ordinary source notifications and, on error, closes the failed source before invoking `selector(error, caught)`. A replacement accepts any platform - `ObservableValue`. Returning the exact `caught` object restarts the original + `ObservableInput`. Returning the exact `caught` object restarts the original source inside the current shared activation, using a synchronous trampoline instead of recursive stack growth. - **Rationale:** Subscribing to `caught` as an ordinary replacement would join @@ -887,7 +887,7 @@ Status meanings: - `@rxjs/observable-polyfill` is independently publishable, has no dependency on `rxjs`, supplies the conditional platform fallback, and owns the base ambient TypeScript declarations for `Observable`, `Subscriber`, - `ObservableValue`, and `EventTarget.when`. + `ObservableInput`, and `EventTarget.when`. - `rxjs` declares a runtime dependency on `@rxjs/observable-polyfill`. Its declarations augment the base platform types only for the exact Symbols imported by each entry point. @@ -1540,5 +1540,31 @@ Status meanings: - **Consequence if accepted:** D-003, D-039, D-040, and D-050 require narrow supersession rather than deletion. Package exports, documentation, migration guidance, bundle gates, and the root operator-isolation contract must be - revised together. The final `rxjs/map` versus `rxjs/symbol` layout and - implementation sharing model remain open until the pilot review. + revised together. The final `rxjs/map` versus `rxjs/symbol` layout remains + open after the first pilot review. + +### First review outcome + +- **Status:** Continue the proposed experiment +- **Direction:** Keep the direct `UnaryFunction` and + `OperatorFunction` aliases, omit `MonoTypeOperatorFunction`, and + share internal `operate` callbacks when pipeable and exact-Symbol forms have + the same behavior. `mapOperator(project)` is the first such callback. +- **Remaining proposal:** The package-path move, full-catalog conversion, + overload horizon, public-versus-internal `operate`, terminal consumers, and + lite subscription facade remain subject to later review. + +## D-061 — Name the platform conversion union `ObservableInput` + +- **Status:** Accepted +- **Decision:** Rename the ambient `ObservableValue` union to + `ObservableInput` directly. Do not publish a second alias for the same + union. +- **Rationale:** `ObservableInput` is the established RxJS 7 concept name and + communicates that the union describes values accepted by + `Observable.from`. Keeping both names would preserve an unnecessary new term + and make declarations and migration guidance less direct. +- **Consequence:** This is a breaking rename for exploratory RxJS Next users of + `ObservableValue`. The conversion categories remain platform Observable, + iterable, async iterable, and Promise-like values; arbitrary subscribables + and legacy interop objects are still excluded. diff --git a/docs/rxjs-next/OPEN_QUESTIONS.md b/docs/rxjs-next/OPEN_QUESTIONS.md index 8e1c22912c..a676cac35e 100644 --- a/docs/rxjs-next/OPEN_QUESTIONS.md +++ b/docs/rxjs-next/OPEN_QUESTIONS.md @@ -184,14 +184,17 @@ export exact Symbols. Before expanding the catalog, decide: - whether ordinary deep imports become pipeable functions; - whether Symbols move to one `rxjs/symbol` barrel, per-operator `rxjs/symbol/map` paths, or both; -- whether Symbol implementations delegate to pipeable implementations, both - call shared internal logic, or they remain independently specified; - whether `operate` is internal or public; - whether nine fixed transformations is the accepted `rx` type horizon or a different design passes representative type-check performance gates; - which Observable-returning terminal consumer and lite `subscribe` contract should be the next review slice. +The first review resolved implementation sharing for overlapping behavior: +both public forms use the same internal operator callback through `operate`, +beginning with `mapOperator`. Package layout, overload evidence, helper +visibility, and the exact next terminal/subscription contracts remain open. + Do not answer these questions implicitly through bulk file moves or operator conversion. The first pilot and its comparison document are the evidence for maintainer review. diff --git a/docs/rxjs-next/PROJECT_PLAN.md b/docs/rxjs-next/PROJECT_PLAN.md index 01310e4c52..1e0aa87905 100644 --- a/docs/rxjs-next/PROJECT_PLAN.md +++ b/docs/rxjs-next/PROJECT_PLAN.md @@ -768,7 +768,7 @@ diagrams. No implementation is required for this decision step. - Accepted `@rxjs/observable-polyfill`, `rxjs`, and `@rxjs/test` as the three target runtime products. Selected `@rxjs/observable` for physical removal in P0.3 with no archive, rename, or compatibility reuse. -- Assigned the base ambient `Observable`, `Subscriber`, `ObservableValue`, and +- Assigned the base ambient `Observable`, `Subscriber`, `ObservableInput`, and `EventTarget.when` declarations to the independently publishable polyfill package. `rxjs` owns subpath-scoped Symbol augmentations. At P0.2 acceptance, `@rxjs/test` remained implementation-neutral; D-043 later gave its explicit diff --git a/docs/rxjs-next/RxJS-7-parity.md b/docs/rxjs-next/RxJS-7-parity.md index ab41a48519..23374d10c5 100644 --- a/docs/rxjs-next/RxJS-7-parity.md +++ b/docs/rxjs-next/RxJS-7-parity.md @@ -47,7 +47,7 @@ pnpm --filter rxjs run test:unit:parity:check | `bufferTime` | Present; scheduler adapted to host timing | `source[bufferTime](span, creationInterval ?? null, maxBufferSize ?? Infinity)` | 18 | Preserves tumbling and overlapping host-time windows plus max-size closure. The adapter drops only a recognized trailing SchedulerLike fourth argument. Symbol source: `packages/rxjs/src/buffer-time.ts`; executable adapter: `bufferTimeExact`. | | `bufferToggle` | Present; parity unverified | `source[bufferToggle](openings, closingSelector)` | 18 | Supports overlapping buffers, closes on the first closing value but not closing completion, and flushes live buffers in opening order on source completion. Symbol source: `packages/rxjs/src/buffer-toggle.ts`; executable adapter: `identity`. | | `bufferWhen` | Partial unified mapping | `source[buffer]({ delay: closingSelector, emitEmpty: true, emitRemainingOnError: false })` | 16 | Uses the unified buffer delay selector and discards the active partial buffer when the source errors. Symbol source: `packages/rxjs/src/buffer.ts`; executable adapter: `bufferWhen`. | -| `catchError` | Present; parity unverified | `source[catchError](selector)` | 18 | Replaces source errors with any ObservableValue, preserves caught-source retry identity, and trampolines synchronous retries. Symbol source: `packages/rxjs/src/catch-error.ts`; executable adapter: `identity`. | +| `catchError` | Present; parity unverified | `source[catchError](selector)` | 18 | Replaces source errors with any ObservableInput, preserves caught-source retry identity, and trampolines synchronous retries. Symbol source: `packages/rxjs/src/catch-error.ts`; executable adapter: `identity`. | | `combineAll` | **Missing** | — | 0 | No current RxJS Next operator mapping. | | `combineLatest` | Partial unified mapping | `source[combineLatest]([otherSources])` | 34 | Adapts variadic sources to the current array form; projection overloads remain unrepresented. Symbol source: `packages/rxjs/src/combine-latest.ts`; executable adapter: `sourcesArrayWithProjection`. | | `combineLatestAll` | Present; parity unverified | `source[combineLatestAll](project?)` | 31 | Collects inner sources until outer completion, then delegates combination to the exact static combineLatest Symbol and projection to map. Symbol source: `packages/rxjs/src/combine-latest-all.ts`; executable adapter: `identity`. | diff --git a/packages/observable-polyfill/src/index.ts b/packages/observable-polyfill/src/index.ts index 44da7e6618..537d553491 100644 --- a/packages/observable-polyfill/src/index.ts +++ b/packages/observable-polyfill/src/index.ts @@ -541,7 +541,7 @@ function fromAsyncIterable(ObservableCtor: typeof Observable, value: objec } class ObservableImpl implements Subscribable { - static from(value: ObservableValue): Observable { + static from(value: ObservableInput): Observable { if (value instanceof Observable) { return value; } @@ -625,7 +625,7 @@ class ObservableImpl implements Subscribable { } } - takeUntil(notifier: ObservableValue): Observable { + takeUntil(notifier: ObservableInput): Observable { const ObservableCtor = instanceCtor(this); return new ObservableCtor((subscriber) => { Observable.from(notifier).subscribe( @@ -748,7 +748,7 @@ class ObservableImpl implements Subscribable { }); } - flatMap(mapper: (value: T, index: number) => ObservableValue): Observable { + flatMap(mapper: (value: T, index: number) => ObservableInput): Observable { const ObservableCtor = instanceCtor(this); return new ObservableCtor((subscriber) => { let index = 0; @@ -811,7 +811,7 @@ class ObservableImpl implements Subscribable { }); } - switchMap(mapper: (value: T, index: number) => ObservableValue): Observable { + switchMap(mapper: (value: T, index: number) => ObservableInput): Observable { const ObservableCtor = instanceCtor(this); return new ObservableCtor((subscriber) => { let innerController: AbortController | null = null; @@ -926,7 +926,7 @@ class ObservableImpl implements Subscribable { }); } - catch(handler: (error: any) => ObservableValue): Observable { + catch(handler: (error: any) => ObservableInput): Observable { const ObservableCtor = instanceCtor(this); return new ObservableCtor((subscriber) => { this.subscribe( @@ -1458,7 +1458,21 @@ declare global { subscribe(observer?: Partial> | ((value: T) => void) | null, options?: SubscribeOptions): void; } - type ObservableValue = Observable | AsyncIterable | PromiseLike | Iterable; + /** + * A value accepted by the active realm's `Observable.from` conversion + * boundary. + * + * @example Convert an iterable before applying RxJS operators + * ```ts + * import { map, rx } from 'rxjs'; + * + * const input: ObservableInput = [1, 2, 3]; + * const doubled = rx(input, map((value) => value * 2)); + * + * doubled.subscribe(console.log); // 2, 4, 6 + * ``` + */ + type ObservableInput = Observable | AsyncIterable | PromiseLike | Iterable; interface SubscribeOptions { signal?: AbortSignal; @@ -1478,7 +1492,7 @@ declare global { interface ObservableCtor { new (init: (subscriber: Subscriber) => void): Observable; - from(value: ObservableValue): Observable; + from(value: ObservableInput): Observable; } // eslint-disable-next-line no-var diff --git a/packages/rxjs/docs/API.md b/packages/rxjs/docs/API.md index 70bd31d9dc..b51449e9a4 100644 --- a/packages/rxjs/docs/API.md +++ b/packages/rxjs/docs/API.md @@ -45,8 +45,9 @@ const result = rx( result.subscribe(console.log); // 20, 40 ``` -The root exports `ObservableInput`, `UnaryFunction`, `OperatorFunction`, and -`MonoTypeOperatorFunction` as supporting types. See the +The ambient platform declarations expose `ObservableInput`; the root exports +`UnaryFunction` and `OperatorFunction` as supporting types. Use +`OperatorFunction` when an operator preserves its value type. See the [all-pipeable experiment](PIPEABLE_EXPERIMENT.md) for the overload horizon, checking-cost tradeoffs, and unresolved import layout. diff --git a/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md b/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md index 501820c55b..70f1558dd4 100644 --- a/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md +++ b/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md @@ -130,21 +130,43 @@ events, and turns projector or predicate throws into `subscriber.error`. Together these two boundaries cover setup-time and notification-time failures without duplicating boilerplate in every operator. +`mapOperator(project)` is the first shared implementation callback. Both the +pipeable `map(project)` function and the exact-Symbol `[map](project)` method +pass that callback through `operate`, so the two public forms share lifecycle, +index, cancellation, and callback-error behavior without making either form +delegate through the other's public API. + +## First maintainer review + +The first review approved continued work with four API corrections: + +- the ambient platform conversion union is named `ObservableInput` directly; + the temporary alias over `ObservableValue` is gone; +- `UnaryFunction` is a function type alias; +- `OperatorFunction` directly spells + `(source: Observable) => Observable`; +- the redundant `MonoTypeOperatorFunction` alias is not part of RxJS Next. + +The review also selected shared internal operator callbacks for implementations +used by both the pipeable and exact-Symbol forms, beginning with `mapOperator`. +This resolves the implementation-sharing question for the next pilot slice; +it does not yet settle the package-path move for the complete catalog. + ## Review gates before expanding the catalog The pilot intentionally leaves these decisions open: 1. Whether pipeable deep imports should be `rxjs/map` and Symbols should be a `rxjs/symbol` barrel, per-operator `rxjs/symbol/map` paths, or both. -2. Whether Symbol implementations delegate to pipeable implementations, both - delegate to shared internal logic, or they remain independent contracts. -3. Whether nine transformations is the right overload horizon and which +2. Whether nine transformations is the right overload horizon and which representative projects should supply type-check performance evidence. -4. Whether `operate` remains internal or becomes an advanced public API. -5. Which first Promise-returning platform consumer should be reimplemented as +3. Whether `operate` remains internal or becomes an advanced public API. +4. Which first Promise-returning platform consumer should be reimplemented as an Observable-returning pipeable operator. -6. The exact lite `subscribe` result and whether `closed` is a snapshot or a +5. The exact lite `subscribe` result and whether `closed` is a snapshot or a live getter over the backing `AbortSignal`. -No broader operator conversion or package-path move should begin until this -first implementation is reviewed. +The first implementation has now been reviewed. The next slice may add only a +small representative set covering an ordinary operator, an +Observable-returning terminal consumer, and the optional lite subscription +facade before returning for another review. diff --git a/packages/rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md b/packages/rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md index 7cfb1f0a7e..92cf0fd30f 100644 --- a/packages/rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md +++ b/packages/rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md @@ -9,7 +9,7 @@ Regenerate it with `pnpm --filter rxjs run test:unit:unsupported:generate`; the | Measure | Count | | -------------------- | ----: | | Catalog groups | 27 | -| Named surfaces | 147 | +| Named surfaces | 145 | | Manual Review groups | 5 | | Replace groups | 17 | | Unsupported groups | 5 | @@ -38,9 +38,9 @@ Regenerate it with `pnpm --filter rxjs run test:unit:unsupported:generate`; the | RxJS 7 surface | Disposition | Migration direction | Why | Decisions | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------- | -| `UnaryFunction`
`OperatorFunction`
`MonoTypeOperatorFunction` | Replace | Use ordinary typed functions with exact Symbol invocation or rxjs/pipe composition. | RxJS Next does not publish the pipeable-operator type family. | D-039, D-050 | +| `MonoTypeOperatorFunction` | Replace | Use the root OperatorFunction type for an operator that preserves its value type. | RxJS Next publishes direct UnaryFunction and OperatorFunction aliases without the redundant mono-type alias. | D-060 | | `Subscription`
`SubscriptionLike`
`Unsubscribable`
`TeardownLogic` | Replace | Use AbortController, AbortSignal, SubscribeOptions, and Subscriber.addTeardown inside producers. | subscribe() returns undefined and cancellation is signal-owned; no Subscription facade is published. | D-039, D-041, D-049 | -| `ObservableInput`
`ObservableLike`
`InteropObservable`
`Subscribable`
`SubscribableOrPromise`
`ReadableStreamLike` | Replace | Use the ambient ObservableValue/platform Observable.from input contract and review custom inputs manually. | The platform conversion boundary deliberately excludes arbitrary subscribables and legacy observable interop. | D-039, D-049 | +| `ObservableInput`
`ObservableLike`
`InteropObservable`
`Subscribable`
`SubscribableOrPromise`
`ReadableStreamLike` | Replace | Use the ambient ObservableInput/platform Observable.from input contract and review custom inputs manually. | The platform conversion boundary deliberately excludes arbitrary subscribables and legacy observable interop. | D-039, D-049 | | `NextObserver`
`ErrorObserver`
`CompletionObserver`
`PartialObserver`
`SubjectLike`
`Connectable` | Replace | Use ambient Observer/Subscriber shapes or the concrete intentional Subject/connectable APIs; define application protocols locally when needed. | These RxJS 7 helper interfaces are not a public Next import family. | D-035, D-039, D-040 | | `SchedulerLike`
`SchedulerAction`
`TimestampProvider` | Replace | Use host timing APIs, Date.now-compatible narrow providers where explicitly documented, and @rxjs/test virtual host time. | There is no general public scheduler abstraction in RxJS Next. | D-012, D-033, D-039 | | `FactoryOrValue`
`ObservedValueOf`
`ObservedValueUnionFromArray`
`ObservedValuesFromArray`
`ObservedValueTupleFromArray`
`ObservableInputTuple`
`Cons`
`Head`
`Tail`
`ValueFromArray`
`Falsy`
`TruthyTypesOf` | Unsupported | Use inference from the accepted Next API or application-owned utility types; do not deep-import RxJS internals. | These RxJS 7 implementation-facing inference helpers are not stable Next public types. | D-039, D-040 | @@ -57,7 +57,7 @@ Regenerate it with `pnpm --filter rxjs run test:unit:unsupported:generate`; the | RxJS 7 surface | Disposition | Migration direction | Why | Decisions | | ------------------------------------------------------------------------------------------------------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------- | -| `observable`
`Symbol.observable`
`@@observable`
`InteropObservable` | Unsupported | Expose a platform-supported ObservableValue category or wrap the source explicitly in the active realm. | Legacy observable interop is outside the accepted platform Observable.from contract. | D-039, D-049 | +| `observable`
`Symbol.observable`
`@@observable`
`InteropObservable` | Unsupported | Expose a platform-supported ObservableInput category or wrap the source explicitly in the active realm. | Legacy observable interop is outside the accepted platform Observable.from contract. | D-039, D-049 | | `objects with subscribe()`
`lowerCaseO`
`asInteropObservable`
`custom Subscribable` | Manual Review | Write an explicit application adapter that owns cancellation and terminal behavior, or choose a supported platform input category. | The 15 executable compatibility-only failures deliberately preserve this unsupported input boundary. | D-039, D-049 | | `foreign-realm Observable`
`cross-window Observable`
`cross-worker Observable`
`borrowed symbols on unrelated objects` | Unsupported | Initialize each realm independently and bridge values through an explicit application protocol. | RxJS does not traverse realms or promise generic Symbol borrowing onto unrelated receivers. | D-041, D-048, D-049 | | `Observable.lift`
`source/operator fields`
`custom Operator` | Replace | Use exact Symbol composition and the versioned derived-construction protocol through supported public capabilities. | The RxJS 7 lift/source/operator protocol is removed and is not a public Next subclass hook. | D-037, D-039, D-049 | diff --git a/packages/rxjs/src/buffer-toggle.spec.ts b/packages/rxjs/src/buffer-toggle.spec.ts index 2b817cb791..30a9800a52 100644 --- a/packages/rxjs/src/buffer-toggle.spec.ts +++ b/packages/rxjs/src/buffer-toggle.spec.ts @@ -37,7 +37,7 @@ describe('bufferToggle', () => { if (false) { // @ts-expect-error Both openings and a closing selector are required. source[bufferToggle](); - // @ts-expect-error The selector must return an ObservableValue. + // @ts-expect-error The selector must return an ObservableInput. source[bufferToggle](['open'], () => 1); // @ts-expect-error The selector parameter must match the opening value. source[bufferToggle](['open'], (opening: number) => [opening]); @@ -468,10 +468,10 @@ function tracked(): { }; } -function throwingIterable(error: unknown): ObservableValue { +function throwingIterable(error: unknown): ObservableInput { return Object.defineProperty({}, Symbol.iterator, { get() { throw error; }, - }) as ObservableValue; + }) as ObservableInput; } diff --git a/packages/rxjs/src/buffer-toggle.ts b/packages/rxjs/src/buffer-toggle.ts index 2d6917848e..764beca3bc 100644 --- a/packages/rxjs/src/buffer-toggle.ts +++ b/packages/rxjs/src/buffer-toggle.ts @@ -6,8 +6,8 @@ export const bufferToggle: unique symbol = Symbol('bufferToggle'); declare global { interface Observable { [bufferToggle]( - openings: ObservableValue, - closingSelector: (opening: Opening) => ObservableValue + openings: ObservableInput, + closingSelector: (opening: Opening) => ObservableInput ): Observable; } } @@ -19,8 +19,8 @@ interface BufferContext { Observable.prototype[bufferToggle] = function ( this: Observable, - openings: ObservableValue, - closingSelector: (opening: Opening) => ObservableValue + openings: ObservableInput, + closingSelector: (opening: Opening) => ObservableInput ): Observable { return this[create]((subscriber) => { let buffers: BufferContext[] = []; @@ -61,7 +61,7 @@ Observable.prototype[bufferToggle] = function ( buffers.push(context); closingControllers.add(context.closingController); - let closingValue: ObservableValue; + let closingValue: ObservableInput; try { closingValue = closingSelector(opening); } catch (error) { diff --git a/packages/rxjs/src/buffer.ts b/packages/rxjs/src/buffer.ts index bfafb8c541..42ee000b22 100644 --- a/packages/rxjs/src/buffer.ts +++ b/packages/rxjs/src/buffer.ts @@ -6,7 +6,7 @@ export const buffer: unique symbol = Symbol('buffer'); declare global { interface Observable { [buffer]: (config: { - delay?: number | (() => ObservableValue); + delay?: number | (() => ObservableInput); maxSize?: number; startEvery?: number; emitEmpty?: boolean; @@ -20,7 +20,7 @@ declare global { Observable.prototype[buffer] = function ( this: Observable, config: { - delay?: number | (() => ObservableValue); + delay?: number | (() => ObservableInput); maxSize?: number; startEvery?: number; emitEmpty?: boolean; diff --git a/packages/rxjs/src/catch-error.spec.ts b/packages/rxjs/src/catch-error.spec.ts index 94a211b5f6..1a27df1682 100644 --- a/packages/rxjs/src/catch-error.spec.ts +++ b/packages/rxjs/src/catch-error.spec.ts @@ -7,7 +7,7 @@ afterEach(() => { }); describe('catchError', () => { - it('replaces a failed source with any ObservableValue', () => { + it('replaces a failed source with any ObservableInput', () => { const failure = new Error('source failed'); const observations: Array = []; const source = new Observable((subscriber) => { diff --git a/packages/rxjs/src/catch-error.ts b/packages/rxjs/src/catch-error.ts index d68d54ef79..185ca24960 100644 --- a/packages/rxjs/src/catch-error.ts +++ b/packages/rxjs/src/catch-error.ts @@ -6,13 +6,13 @@ export const catchError: unique symbol = Symbol('catchError'); declare global { interface Observable { - [catchError]: >( + [catchError]: >( selector: (error: any, caught: Observable) => Replacement ) => Observable>; } } -Observable.prototype[catchError] = function >( +Observable.prototype[catchError] = function >( this: Observable, selector: (error: any, caught: Observable) => Replacement ): Observable> { diff --git a/packages/rxjs/src/cold-observable.ts b/packages/rxjs/src/cold-observable.ts index 2dc068a2a4..ea5a37e3c3 100644 --- a/packages/rxjs/src/cold-observable.ts +++ b/packages/rxjs/src/cold-observable.ts @@ -113,7 +113,7 @@ export class ColdObservable extends PlatformObservable { [create] = (init: (subscriber: Subscriber) => void): ColdObservable => new ColdObservable(init); - takeUntil(notifier: ObservableValue): Observable { + takeUntil(notifier: ObservableInput): Observable { return this.#asPlatformObservable().takeUntil(notifier); } @@ -133,11 +133,11 @@ export class ColdObservable extends PlatformObservable { return this.#asPlatformObservable().drop(amount); } - flatMap(mapper: (value: T, index: number) => ObservableValue): Observable { + flatMap(mapper: (value: T, index: number) => ObservableInput): Observable { return this.#asPlatformObservable().flatMap(mapper); } - switchMap(mapper: (value: T, index: number) => ObservableValue): Observable { + switchMap(mapper: (value: T, index: number) => ObservableInput): Observable { return this.#asPlatformObservable().switchMap(mapper); } @@ -145,7 +145,7 @@ export class ColdObservable extends PlatformObservable { return this.#asPlatformObservable().inspect(inspector); } - catch(handler: (error: any) => ObservableValue): Observable { + catch(handler: (error: any) => ObservableInput): Observable { return this.#asPlatformObservable().catch(handler); } diff --git a/packages/rxjs/src/combine-latest-all.spec.ts b/packages/rxjs/src/combine-latest-all.spec.ts index 2cf8503753..25d8f0f64a 100644 --- a/packages/rxjs/src/combine-latest-all.spec.ts +++ b/packages/rxjs/src/combine-latest-all.spec.ts @@ -56,7 +56,7 @@ describe('combineLatestAll', () => { it('supports an optional result selector', () => { const results: Array = []; - fromValues>(Observable.from(['a']), Observable.from([1])) + fromValues>(Observable.from(['a']), Observable.from([1])) [combineLatestAll]((letter, number) => `${letter}${number}`) .subscribe({ next: (value) => results.push(value), @@ -94,7 +94,7 @@ describe('combineLatestAll', () => { const right = controllable(); const errors: unknown[] = []; - fromValues>(left.observable, right.observable) + fromValues>(left.observable, right.observable) [combineLatestAll]() .subscribe({ error: (error) => errors.push(error), @@ -114,7 +114,7 @@ describe('combineLatestAll', () => { const right = controllable(); const errors: unknown[] = []; - fromValues>(left.observable, right.observable) + fromValues>(left.observable, right.observable) [combineLatestAll](() => { throw failure; }) @@ -136,7 +136,7 @@ describe('combineLatestAll', () => { const controller = new AbortController(); const observations: string[] = []; - fromValues>(never.observable, []) + fromValues>(never.observable, []) [combineLatestAll]() .subscribe({ next: () => observations.push('next'), @@ -157,7 +157,7 @@ describe('combineLatestAll', () => { const right = controllable(); const observations: number[][] = []; - fromValues>(left.observable, right.observable) + fromValues>(left.observable, right.observable) [combineLatestAll]() .subscribe((value) => { observations.push(value); @@ -178,8 +178,8 @@ describe('combineLatestAll', () => { const left = controllable(); const right = controllable(); let outerActivations = 0; - let outerSubscriber: Subscriber> | undefined; - const outer = new Observable>((subscriber) => { + let outerSubscriber: Subscriber> | undefined; + const outer = new Observable>((subscriber) => { outerActivations++; outerSubscriber = subscriber; }); diff --git a/packages/rxjs/src/combine-latest-all.ts b/packages/rxjs/src/combine-latest-all.ts index e15a6e232a..e5f7f4d0d8 100644 --- a/packages/rxjs/src/combine-latest-all.ts +++ b/packages/rxjs/src/combine-latest-all.ts @@ -3,10 +3,10 @@ import { create } from './create.js'; import { map } from './map.js'; import { subscribeToSource } from './util/observable-helpers.js'; -type ObservedValueOf = Input extends ObservableValue ? Value : never; +type ObservedValueOf = Input extends ObservableInput ? Value : never; type IsUnion = Input extends Whole ? ([Whole] extends [Input] ? false : true) : never; type ProjectValues = true extends IsUnion ? any[] : Array>; -type CombineLatestAllMethod = [Input] extends [ObservableValue] +type CombineLatestAllMethod = [Input] extends [ObservableInput] ? { (): Observable>>; (project: (...values: ProjectValues) => Result): Observable; @@ -21,14 +21,14 @@ declare global { } } -function combineLatestAllOperator(this: Observable>): Observable; -function combineLatestAllOperator(this: Observable>, project: (...values: V[]) => R): Observable; -function combineLatestAllOperator(this: Observable>, project: (...values: any[]) => R): Observable; -function combineLatestAllOperator(this: Observable>, project?: (...values: V[]) => R): Observable { +function combineLatestAllOperator(this: Observable>): Observable; +function combineLatestAllOperator(this: Observable>, project: (...values: V[]) => R): Observable; +function combineLatestAllOperator(this: Observable>, project: (...values: any[]) => R): Observable; +function combineLatestAllOperator(this: Observable>, project?: (...values: V[]) => R): Observable { const outer = this; return outer[create]((subscriber) => { - const sources: Array> = []; + const sources: Array> = []; subscribeToSource(outer, subscriber, { next: (source) => sources.push(source), diff --git a/packages/rxjs/src/combine-latest.ts b/packages/rxjs/src/combine-latest.ts index 31494372a3..d4d0a3ffbe 100644 --- a/packages/rxjs/src/combine-latest.ts +++ b/packages/rxjs/src/combine-latest.ts @@ -2,12 +2,12 @@ import { combine } from './combine.js'; import { map } from './map.js'; import { isObservableInstance } from './util/ctor-helpers.js'; -type CombineLatestValues[] | { [key: string]: ObservableValue }> = { - [K in keyof Sources]: Sources[K] extends ObservableValue ? T : never; +type CombineLatestValues[] | { [key: string]: ObservableInput }> = { + [K in keyof Sources]: Sources[K] extends ObservableInput ? T : never; }; -type CombineLatestArrayValues[]> = { - [K in keyof Sources]: Sources[K] extends ObservableValue ? T : never; +type CombineLatestArrayValues[]> = { + [K in keyof Sources]: Sources[K] extends ObservableInput ? T : never; }; export const combineLatest: unique symbol = Symbol('combineLatest'); @@ -15,11 +15,11 @@ export const combineLatest: unique symbol = Symbol('combineLatest'); declare global { interface ObservableCtor { [combineLatest]: { - [] | { [key: string]: ObservableValue }>( + [] | { [key: string]: ObservableInput }>( sources: Sources, config?: { requireAllValues?: boolean } ): Observable>; - [], Result>( + [], Result>( sources: Sources, project: (...values: CombineLatestArrayValues) => Result ): Observable; @@ -28,10 +28,10 @@ declare global { interface Observable { [combineLatest]: { - []>(sources: Sources, config?: { requireAllValues?: boolean }): Observable< + []>(sources: Sources, config?: { requireAllValues?: boolean }): Observable< [T, ...CombineLatestArrayValues] >; - [], Result>( + [], Result>( sources: Sources, project: (value: T, ...values: CombineLatestArrayValues) => Result ): Observable; @@ -42,7 +42,7 @@ declare global { Observable[combineLatest] = combineLatestImpl; Observable.prototype[combineLatest] = combineLatestImpl; -function combineLatestImpl[] | { [key: string]: ObservableValue }>( +function combineLatestImpl[] | { [key: string]: ObservableInput }>( this: ObservableCtor | Observable, sources: Sources, configOrProject?: { requireAllValues?: boolean } | ((...values: any[]) => any) @@ -64,7 +64,7 @@ function combineLatestImpl[] | { [ return project === undefined ? (combined as any) : combined[map]((values) => project(...values)); } - const actualSources: readonly ObservableValue[] | { [key: string]: ObservableValue } = Array.isArray(sources) + const actualSources: readonly ObservableInput[] | { [key: string]: ObservableInput } = Array.isArray(sources) ? [...sources] : { ...sources }; @@ -91,6 +91,6 @@ function combineLatestImpl[] | { [ } } -function isSourceArray(sources: any): sources is readonly ObservableValue[] { +function isSourceArray(sources: any): sources is readonly ObservableInput[] { return Array.isArray(sources); } diff --git a/packages/rxjs/src/combine.ts b/packages/rxjs/src/combine.ts index ee54fa8f3e..c6dd28cd8b 100644 --- a/packages/rxjs/src/combine.ts +++ b/packages/rxjs/src/combine.ts @@ -6,7 +6,7 @@ export const combine: unique symbol = Symbol('combine'); declare global { interface CombineItem { - source: ObservableValue; + source: ObservableInput; causesEmit?: boolean; requireFirstValue?: boolean; } diff --git a/packages/rxjs/src/concat.ts b/packages/rxjs/src/concat.ts index 76ab84a20e..7320e06e15 100644 --- a/packages/rxjs/src/concat.ts +++ b/packages/rxjs/src/concat.ts @@ -5,11 +5,11 @@ export const concat: unique symbol = Symbol('concat'); declare global { interface ObservableCtor { - [concat]: []>(otherSources: Sources) => Observable>; + [concat]: []>(otherSources: Sources) => Observable>; } interface Observable { - [concat]: []>( + [concat]: []>( otherSources: Sources ) => Observable>; } @@ -18,7 +18,7 @@ declare global { Observable[concat] = concatImpl; Observable.prototype[concat] = concatImpl; -function concatImpl[]>( +function concatImpl[]>( this: ObservableCtor | Observable, sources: Sources ): Observable> { diff --git a/packages/rxjs/src/connect.spec.ts b/packages/rxjs/src/connect.spec.ts index a9ff6d5099..0d4c355780 100644 --- a/packages/rxjs/src/connect.spec.ts +++ b/packages/rxjs/src/connect.spec.ts @@ -47,7 +47,7 @@ describe('connect', () => { if (false) { // @ts-expect-error A selector is required. source[connect](); - // @ts-expect-error The selector must return an ObservableValue. + // @ts-expect-error The selector must return an ObservableInput. source[connect](() => 1); // @ts-expect-error The connector must return a SubjectLike. source[connect]((shared) => shared, { connector: () => Observable.from([1]) }); diff --git a/packages/rxjs/src/connect.ts b/packages/rxjs/src/connect.ts index c3bfd02fb7..752c427f3e 100644 --- a/packages/rxjs/src/connect.ts +++ b/packages/rxjs/src/connect.ts @@ -11,14 +11,14 @@ export interface ConnectConfig { declare global { interface Observable { - [connect]>( + [connect]>( selector: (shared: Observable) => Selected, config?: ConnectConfig ): Observable>; } } -Observable.prototype[connect] = function >( +Observable.prototype[connect] = function >( this: Observable, selector: (shared: Observable) => Selected, config?: ConnectConfig @@ -61,7 +61,7 @@ Observable.prototype[connect] = function >; try { - selected = Observable.from(selectedValue as ObservableValue>); + selected = Observable.from(selectedValue as ObservableInput>); } catch (error) { subscriber.error(error); return; diff --git a/packages/rxjs/src/connectable.ts b/packages/rxjs/src/connectable.ts index a429981951..c54dd5a0c3 100644 --- a/packages/rxjs/src/connectable.ts +++ b/packages/rxjs/src/connectable.ts @@ -46,13 +46,13 @@ class Connection implements ConnectableConnection { } export class ConnectableObservable extends Observable { - readonly source: ObservableValue; + readonly source: ObservableInput; protected readonly subjectFactory: () => SubjectLike; readonly #state: ConnectableState; - constructor(source: ObservableValue, subjectFactory: () => SubjectLike); - constructor(source: ObservableValue, config?: ConnectableConfig); - constructor(source: ObservableValue, configOrSubjectFactory?: ConnectableConfig | (() => SubjectLike)) { + constructor(source: ObservableInput, subjectFactory: () => SubjectLike); + constructor(source: ObservableInput, config?: ConnectableConfig); + constructor(source: ObservableInput, configOrSubjectFactory?: ConnectableConfig | (() => SubjectLike)) { const connector = typeof configOrSubjectFactory === 'function' ? configOrSubjectFactory : configOrSubjectFactory?.connector ?? (() => new Subject()); const resetOnDisconnect = typeof configOrSubjectFactory === 'function' ? true : configOrSubjectFactory?.resetOnDisconnect ?? true; @@ -186,7 +186,7 @@ export class ConnectableObservable extends Observable { } } -export function connectable(source: ObservableValue, config?: ConnectableConfig): ConnectableObservable { +export function connectable(source: ObservableInput, config?: ConnectableConfig): ConnectableObservable { return new ConnectableObservable(source, config); } diff --git a/packages/rxjs/src/debounce.ts b/packages/rxjs/src/debounce.ts index 5c70e03893..620cc2afc1 100644 --- a/packages/rxjs/src/debounce.ts +++ b/packages/rxjs/src/debounce.ts @@ -5,13 +5,13 @@ export const debounce: unique symbol = Symbol('debounce'); declare global { interface Observable { - [debounce]: (delay: number | ((value: T, index: number) => ObservableValue)) => Observable; + [debounce]: (delay: number | ((value: T, index: number) => ObservableInput)) => Observable; } } Observable.prototype[debounce] = function ( this: Observable, - delay: number | ((value: T, index: number) => ObservableValue) + delay: number | ((value: T, index: number) => ObservableInput) ): Observable { return this[create]((subscriber) => { let innerController: AbortController | null = null; diff --git a/packages/rxjs/src/delay-when.spec.ts b/packages/rxjs/src/delay-when.spec.ts index 03ced7565d..f4721e5838 100644 --- a/packages/rxjs/src/delay-when.spec.ts +++ b/packages/rxjs/src/delay-when.spec.ts @@ -34,7 +34,7 @@ describe('delayWhen', () => { if (false) { // @ts-expect-error A duration selector is required. source[delayWhen](); - // @ts-expect-error A duration selector must return an ObservableValue. + // @ts-expect-error A duration selector must return an ObservableInput. source[delayWhen](() => 1); // @ts-expect-error The optional subscription delay is an Observable in RxJS 7. source[delayWhen](() => [], Promise.resolve()); @@ -118,7 +118,7 @@ describe('delayWhen', () => { const conversionSource = controllable(); const conversionErrors: unknown[] = []; - conversionSource.observable[delayWhen](() => ({} as ObservableValue)).subscribe({ + conversionSource.observable[delayWhen](() => ({} as ObservableInput)).subscribe({ error: (error) => conversionErrors.push(error), }); conversionSource.subscriber.next(1); diff --git a/packages/rxjs/src/delay-when.ts b/packages/rxjs/src/delay-when.ts index c5e543020b..b05b191d95 100644 --- a/packages/rxjs/src/delay-when.ts +++ b/packages/rxjs/src/delay-when.ts @@ -5,7 +5,7 @@ export const delayWhen: unique symbol = Symbol('delayWhen'); declare global { interface Observable { - [delayWhen](durationSelector: (value: T, index: number) => ObservableValue, subscriptionDelay?: Observable): Observable; + [delayWhen](durationSelector: (value: T, index: number) => ObservableInput, subscriptionDelay?: Observable): Observable; } } @@ -16,7 +16,7 @@ interface DelayContext { Observable.prototype[delayWhen] = function ( this: Observable, - durationSelector: (value: T, index: number) => ObservableValue, + durationSelector: (value: T, index: number) => ObservableInput, subscriptionDelay?: Observable ): Observable { const source = this; diff --git a/packages/rxjs/src/distinct.ts b/packages/rxjs/src/distinct.ts index 395364f906..48f64b120f 100644 --- a/packages/rxjs/src/distinct.ts +++ b/packages/rxjs/src/distinct.ts @@ -5,14 +5,14 @@ export const distinct: unique symbol = Symbol('distinct'); declare global { interface Observable { - [distinct]: (keySelector?: (value: T) => K, flushes?: ObservableValue) => Observable; + [distinct]: (keySelector?: (value: T) => K, flushes?: ObservableInput) => Observable; } } Observable.prototype[distinct] = function ( this: Observable, keySelector?: (value: T) => K, - flushes?: ObservableValue + flushes?: ObservableInput ): Observable { return this[create]((subscriber) => { const keys = new Set(); diff --git a/packages/rxjs/src/exhaust-map.ts b/packages/rxjs/src/exhaust-map.ts index b81265923b..ad5f0df54d 100644 --- a/packages/rxjs/src/exhaust-map.ts +++ b/packages/rxjs/src/exhaust-map.ts @@ -6,7 +6,7 @@ export const exhaustMap: unique symbol = Symbol('exhaustMap'); declare global { interface Observable { [exhaustMap]: ( - mapper: (value: T, index: number) => ObservableValue, + mapper: (value: T, index: number) => ObservableInput, options?: { concurrent?: number; } @@ -16,7 +16,7 @@ declare global { Observable.prototype[exhaustMap] = function ( this: Observable, - mapper: (value: T, index: number) => ObservableValue, + mapper: (value: T, index: number) => ObservableInput, options?: { concurrent?: number } ): Observable { return this[create]((subscriber) => { diff --git a/packages/rxjs/src/expand.spec.ts b/packages/rxjs/src/expand.spec.ts index 503cae494c..d75fae6e11 100644 --- a/packages/rxjs/src/expand.spec.ts +++ b/packages/rxjs/src/expand.spec.ts @@ -129,7 +129,7 @@ describe('expand', () => { expect(values.at(-1)).toBe(10_000); }); - it('converts iterable projections as ObservableValue inputs', () => { + it('converts iterable projections as ObservableInput inputs', () => { const values: number[] = []; Observable.from([1]) @@ -171,9 +171,9 @@ describe('expand', () => { expect(events).toEqual([1, failure]); }); - it('propagates ObservableValue conversion errors after emitting the input value', () => { + it('propagates ObservableInput conversion errors after emitting the input value', () => { const events: unknown[] = []; - const invalidInput = {} as ObservableValue; + const invalidInput = {} as ObservableInput; Observable.from([1]) [expand](() => invalidInput) diff --git a/packages/rxjs/src/expand.ts b/packages/rxjs/src/expand.ts index e5f0926cc2..c3dc431c4c 100644 --- a/packages/rxjs/src/expand.ts +++ b/packages/rxjs/src/expand.ts @@ -9,13 +9,13 @@ export interface ExpandOptions { declare global { interface Observable { - [expand](project: (value: T, index: number) => ObservableValue, options?: ExpandOptions): Observable; + [expand](project: (value: T, index: number) => ObservableInput, options?: ExpandOptions): Observable; } } Observable.prototype[expand] = function ( this: Observable, - project: (value: T, index: number) => ObservableValue, + project: (value: T, index: number) => ObservableInput, options?: ExpandOptions ): Observable { if (arguments.length > 2) { diff --git a/packages/rxjs/src/fork-join.ts b/packages/rxjs/src/fork-join.ts index 787bbe417d..cf45c561aa 100644 --- a/packages/rxjs/src/fork-join.ts +++ b/packages/rxjs/src/fork-join.ts @@ -3,11 +3,11 @@ import { subscribeToSource } from './util/observable-helpers.js'; declare const anyCatcher: unique symbol; type AnyCatcher = typeof anyCatcher; -type ObservedValueOf = Input extends ObservableValue ? Value : never; -type ForkJoinTuple[]> = { +type ObservedValueOf = Input extends ObservableInput ? Value : never; +type ForkJoinTuple[]> = { -readonly [K in keyof Sources]: ObservedValueOf; }; -type ForkJoinObject>> = { +type ForkJoinObject>> = { [K in keyof Sources]: ObservedValueOf; }; @@ -15,16 +15,16 @@ interface ForkJoinMethod { (arg: T): Observable; (): Observable; (sources: readonly []): Observable; - []>(sources: Sources): Observable>; - [], Result>( + []>(sources: Sources): Observable>; + [], Result>( sources: Sources, resultSelector: (...values: ForkJoinTuple) => Result ): Observable; (sourcesObject: Record): Observable; - >>(sourcesObject: Sources): Observable>; + >>(sourcesObject: Sources): Observable>; (source: null | undefined): Observable; - []>(...sources: Sources): Observable>; - [], Result>( + []>(...sources: Sources): Observable>; + [], Result>( ...sourcesAndResultSelector: [...Sources, (...values: ForkJoinTuple) => Result] ): Observable; } diff --git a/packages/rxjs/src/group-by.ts b/packages/rxjs/src/group-by.ts index d13fe0c3dd..f87d4114c9 100644 --- a/packages/rxjs/src/group-by.ts +++ b/packages/rxjs/src/group-by.ts @@ -8,7 +8,7 @@ export interface KeyedGroupObservable extends Observable { export interface GroupByOptions { element?: (value: T) => E; - duration?: (group: KeyedGroupObservable) => ObservableValue; + duration?: (group: KeyedGroupObservable) => ObservableInput; connector?: () => SubjectLike; } @@ -28,13 +28,13 @@ declare global { ( keySelector: (value: T) => K, element: (value: T) => E, - duration?: (group: KeyedGroupObservable) => ObservableValue, + duration?: (group: KeyedGroupObservable) => ObservableInput, connector?: () => SubjectLike ): Observable>; ( keySelector: (value: T) => K, element: undefined, - duration: (group: KeyedGroupObservable) => ObservableValue, + duration: (group: KeyedGroupObservable) => ObservableInput, connector?: () => SubjectLike ): Observable>; }; @@ -67,21 +67,21 @@ function groupByOperator( this: Observable, keySelector: (value: T) => K, element: (value: T) => E, - duration?: (group: KeyedGroupObservable) => ObservableValue, + duration?: (group: KeyedGroupObservable) => ObservableInput, connector?: () => SubjectLike ): Observable>; function groupByOperator( this: Observable, keySelector: (value: T) => K, element: undefined, - duration: (group: KeyedGroupObservable) => ObservableValue, + duration: (group: KeyedGroupObservable) => ObservableInput, connector?: () => SubjectLike ): Observable>; function groupByOperator( this: Observable, keySelector: (value: T) => K, elementOrOptions?: ((value: T) => E) | GroupByOptions, - legacyDuration?: (group: KeyedGroupObservable) => ObservableValue, + legacyDuration?: (group: KeyedGroupObservable) => ObservableInput, legacyConnector?: () => SubjectLike ): Observable { const source = this; @@ -202,7 +202,7 @@ function groupByOperator( return; } - let durationValue: ObservableValue; + let durationValue: ObservableInput; try { durationValue = duration(entry.durationView); } catch (error) { diff --git a/packages/rxjs/src/index.ts b/packages/rxjs/src/index.ts index 6215d84eb2..9d60501956 100644 --- a/packages/rxjs/src/index.ts +++ b/packages/rxjs/src/index.ts @@ -23,7 +23,7 @@ export { export { PerSubscriptionSubjectBase } from './per-subscription-subject-base.js'; export { filter } from './pipeable/filter.js'; export { map } from './pipeable/map.js'; -export type { MonoTypeOperatorFunction, ObservableInput, OperatorFunction, UnaryFunction } from './pipeable/types.js'; +export type { OperatorFunction, UnaryFunction } from './pipeable/types.js'; export { replaySubject, type ReplaySubjectConfig } from './replay-subject.js'; export { rx } from './rx.js'; export { SequenceError } from './sequence-error.js'; diff --git a/packages/rxjs/src/map.ts b/packages/rxjs/src/map.ts index e25577509a..e2cde588db 100644 --- a/packages/rxjs/src/map.ts +++ b/packages/rxjs/src/map.ts @@ -1,5 +1,5 @@ -import { create } from './create.js'; -import { subscribeToSource } from './util/observable-helpers.js'; +import { mapOperator } from './pipeable/map.js'; +import { operate } from './pipeable/operate.js'; export const map: unique symbol = Symbol('map'); @@ -11,16 +11,8 @@ declare global { } } -function mapOperator(this: Observable, project: (value: T, index: number) => R): Observable { - return this[create]((subscriber) => { - let index = 0; - - subscribeToSource(this, subscriber, { - next(value) { - subscriber.next(project(value, index++)); - }, - }); - }); +function mapSymbolOperator(this: Observable, project: (value: In, index: number) => Out): Observable { + return operate(mapOperator(project))(this); } -Observable.prototype[map] = mapOperator; +Observable.prototype[map] = mapSymbolOperator; diff --git a/packages/rxjs/src/merge-map.ts b/packages/rxjs/src/merge-map.ts index c927a6e5aa..e013894746 100644 --- a/packages/rxjs/src/merge-map.ts +++ b/packages/rxjs/src/merge-map.ts @@ -5,13 +5,13 @@ export const mergeMap: unique symbol = Symbol('mergeMap'); declare global { interface Observable { - [mergeMap]: (mapper: (value: T, index: number) => ObservableValue, options?: { concurrent?: number }) => Observable; + [mergeMap]: (mapper: (value: T, index: number) => ObservableInput, options?: { concurrent?: number }) => Observable; } } Observable.prototype[mergeMap] = function ( this: Observable, - mapper: (value: T, index: number) => ObservableValue, + mapper: (value: T, index: number) => ObservableInput, options?: { concurrent?: number } ): Observable { const { concurrent = Infinity } = options ?? {}; diff --git a/packages/rxjs/src/merge-scan.ts b/packages/rxjs/src/merge-scan.ts index de2af287df..74baabadb5 100644 --- a/packages/rxjs/src/merge-scan.ts +++ b/packages/rxjs/src/merge-scan.ts @@ -6,7 +6,7 @@ export const mergeScan: unique symbol = Symbol('mergeScan'); declare global { interface Observable { [mergeScan]( - accumulator: (accumulator: R, value: T, index: number) => ObservableValue, + accumulator: (accumulator: R, value: T, index: number) => ObservableInput, seed: R, concurrent?: number ): Observable; @@ -15,7 +15,7 @@ declare global { Observable.prototype[mergeScan] = function ( this: Observable, - accumulator: (accumulator: R, value: T, index: number) => ObservableValue, + accumulator: (accumulator: R, value: T, index: number) => ObservableInput, seed: R, concurrent = Infinity ): Observable { diff --git a/packages/rxjs/src/merge.ts b/packages/rxjs/src/merge.ts index 5e5ef57b6a..011360d1e2 100644 --- a/packages/rxjs/src/merge.ts +++ b/packages/rxjs/src/merge.ts @@ -7,14 +7,14 @@ export const merge: unique symbol = Symbol('merge'); declare global { interface ObservableCtor { - [merge]: []>( + [merge]: []>( sources: Sources, config?: { concurrency?: number } ) => Observable>; } interface Observable { - [merge]: []>( + [merge]: []>( sources: Sources, config?: { concurrency?: number } ) => Observable>; @@ -24,7 +24,7 @@ declare global { Observable[merge] = mergeImpl; Observable.prototype[merge] = mergeImpl; -function mergeImpl[]>( +function mergeImpl[]>( this: Observable | ObservableCtor, sources: Sources, config?: { concurrency?: number } diff --git a/packages/rxjs/src/multicast.spec.ts b/packages/rxjs/src/multicast.spec.ts index 145c743650..808ac8b56c 100644 --- a/packages/rxjs/src/multicast.spec.ts +++ b/packages/rxjs/src/multicast.spec.ts @@ -51,7 +51,7 @@ describe('multicast', () => { source[multicast](); // @ts-expect-error The first argument must be a SubjectLike or factory. source[multicast](source); - // @ts-expect-error A selector must return an ObservableValue. + // @ts-expect-error A selector must return an ObservableInput. source[multicast](subject, () => 1); // @ts-expect-error The factory subject value type must match the source. source[multicast](() => new Subject()); diff --git a/packages/rxjs/src/multicast.ts b/packages/rxjs/src/multicast.ts index d4beb5936c..3007b21f27 100644 --- a/packages/rxjs/src/multicast.ts +++ b/packages/rxjs/src/multicast.ts @@ -8,18 +8,18 @@ declare global { interface Observable { [multicast](subject: SubjectLike): ConnectableObservable; [multicast](subjectFactory: () => SubjectLike): ConnectableObservable; - [multicast]>( + [multicast]>( subject: SubjectLike, selector: (shared: Observable) => Selected ): Observable>; - [multicast]>( + [multicast]>( subjectFactory: () => SubjectLike, selector: (shared: Observable) => Selected ): Observable>; } } -Observable.prototype[multicast] = function >( +Observable.prototype[multicast] = function >( this: Observable, subjectOrFactory: SubjectLike | (() => SubjectLike), selector?: (shared: Observable) => Selected diff --git a/packages/rxjs/src/on-error-resume-next.ts b/packages/rxjs/src/on-error-resume-next.ts index 5f4263a67f..b85ee5f803 100644 --- a/packages/rxjs/src/on-error-resume-next.ts +++ b/packages/rxjs/src/on-error-resume-next.ts @@ -8,13 +8,13 @@ export const onErrorResumeNext: unique symbol = Symbol('onErrorResumeNext'); declare global { interface ObservableCtor { - [onErrorResumeNext]: []>( + [onErrorResumeNext]: []>( sources: Sources ) => Observable>; } interface Observable { - [onErrorResumeNext]: []>( + [onErrorResumeNext]: []>( sources: Sources ) => Observable>; } @@ -23,11 +23,11 @@ declare global { Observable[onErrorResumeNext] = onErrorResumeNextImpl; Observable.prototype[onErrorResumeNext] = onErrorResumeNextImpl; -function onErrorResumeNextImpl[]>( +function onErrorResumeNextImpl[]>( this: ObservableCtor | Observable, sources: Sources ): Observable> { - const actualSources: readonly ObservableValue[] = isObservableInstance(this) ? [this, ...sources] : sources; + const actualSources: readonly ObservableInput[] = isObservableInstance(this) ? [this, ...sources] : sources; return this[create]((subscriber) => { let currentSourceIndex = 0; diff --git a/packages/rxjs/src/partition.spec.ts b/packages/rxjs/src/partition.spec.ts index 4926063d25..6052950859 100644 --- a/packages/rxjs/src/partition.spec.ts +++ b/packages/rxjs/src/partition.spec.ts @@ -22,7 +22,7 @@ describe('partition', () => { expect(partition in Observable.prototype).toBe(false); }); - it('splits an ObservableValue and gives each branch an independent index', () => { + it('splits an ObservableInput and gives each branch an independent index', () => { const calls: Array<[string, number]> = []; const minimumLength = 2; const [matching, rejected] = Observable[partition](['a', 'bb', 'ccc'], (value, index) => { @@ -65,7 +65,7 @@ describe('partition', () => { expectTypeOf(promisedRejected).toEqualTypeOf>(); }); - it('throws an ObservableValue conversion error at creation time', () => { + it('throws an ObservableInput conversion error at creation time', () => { expect(() => Observable[partition](null as any, () => true)).toThrow(TypeError); }); diff --git a/packages/rxjs/src/partition.ts b/packages/rxjs/src/partition.ts index 1dc1bf027b..9b005953a1 100644 --- a/packages/rxjs/src/partition.ts +++ b/packages/rxjs/src/partition.ts @@ -2,11 +2,11 @@ import { create } from './create.js'; import { subscribeToSource } from './util/observable-helpers.js'; interface PartitionMethod { - (source: ObservableValue, predicate: (value: T, index: number) => value is U): [ + (source: ObservableInput, predicate: (value: T, index: number) => value is U): [ Observable, Observable> ]; - (source: ObservableValue, predicate: (value: T, index: number) => boolean): [Observable, Observable]; + (source: ObservableInput, predicate: (value: T, index: number) => boolean): [Observable, Observable]; } export const partition: unique symbol = Symbol('partition'); @@ -19,15 +19,15 @@ declare global { function partitionImpl( this: ObservableCtor, - source: ObservableValue, + source: ObservableInput, predicate: (value: T, index: number) => value is U ): [Observable, Observable>]; function partitionImpl( this: ObservableCtor, - source: ObservableValue, + source: ObservableInput, predicate: (value: T, index: number) => boolean ): [Observable, Observable]; -function partitionImpl(this: ObservableCtor, source: ObservableValue, predicate: (value: T, index: number) => boolean): any { +function partitionImpl(this: ObservableCtor, source: ObservableInput, predicate: (value: T, index: number) => boolean): any { const ObservableCtor = this; const input = ObservableCtor.from(source); diff --git a/packages/rxjs/src/pipe.ts b/packages/rxjs/src/pipe.ts index 6b5c4cf21e..6cb8c47b7e 100644 --- a/packages/rxjs/src/pipe.ts +++ b/packages/rxjs/src/pipe.ts @@ -8,7 +8,7 @@ declare global { interface ObservableCtor { [pipe]: { ( - source: ObservableValue, + source: ObservableInput, t: Fn, A>, a: Fn, b: Fn, @@ -18,7 +18,7 @@ declare global { f: Fn ): G; ( - source: ObservableValue, + source: ObservableInput, t: Fn, A>, a: Fn, b: Fn, @@ -26,11 +26,11 @@ declare global { d: Fn, e: Fn ): F; - (source: ObservableValue, t: Fn, A>, a: Fn, b: Fn, c: Fn, d: Fn): E; - (source: ObservableValue, t: Fn, A>, a: Fn, b: Fn, c: Fn): D; - (source: ObservableValue, t: Fn, A>, a: Fn, b: Fn): C; - (source: ObservableValue, t: Fn, A>, a: Fn): B; - (source: ObservableValue, t: Fn, A>): A; + (source: ObservableInput, t: Fn, A>, a: Fn, b: Fn, c: Fn, d: Fn): E; + (source: ObservableInput, t: Fn, A>, a: Fn, b: Fn, c: Fn): D; + (source: ObservableInput, t: Fn, A>, a: Fn, b: Fn): C; + (source: ObservableInput, t: Fn, A>, a: Fn): B; + (source: ObservableInput, t: Fn, A>): A; }; } @@ -51,7 +51,7 @@ function instancePipe(this: Observable, ...fns: Fn[]): any { return fns.reduce((prev, fn) => fn(prev), this); } -function staticPipe(this: ObservableCtor, source: ObservableValue, ...fns: Fn[]): any { +function staticPipe(this: ObservableCtor, source: ObservableInput, ...fns: Fn[]): any { const actualSource = convertObservableValue({ value: source }); return fns.reduce((prev, fn) => fn(prev), actualSource); } diff --git a/packages/rxjs/src/pipeable/filter.ts b/packages/rxjs/src/pipeable/filter.ts index 3ef53c5599..931a97c72f 100644 --- a/packages/rxjs/src/pipeable/filter.ts +++ b/packages/rxjs/src/pipeable/filter.ts @@ -1,6 +1,6 @@ import { subscribeToSource } from '../util/observable-helpers.js'; import { operate } from './operate.js'; -import type { MonoTypeOperatorFunction, OperatorFunction, TruthyTypesOf } from './types.js'; +import type { OperatorFunction, TruthyTypesOf } from './types.js'; /** * Emits only source values accepted by a predicate. @@ -32,8 +32,8 @@ import type { MonoTypeOperatorFunction, OperatorFunction, TruthyTypesOf } from ' */ export function filter(predicate: (value: T, index: number) => value is S): OperatorFunction; export function filter(predicate: BooleanConstructor): OperatorFunction>; -export function filter(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction; -export function filter(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction { +export function filter(predicate: (value: T, index: number) => boolean): OperatorFunction; +export function filter(predicate: (value: T, index: number) => boolean): OperatorFunction { return operate((source, subscriber) => { let index = 0; diff --git a/packages/rxjs/src/pipeable/map.ts b/packages/rxjs/src/pipeable/map.ts index 19a2437f4d..353fcabd6e 100644 --- a/packages/rxjs/src/pipeable/map.ts +++ b/packages/rxjs/src/pipeable/map.ts @@ -30,8 +30,15 @@ import type { OperatorFunction } from './types.js'; * doubled.subscribe(console.log); // 2, 4, 6 * ``` */ -export function map(project: (value: T, index: number) => R): OperatorFunction { - return operate((source, subscriber) => { +export function map(project: (value: In, index: number) => Out): OperatorFunction { + return operate(mapOperator(project)); +} + +/** @internal */ +export function mapOperator( + project: (value: In, index: number) => Out +): (source: Observable, subscriber: Subscriber) => void { + return (source, subscriber) => { let index = 0; subscribeToSource(source, subscriber, { @@ -39,5 +46,5 @@ export function map(project: (value: T, index: number) => R): OperatorFunc subscriber.next(project(value, index++)); }, }); - }); + }; } diff --git a/packages/rxjs/src/pipeable/operate.ts b/packages/rxjs/src/pipeable/operate.ts index e8fa89f8b0..206444a44e 100644 --- a/packages/rxjs/src/pipeable/operate.ts +++ b/packages/rxjs/src/pipeable/operate.ts @@ -12,7 +12,7 @@ import type { OperatorFunction } from './types.js'; * * @internal */ -export function operate(init: (source: Observable, subscriber: Subscriber) => void): OperatorFunction { +export function operate(init: (source: Observable, subscriber: Subscriber) => void): OperatorFunction { return (source) => source[create]((subscriber) => { try { diff --git a/packages/rxjs/src/pipeable/types.ts b/packages/rxjs/src/pipeable/types.ts index 209a9cd2df..160c7ccc9e 100644 --- a/packages/rxjs/src/pipeable/types.ts +++ b/packages/rxjs/src/pipeable/types.ts @@ -1,39 +1,20 @@ -/** - * Any value accepted by the active realm's platform `Observable.from`. - * - * @typeParam T The values produced after conversion. - * - * @example Convert an iterable before applying RxJS operators - * ```ts - * import { rx, map, type ObservableInput } from 'rxjs'; - * - * const input: ObservableInput = [1, 2, 3]; - * const doubled = rx(input, map((value) => value * 2)); - * - * doubled.subscribe(console.log); // 2, 4, 6 - * ``` - */ -export type ObservableInput = ObservableValue; - /** * A function that accepts one value and returns another. * * `rx` composes unary functions from left to right. RxJS operators are the * common case, but the final function may return any value. * - * @typeParam T The input type. - * @typeParam R The output type. + * @typeParam In The input type. + * @typeParam Out The output type. */ -export interface UnaryFunction { - (source: T): R; -} +export type UnaryFunction = (source: In) => Out; /** - * A pipeable RxJS operator that transforms an `Observable` into an - * `Observable`. + * A pipeable RxJS operator that transforms an `Observable` into an + * `Observable`. * - * @typeParam T The source value type. - * @typeParam R The result value type. + * @typeParam In The source value type. + * @typeParam Out The result value type. * * @example Declare a reusable operator * ```ts @@ -45,14 +26,7 @@ export interface UnaryFunction { * values.subscribe(console.log); // '1', '2', '3' * ``` */ -export type OperatorFunction = UnaryFunction, Observable>; - -/** - * A pipeable operator that preserves its source value type. - * - * @typeParam T The source and result value type. - */ -export type MonoTypeOperatorFunction = OperatorFunction; +export type OperatorFunction = (source: Observable) => Observable; /** @internal */ export type Falsy = null | undefined | false | 0 | -0 | 0n | ''; diff --git a/packages/rxjs/src/publish-replay.spec.ts b/packages/rxjs/src/publish-replay.spec.ts index 08d9d18b93..4efe7ed60a 100644 --- a/packages/rxjs/src/publish-replay.spec.ts +++ b/packages/rxjs/src/publish-replay.spec.ts @@ -58,7 +58,7 @@ describe('publishReplay', () => { source[publishReplay]('2'); // @ts-expect-error windowTime is numeric. source[publishReplay](2, '100'); - // @ts-expect-error A selector must return an ObservableValue. + // @ts-expect-error A selector must return an ObservableInput. source[publishReplay](2, 100, () => 1); } }); diff --git a/packages/rxjs/src/publish-replay.ts b/packages/rxjs/src/publish-replay.ts index 3bb05021a4..c2bdaef0f0 100644 --- a/packages/rxjs/src/publish-replay.ts +++ b/packages/rxjs/src/publish-replay.ts @@ -13,7 +13,7 @@ export interface PublishReplayTimestampProvider { declare global { interface Observable { - [publishReplay]>( + [publishReplay]>( bufferSize: number | undefined, windowTime: number | undefined, selector: (shared: Observable) => Selected, @@ -29,7 +29,7 @@ declare global { } } -Observable.prototype[publishReplay] = function >( +Observable.prototype[publishReplay] = function >( this: Observable, bufferSize?: number, windowTime?: number, diff --git a/packages/rxjs/src/publish.spec.ts b/packages/rxjs/src/publish.spec.ts index 62ebb46de6..89133151b4 100644 --- a/packages/rxjs/src/publish.spec.ts +++ b/packages/rxjs/src/publish.spec.ts @@ -37,7 +37,7 @@ describe('publish', () => { expect((Observable.prototype as unknown as Record)[otherKey]).toBeUndefined(); if (false) { - // @ts-expect-error A selector must return an ObservableValue. + // @ts-expect-error A selector must return an ObservableInput. source[publish](() => 1); // @ts-expect-error The selector receives the source value type. source[publish]((shared: Observable) => shared); diff --git a/packages/rxjs/src/publish.ts b/packages/rxjs/src/publish.ts index bdb031fe05..81f4e3de11 100644 --- a/packages/rxjs/src/publish.ts +++ b/packages/rxjs/src/publish.ts @@ -8,13 +8,13 @@ export const publish: unique symbol = Symbol('publish'); declare global { interface Observable { [publish](): ConnectableObservable; - [publish]>( + [publish]>( selector: (shared: Observable) => Selected ): Observable>; } } -Observable.prototype[publish] = function >( +Observable.prototype[publish] = function >( this: Observable, selector?: (shared: Observable) => Selected ): ConnectableObservable | Observable> { diff --git a/packages/rxjs/src/race.ts b/packages/rxjs/src/race.ts index efc53b67ec..b390489065 100644 --- a/packages/rxjs/src/race.ts +++ b/packages/rxjs/src/race.ts @@ -7,22 +7,22 @@ export const race: unique symbol = Symbol('race'); declare global { interface ObservableCtor { - [race]: []>(sources: Sources) => Observable>; + [race]: []>(sources: Sources) => Observable>; } interface Observable { - [race]: []>(sources: Sources) => Observable>; + [race]: []>(sources: Sources) => Observable>; } } Observable[race] = raceImpl; Observable.prototype[race] = raceImpl; -function raceImpl[]>( +function raceImpl[]>( this: ObservableCtor | Observable, sources: Sources ): Observable> { - const actualSources: readonly ObservableValue[] = isObservableInstance(this) ? [this, ...sources] : [...sources]; + const actualSources: readonly ObservableInput[] = isObservableInstance(this) ? [this, ...sources] : [...sources]; return this[create]((subscriber) => { const innerControllers: AbortController[] = []; diff --git a/packages/rxjs/src/repeat-when.spec.ts b/packages/rxjs/src/repeat-when.spec.ts index 80828bef46..4966f96539 100644 --- a/packages/rxjs/src/repeat-when.spec.ts +++ b/packages/rxjs/src/repeat-when.spec.ts @@ -238,7 +238,7 @@ describe('repeatWhen', () => { .subscribe({ error: (error) => factoryErrors.push(error) }); Observable.from([] as number[]) - [repeatWhen](() => ({}) as ObservableValue) + [repeatWhen](() => ({}) as ObservableInput) .subscribe({ error: (error) => conversionErrors.push(error) }); expect(factoryErrors).toEqual([factoryFailure]); diff --git a/packages/rxjs/src/repeat-when.ts b/packages/rxjs/src/repeat-when.ts index f7724d4947..4f7a16ff03 100644 --- a/packages/rxjs/src/repeat-when.ts +++ b/packages/rxjs/src/repeat-when.ts @@ -6,13 +6,13 @@ export const repeatWhen: unique symbol = Symbol('repeatWhen'); declare global { interface Observable { - [repeatWhen](notifier: (completions: Observable) => ObservableValue): Observable; + [repeatWhen](notifier: (completions: Observable) => ObservableInput): Observable; } } Observable.prototype[repeatWhen] = function ( this: Observable, - notifier: (completions: Observable) => ObservableValue + notifier: (completions: Observable) => ObservableInput ): Observable { const source = this; diff --git a/packages/rxjs/src/repeat.ts b/packages/rxjs/src/repeat.ts index 53daf678b1..011909e9b2 100644 --- a/packages/rxjs/src/repeat.ts +++ b/packages/rxjs/src/repeat.ts @@ -5,7 +5,7 @@ export const repeat: unique symbol = Symbol('repeat'); declare global { interface Observable { - [repeat]: (config?: { count?: number; delay?: number | ((repeatCount: number) => ObservableValue) }) => Observable; + [repeat]: (config?: { count?: number; delay?: number | ((repeatCount: number) => ObservableInput) }) => Observable; } } @@ -13,7 +13,7 @@ Observable.prototype[repeat] = function ( this: Observable, config?: { count?: number; - delay?: number | ((repeatCount: number) => ObservableValue); + delay?: number | ((repeatCount: number) => ObservableInput); } ): Observable { return this[create]((subscriber) => { diff --git a/packages/rxjs/src/retry-when.spec.ts b/packages/rxjs/src/retry-when.spec.ts index 1459c085ff..bd37e773d7 100644 --- a/packages/rxjs/src/retry-when.spec.ts +++ b/packages/rxjs/src/retry-when.spec.ts @@ -16,7 +16,7 @@ describe('retryWhen', () => { expect((Observable.prototype as unknown as Record)[otherKey]).toBeUndefined(); if (false) { - // @ts-expect-error A notifier must return an ObservableValue. + // @ts-expect-error A notifier must return an ObservableInput. Observable.from([1])[retryWhen](() => 1); } }); @@ -101,7 +101,7 @@ describe('retryWhen', () => { conversionSource.observable[retryWhen]( // Exercise runtime conversion failure independently of the public type guard. - (() => null) as unknown as (errors: Observable) => ObservableValue + (() => null) as unknown as (errors: Observable) => ObservableInput ).subscribe({ error: (error) => conversionErrors.push(error) }); conversionSource.subscriber.error(new Error('source failed')); diff --git a/packages/rxjs/src/retry-when.ts b/packages/rxjs/src/retry-when.ts index 2ccc0883f4..4ffdc4f6f3 100644 --- a/packages/rxjs/src/retry-when.ts +++ b/packages/rxjs/src/retry-when.ts @@ -6,13 +6,13 @@ export const retryWhen: unique symbol = Symbol('retryWhen'); declare global { interface Observable { - [retryWhen](notifier: (errors: Observable) => ObservableValue): Observable; + [retryWhen](notifier: (errors: Observable) => ObservableInput): Observable; } } Observable.prototype[retryWhen] = function ( this: Observable, - notifier: (errors: Observable) => ObservableValue + notifier: (errors: Observable) => ObservableInput ): Observable { const source = this; diff --git a/packages/rxjs/src/retry.ts b/packages/rxjs/src/retry.ts index 083d769569..a87fb39492 100644 --- a/packages/rxjs/src/retry.ts +++ b/packages/rxjs/src/retry.ts @@ -8,7 +8,7 @@ declare global { interface Observable { [retry](config?: { count?: number; - delay?: number | ((error: any, retryCount: number) => ObservableValue); + delay?: number | ((error: any, retryCount: number) => ObservableInput); resetOnSuccess?: boolean; }): Observable; } @@ -18,7 +18,7 @@ Observable.prototype[retry] = function ( this: Observable, config?: { count?: number; - delay?: null | number | ((error: any, retryCount: number) => ObservableValue); + delay?: null | number | ((error: any, retryCount: number) => ObservableInput); resetOnSuccess?: boolean; } ) { diff --git a/packages/rxjs/src/rx.ts b/packages/rxjs/src/rx.ts index 8cb550b01d..d0863dbece 100644 --- a/packages/rxjs/src/rx.ts +++ b/packages/rxjs/src/rx.ts @@ -1,4 +1,4 @@ -import type { ObservableInput, UnaryFunction } from './pipeable/types.js'; +import type { UnaryFunction } from './pipeable/types.js'; /** * Converts an input with the active platform `Observable.from`, then applies diff --git a/packages/rxjs/src/sample.ts b/packages/rxjs/src/sample.ts index 82b5901e91..3e7873151f 100644 --- a/packages/rxjs/src/sample.ts +++ b/packages/rxjs/src/sample.ts @@ -5,11 +5,11 @@ export const sample: unique symbol = Symbol('sample'); declare global { interface Observable { - [sample](notifier: ObservableValue): Observable; + [sample](notifier: ObservableInput): Observable; } } -Observable.prototype[sample] = function (this: Observable, notifier: ObservableValue): Observable { +Observable.prototype[sample] = function (this: Observable, notifier: ObservableInput): Observable { return this[create]((subscriber) => { let hasValue = false; let latestValue: T | undefined; diff --git a/packages/rxjs/src/share.spec.ts b/packages/rxjs/src/share.spec.ts index ec57b5d85b..2b5a7da700 100644 --- a/packages/rxjs/src/share.spec.ts +++ b/packages/rxjs/src/share.spec.ts @@ -49,7 +49,7 @@ describe('share', () => { if (false) { // @ts-expect-error A connector must return a SubjectLike. source[share]({ connector: () => Observable.from([1]) }); - // @ts-expect-error Reset factories must return an ObservableValue. + // @ts-expect-error Reset factories must return an ObservableInput. source[share]({ resetOnComplete: () => 1 }); // @ts-expect-error Reset options accept only booleans or notifier factories. source[share]({ resetOnRefCountZero: 'yes' }); @@ -357,7 +357,7 @@ describe('share', () => { const conversionSource = tracked(); const conversionController = new AbortController(); const conversionShared = conversionSource.observable[share]({ - resetOnRefCountZero: () => ({} as ObservableValue), + resetOnRefCountZero: () => ({} as ObservableInput), }); conversionShared.subscribe(() => {}, { signal: conversionController.signal }); diff --git a/packages/rxjs/src/share.ts b/packages/rxjs/src/share.ts index 5e4d3aafcc..375f28a691 100644 --- a/packages/rxjs/src/share.ts +++ b/packages/rxjs/src/share.ts @@ -4,9 +4,9 @@ import type { SubjectLike } from './util/types.js'; export const share: unique symbol = Symbol('share'); -type ResetOnError = boolean | ((error: any) => ObservableValue); -type ResetOnComplete = boolean | (() => ObservableValue); -type ResetOnRefCountZero = boolean | (() => ObservableValue); +type ResetOnError = boolean | ((error: any) => ObservableInput); +type ResetOnComplete = boolean | (() => ObservableInput); +type ResetOnRefCountZero = boolean | (() => ObservableInput); export interface ShareConfig { connector?: () => SubjectLike; @@ -54,7 +54,7 @@ Observable.prototype[share] = function (this: Observable, config: ShareCon const handleReset = ( resetState: () => void, - rule: boolean | ((...args: Args) => ObservableValue), + rule: boolean | ((...args: Args) => ObservableInput), ...args: Args ): void => { if (rule === true) { diff --git a/packages/rxjs/src/skip-until.spec.ts b/packages/rxjs/src/skip-until.spec.ts index c5d01eaf9c..25c34c81d2 100644 --- a/packages/rxjs/src/skip-until.spec.ts +++ b/packages/rxjs/src/skip-until.spec.ts @@ -219,7 +219,7 @@ describe('skipUntil', () => { expect(sourceAfterReject.teardowns).toBe(1); }); - it('forwards ObservableValue conversion errors without activating the source', () => { + it('forwards ObservableInput conversion errors without activating the source', () => { const failure = new Error('conversion failed'); let sourceActivations = 0; const errors: unknown[] = []; diff --git a/packages/rxjs/src/skip-until.ts b/packages/rxjs/src/skip-until.ts index 27a5b9fa0a..d3f92d8360 100644 --- a/packages/rxjs/src/skip-until.ts +++ b/packages/rxjs/src/skip-until.ts @@ -5,11 +5,11 @@ export const skipUntil: unique symbol = Symbol('skipUntil'); declare global { interface Observable { - [skipUntil]: (notifier: ObservableValue) => Observable; + [skipUntil]: (notifier: ObservableInput) => Observable; } } -Observable.prototype[skipUntil] = function (this: Observable, notifier: ObservableValue): Observable { +Observable.prototype[skipUntil] = function (this: Observable, notifier: ObservableInput): Observable { return this[create]((subscriber) => { let taking = false; const notifierController = new AbortController(); diff --git a/packages/rxjs/src/switch-map.ts b/packages/rxjs/src/switch-map.ts index 27f6366d92..be2f776ea0 100644 --- a/packages/rxjs/src/switch-map.ts +++ b/packages/rxjs/src/switch-map.ts @@ -5,13 +5,13 @@ export const switchMap: unique symbol = Symbol('switchMap'); declare global { interface Observable { - [switchMap]: (mapper: (value: T, index: number) => ObservableValue, options?: { concurrent?: number }) => Observable; + [switchMap]: (mapper: (value: T, index: number) => ObservableInput, options?: { concurrent?: number }) => Observable; } } function switchMapOperator( this: Observable, - mapper: (value: T, index: number) => ObservableValue, + mapper: (value: T, index: number) => ObservableInput, options?: { concurrent?: number } ): Observable { const { concurrent = 1 } = options ?? {}; diff --git a/packages/rxjs/src/switch-scan.ts b/packages/rxjs/src/switch-scan.ts index 2768ba8ffb..346c131125 100644 --- a/packages/rxjs/src/switch-scan.ts +++ b/packages/rxjs/src/switch-scan.ts @@ -6,14 +6,14 @@ export const switchScan: unique symbol = Symbol('switchScan'); declare global { interface Observable { - [switchScan]>( + [switchScan]>( accumulator: (accumulator: R, value: T, index: number) => Input, seed: R ): Observable>; } } -function switchScanOperator>( +function switchScanOperator>( this: Observable, accumulator: (accumulator: R, value: T, index: number) => Input, seed: R diff --git a/packages/rxjs/src/take-until.spec.ts b/packages/rxjs/src/take-until.spec.ts index b848492887..268c0bd88d 100644 --- a/packages/rxjs/src/take-until.spec.ts +++ b/packages/rxjs/src/take-until.spec.ts @@ -140,7 +140,7 @@ describe('takeUntil', () => { events.push('source'); }); - source[takeUntil](invalidNotifier as ObservableValue).subscribe({ + source[takeUntil](invalidNotifier as ObservableInput).subscribe({ error: (error) => errors.push(error), }); diff --git a/packages/rxjs/src/take-until.ts b/packages/rxjs/src/take-until.ts index 21d20bf8c7..1b129a19d2 100644 --- a/packages/rxjs/src/take-until.ts +++ b/packages/rxjs/src/take-until.ts @@ -5,11 +5,11 @@ export const takeUntil: unique symbol = Symbol('takeUntil'); declare global { interface Observable { - [takeUntil](notifier: ObservableValue): Observable; + [takeUntil](notifier: ObservableInput): Observable; } } -Observable.prototype[takeUntil] = function (this: Observable, notifier: ObservableValue): Observable { +Observable.prototype[takeUntil] = function (this: Observable, notifier: ObservableInput): Observable { return this[create]((subscriber) => { let notifierSource: Observable; try { diff --git a/packages/rxjs/src/throttle.ts b/packages/rxjs/src/throttle.ts index ae131533dc..14f4e7c7d7 100644 --- a/packages/rxjs/src/throttle.ts +++ b/packages/rxjs/src/throttle.ts @@ -5,7 +5,7 @@ export const throttle: unique symbol = Symbol('throttle'); declare global { interface Observable { - [throttle]: (delay: number | ((value: T, index: number) => ObservableValue), config?: ThrottleConfig) => Observable; + [throttle]: (delay: number | ((value: T, index: number) => ObservableInput), config?: ThrottleConfig) => Observable; } } @@ -17,7 +17,7 @@ interface ThrottleConfig { Observable.prototype[throttle] = function ( this: Observable, - delay: number | ((value: T, index: number) => ObservableValue), + delay: number | ((value: T, index: number) => ObservableInput), config?: ThrottleConfig ): Observable { return this[create]((subscriber) => { diff --git a/packages/rxjs/src/timeout.ts b/packages/rxjs/src/timeout.ts index ecd56b292f..f234379dfa 100644 --- a/packages/rxjs/src/timeout.ts +++ b/packages/rxjs/src/timeout.ts @@ -11,7 +11,7 @@ declare global { [timeout]: (config: { each?: number; first?: number | Date; - with?: (info: TimeoutInfo) => ObservableValue; + with?: (info: TimeoutInfo) => ObservableInput; meta?: M; }) => Observable; } @@ -22,7 +22,7 @@ function timeoutOperator( config: { each?: number; first?: number | Date; - with?: (info: TimeoutInfo) => ObservableValue; + with?: (info: TimeoutInfo) => ObservableInput; meta?: M; } ): Observable { diff --git a/packages/rxjs/src/util/observable-helpers.ts b/packages/rxjs/src/util/observable-helpers.ts index 5f33def482..458b64533d 100644 --- a/packages/rxjs/src/util/observable-helpers.ts +++ b/packages/rxjs/src/util/observable-helpers.ts @@ -1,7 +1,7 @@ import '@rxjs/observable-polyfill'; export interface ConvertObservableValueOptions { - value: ObservableValue; + value: ObservableInput; } /** Converts inputs at the active realm's platform boundary. */ diff --git a/packages/rxjs/src/util/types.ts b/packages/rxjs/src/util/types.ts index b769c74fe9..245ba04374 100644 --- a/packages/rxjs/src/util/types.ts +++ b/packages/rxjs/src/util/types.ts @@ -1,10 +1,10 @@ -export type ObservedValueOf = T extends ObservableValue ? R : never; +export type ObservedValueOf = T extends ObservableInput ? R : never; -export type ObservableArrayToValueArray[]> = { - [K in keyof Sources]: Sources[K] extends ObservableValue ? T : never; +export type ObservableArrayToValueArray[]> = { + [K in keyof Sources]: Sources[K] extends ObservableInput ? T : never; }; -export type ObservableArrayToValueUnion[]> = T extends ObservableValue[] ? R : never; +export type ObservableArrayToValueUnion[]> = T extends ObservableInput[] ? R : never; export interface SubjectLike extends Subscribable, Observer { readonly active: boolean; diff --git a/packages/rxjs/src/window-toggle.spec.ts b/packages/rxjs/src/window-toggle.spec.ts index 4ad678f271..e09fde0403 100644 --- a/packages/rxjs/src/window-toggle.spec.ts +++ b/packages/rxjs/src/window-toggle.spec.ts @@ -36,7 +36,7 @@ describe('windowToggle', () => { if (false) { // @ts-expect-error Both openings and a closing selector are required. source[windowToggle](); - // @ts-expect-error The selector must return an ObservableValue. + // @ts-expect-error The selector must return an ObservableInput. source[windowToggle](['open'], () => 1); // @ts-expect-error The selector parameter must match the opening value. source[windowToggle](['open'], (opening: number) => [opening]); diff --git a/packages/rxjs/src/window-toggle.ts b/packages/rxjs/src/window-toggle.ts index 2626498d0c..f008b03062 100644 --- a/packages/rxjs/src/window-toggle.ts +++ b/packages/rxjs/src/window-toggle.ts @@ -7,8 +7,8 @@ export const windowToggle: unique symbol = Symbol('windowToggle'); declare global { interface Observable { [windowToggle]( - openings: ObservableValue, - closingSelector: (opening: Opening) => ObservableValue + openings: ObservableInput, + closingSelector: (opening: Opening) => ObservableInput ): Observable>; } } @@ -21,8 +21,8 @@ interface WindowContext { Observable.prototype[windowToggle] = function ( this: Observable, - openings: ObservableValue, - closingSelector: (opening: Opening) => ObservableValue + openings: ObservableInput, + closingSelector: (opening: Opening) => ObservableInput ): Observable> { return this[create]((subscriber) => { let windows: WindowContext[] = []; @@ -90,7 +90,7 @@ Observable.prototype[windowToggle] = function ( windows.push(context); closingControllers.add(context.closingController); - let closingValue: ObservableValue; + let closingValue: ObservableInput; try { closingValue = closingSelector(opening); } catch (error) { diff --git a/packages/rxjs/src/window-when.spec.ts b/packages/rxjs/src/window-when.spec.ts index b8a3a72848..fe8b914909 100644 --- a/packages/rxjs/src/window-when.spec.ts +++ b/packages/rxjs/src/window-when.spec.ts @@ -38,7 +38,7 @@ describe('windowWhen', () => { if (false) { // @ts-expect-error A closing selector is required. source[windowWhen](); - // @ts-expect-error The selector must return an ObservableValue. + // @ts-expect-error The selector must return an ObservableInput. source[windowWhen](() => 1); // @ts-expect-error The closing selector does not receive source values. source[windowWhen]((value: number) => [value]); diff --git a/packages/rxjs/src/window-when.ts b/packages/rxjs/src/window-when.ts index 1e54681f6b..b3da8e9991 100644 --- a/packages/rxjs/src/window-when.ts +++ b/packages/rxjs/src/window-when.ts @@ -6,13 +6,13 @@ export const windowWhen: unique symbol = Symbol('windowWhen'); declare global { interface Observable { - [windowWhen](closingSelector: () => ObservableValue): Observable>; + [windowWhen](closingSelector: () => ObservableInput): Observable>; } } Observable.prototype[windowWhen] = function ( this: Observable, - closingSelector: () => ObservableValue + closingSelector: () => ObservableInput ): Observable> { return this[create]((subscriber) => { let currentWindow: Subject | null = null; @@ -79,7 +79,7 @@ Observable.prototype[windowWhen] = function ( break; } - let closingValue: ObservableValue; + let closingValue: ObservableInput; try { // Pinned RxJS 7 ordering: the window is observable before its // selector is invoked. diff --git a/packages/rxjs/src/window.spec.ts b/packages/rxjs/src/window.spec.ts index ccedad4276..7b39c153f2 100644 --- a/packages/rxjs/src/window.spec.ts +++ b/packages/rxjs/src/window.spec.ts @@ -41,7 +41,7 @@ describe('window', () => { if (false) { // @ts-expect-error A boundary input is required. source[window](); - // @ts-expect-error A number is not an ObservableValue. + // @ts-expect-error A number is not an ObservableInput. source[window](1); } @@ -230,7 +230,7 @@ describe('window', () => { }, }); - source.observable[window](invalidBoundaries as ObservableValue).subscribe({ + source.observable[window](invalidBoundaries as ObservableInput).subscribe({ next: (inner) => { events.push('open'); inner.subscribe({ error: (error) => events.push(['window error', error]) }); diff --git a/packages/rxjs/src/window.ts b/packages/rxjs/src/window.ts index 64faa9e8dd..618c422ecc 100644 --- a/packages/rxjs/src/window.ts +++ b/packages/rxjs/src/window.ts @@ -6,11 +6,11 @@ export const window: unique symbol = Symbol('window'); declare global { interface Observable { - [window](boundaries: ObservableValue): Observable>; + [window](boundaries: ObservableInput): Observable>; } } -Observable.prototype[window] = function (this: Observable, boundaries: ObservableValue): Observable> { +Observable.prototype[window] = function (this: Observable, boundaries: ObservableInput): Observable> { return this[create]((subscriber) => { let currentWindow: Subject | null = null; diff --git a/packages/rxjs/src/with-latest-from.ts b/packages/rxjs/src/with-latest-from.ts index 2a6e381863..888a5a7a69 100644 --- a/packages/rxjs/src/with-latest-from.ts +++ b/packages/rxjs/src/with-latest-from.ts @@ -7,8 +7,8 @@ export const withLatestFrom: unique symbol = Symbol('withLatestFrom'); declare global { interface Observable { [withLatestFrom]: { - []>(sources: Sources): Observable<[T, ...ObservableArrayToValueArray]>; - [], Result>( + []>(sources: Sources): Observable<[T, ...ObservableArrayToValueArray]>; + [], Result>( sources: Sources, project: (value: T, ...latestValues: ObservableArrayToValueArray) => Result ): Observable; @@ -18,18 +18,18 @@ declare global { Observable.prototype[withLatestFrom] = withLatestFromImpl; -function withLatestFromImpl[]>( +function withLatestFromImpl[]>( this: Observable, sources: Sources ): Observable<[T, ...ObservableArrayToValueArray]>; -function withLatestFromImpl[], Result>( +function withLatestFromImpl[], Result>( this: Observable, sources: Sources, project: (value: T, ...latestValues: ObservableArrayToValueArray) => Result ): Observable; function withLatestFromImpl( this: Observable, - sources: readonly ObservableValue[], + sources: readonly ObservableInput[], project?: (...values: any[]) => any ): Observable { return this[create]((subscriber) => { diff --git a/packages/rxjs/src/zip-all.spec.ts b/packages/rxjs/src/zip-all.spec.ts index 6e2bb6e69b..6f50e45e5e 100644 --- a/packages/rxjs/src/zip-all.spec.ts +++ b/packages/rxjs/src/zip-all.spec.ts @@ -58,7 +58,7 @@ describe('zipAll', () => { it('supports an optional result selector', () => { const results: Array = []; - fromValues>(Observable.from(['a', 'b']), Observable.from([1, 2])) + fromValues>(Observable.from(['a', 'b']), Observable.from([1, 2])) [zipAll]((letter, number) => `${letter}${number}`) .subscribe({ next: (value) => results.push(value), @@ -96,7 +96,7 @@ describe('zipAll', () => { const right = controllable(); const errors: unknown[] = []; - fromValues>(left.observable, right.observable) + fromValues>(left.observable, right.observable) [zipAll]() .subscribe({ error: (error) => errors.push(error), @@ -116,7 +116,7 @@ describe('zipAll', () => { const right = controllable(); const errors: unknown[] = []; - fromValues>(left.observable, right.observable) + fromValues>(left.observable, right.observable) [zipAll](() => { throw failure; }) @@ -141,7 +141,7 @@ describe('zipAll', () => { }); const observations: string[] = []; - fromValues>(active.observable, [], later) + fromValues>(active.observable, [], later) [zipAll]() .subscribe({ next: () => observations.push('next'), @@ -158,7 +158,7 @@ describe('zipAll', () => { const left = controllable(); const observations: Array = []; - fromValues>(left.observable, [10]) + fromValues>(left.observable, [10]) [zipAll]() .subscribe({ next: (value) => { @@ -178,8 +178,8 @@ describe('zipAll', () => { const left = controllable(); const right = controllable(); let outerActivations = 0; - let outerSubscriber: Subscriber> | undefined; - const outer = new Observable>((subscriber) => { + let outerSubscriber: Subscriber> | undefined; + const outer = new Observable>((subscriber) => { outerActivations++; outerSubscriber = subscriber; }); diff --git a/packages/rxjs/src/zip-all.ts b/packages/rxjs/src/zip-all.ts index e3f347b2b6..c8b120abe0 100644 --- a/packages/rxjs/src/zip-all.ts +++ b/packages/rxjs/src/zip-all.ts @@ -8,21 +8,21 @@ export const zipAll: unique symbol = Symbol('zipAll'); declare global { interface Observable { [zipAll]: { - (this: Observable>): Observable; - (this: Observable>, project: (...values: V[]) => R): Observable; - (this: Observable>, project: (...values: any[]) => R): Observable; + (this: Observable>): Observable; + (this: Observable>, project: (...values: V[]) => R): Observable; + (this: Observable>, project: (...values: any[]) => R): Observable; }; } } -function zipAllOperator(this: Observable>): Observable; -function zipAllOperator(this: Observable>, project: (...values: V[]) => R): Observable; -function zipAllOperator(this: Observable>, project: (...values: any[]) => R): Observable; -function zipAllOperator(this: Observable>, project?: (...values: V[]) => R): Observable { +function zipAllOperator(this: Observable>): Observable; +function zipAllOperator(this: Observable>, project: (...values: V[]) => R): Observable; +function zipAllOperator(this: Observable>, project: (...values: any[]) => R): Observable; +function zipAllOperator(this: Observable>, project?: (...values: V[]) => R): Observable { const outer = this; return outer[create]((subscriber) => { - const sources: Array> = []; + const sources: Array> = []; subscribeToSource(outer, subscriber, { next: (source) => sources.push(source), diff --git a/packages/rxjs/src/zip-with.ts b/packages/rxjs/src/zip-with.ts index 6023113aa1..22fa88aff0 100644 --- a/packages/rxjs/src/zip-with.ts +++ b/packages/rxjs/src/zip-with.ts @@ -1,7 +1,7 @@ import { zip } from './zip.js'; -type ObservedValueOf = Input extends ObservableValue ? T : never; -type ZipWithValues[]> = [ +type ObservedValueOf = Input extends ObservableInput ? T : never; +type ZipWithValues[]> = [ T, ...{ [K in keyof OtherSources]: ObservedValueOf; @@ -12,13 +12,13 @@ export const zipWith: unique symbol = Symbol('zipWith'); declare global { interface Observable { - [zipWith]: []>( + [zipWith]: []>( ...otherSources: OtherSources ) => Observable>; } } -Observable.prototype[zipWith] = function []>( +Observable.prototype[zipWith] = function []>( this: Observable, ...otherSources: OtherSources ): Observable> { diff --git a/packages/rxjs/src/zip.ts b/packages/rxjs/src/zip.ts index e377c63f06..ec53987a41 100644 --- a/packages/rxjs/src/zip.ts +++ b/packages/rxjs/src/zip.ts @@ -1,12 +1,12 @@ import { map } from './map.js'; import { subscribeToSource } from './util/observable-helpers.js'; -type ObservedValuesOfWithFill[], Fill> = { - [K in keyof Sources]: Sources[K] extends ObservableValue ? T | Fill : never; +type ObservedValuesOfWithFill[], Fill> = { + [K in keyof Sources]: Sources[K] extends ObservableInput ? T | Fill : never; }; -type ObservedValues[]> = { - [K in keyof Sources]: Sources[K] extends ObservableValue ? T : never; +type ObservedValues[]> = { + [K in keyof Sources]: Sources[K] extends ObservableInput ? T : never; }; interface ZipState { @@ -14,17 +14,17 @@ interface ZipState { complete: boolean; } -export function zip[], Result>( +export function zip[], Result>( sources: Sources, project: (...values: ObservedValues) => Result ): Observable; -export function zip[], Fill = never>( +export function zip[], Fill = never>( sources: Sources, config?: { fillAfterComplete?: Fill; } ): Observable>; -export function zip[], Fill = never, Result = never>( +export function zip[], Fill = never, Result = never>( sources: Sources, configOrProject?: | { diff --git a/packages/rxjs/test/ported/capability-registry.json b/packages/rxjs/test/ported/capability-registry.json index b46ec3652a..9fabd7d258 100644 --- a/packages/rxjs/test/ported/capability-registry.json +++ b/packages/rxjs/test/ported/capability-registry.json @@ -63,7 +63,7 @@ "adapter": "identity", "mapping": "source[catchError](selector)", "status": "Present; parity unverified", - "note": "Replaces source errors with any ObservableValue, preserves caught-source retry identity, and trampolines synchronous retries." + "note": "Replaces source errors with any ObservableInput, preserves caught-source retry identity, and trampolines synchronous retries." }, "combineLatest": { "symbol": "combineLatest", diff --git a/packages/rxjs/test/ported/migration-evidence-ledger.generated.json b/packages/rxjs/test/ported/migration-evidence-ledger.generated.json index 3087ac2731..ce4e7716a4 100644 --- a/packages/rxjs/test/ported/migration-evidence-ledger.generated.json +++ b/packages/rxjs/test/ported/migration-evidence-ledger.generated.json @@ -2811,7 +2811,7 @@ "action": "mechanical-change", "semanticReviewRequired": true, "adapter": "identity", - "note": "Replaces source errors with any ObservableValue, preserves caught-source retry identity, and trampolines synchronous retries." + "note": "Replaces source errors with any ObservableInput, preserves caught-source retry identity, and trampolines synchronous retries." }, "decisions": [ "D-003", diff --git a/packages/rxjs/test/ported/tools/generate-unsupported-surface-doc.mjs b/packages/rxjs/test/ported/tools/generate-unsupported-surface-doc.mjs index 6f49f08fb9..326163f62f 100644 --- a/packages/rxjs/test/ported/tools/generate-unsupported-surface-doc.mjs +++ b/packages/rxjs/test/ported/tools/generate-unsupported-surface-doc.mjs @@ -96,7 +96,7 @@ function validateCatalog(value, sourceManifest, registry) { ['rxjs/operators', 'rxjs/testing', 'rxjs/internal/*', 'bindCallback', 'bindNodeCallback', 'scheduled', 'using', 'isObservable'], errors ); - requireSurfaces(categorySurfaces, 'types', ['Subscription', 'ObservableInput', 'OperatorFunction', 'SchedulerLike'], errors); + requireSurfaces(categorySurfaces, 'types', ['Subscription', 'ObservableInput', 'MonoTypeOperatorFunction', 'SchedulerLike'], errors); requireSurfaces( categorySurfaces, 'interop', diff --git a/packages/rxjs/test/ported/unsupported-surface-catalog.json b/packages/rxjs/test/ported/unsupported-surface-catalog.json index 227c51924b..37b897c635 100644 --- a/packages/rxjs/test/ported/unsupported-surface-catalog.json +++ b/packages/rxjs/test/ported/unsupported-surface-catalog.json @@ -66,11 +66,11 @@ "types": [ { "id": "types:composition", - "surfaces": ["UnaryFunction", "OperatorFunction", "MonoTypeOperatorFunction"], + "surfaces": ["MonoTypeOperatorFunction"], "disposition": "replace", - "replacement": "Use ordinary typed functions with exact Symbol invocation or rxjs/pipe composition.", - "rationale": "RxJS Next does not publish the pipeable-operator type family.", - "decisions": ["D-039", "D-050"] + "replacement": "Use the root OperatorFunction type for an operator that preserves its value type.", + "rationale": "RxJS Next publishes direct UnaryFunction and OperatorFunction aliases without the redundant mono-type alias.", + "decisions": ["D-060"] }, { "id": "types:subscription", @@ -84,7 +84,7 @@ "id": "types:conversion", "surfaces": ["ObservableInput", "ObservableLike", "InteropObservable", "Subscribable", "SubscribableOrPromise", "ReadableStreamLike"], "disposition": "replace", - "replacement": "Use the ambient ObservableValue/platform Observable.from input contract and review custom inputs manually.", + "replacement": "Use the ambient ObservableInput/platform Observable.from input contract and review custom inputs manually.", "rationale": "The platform conversion boundary deliberately excludes arbitrary subscribables and legacy observable interop.", "decisions": ["D-039", "D-049"] }, @@ -144,7 +144,7 @@ "id": "interop:observable-symbol", "surfaces": ["observable", "Symbol.observable", "@@observable", "InteropObservable"], "disposition": "unsupported", - "replacement": "Expose a platform-supported ObservableValue category or wrap the source explicitly in the active realm.", + "replacement": "Expose a platform-supported ObservableInput category or wrap the source explicitly in the active realm.", "rationale": "Legacy observable interop is outside the accepted platform Observable.from contract.", "decisions": ["D-039", "D-049"] }, diff --git a/packages/rxjs/test/types/pipeable-api.ts b/packages/rxjs/test/types/pipeable-api.ts index 80e189bb60..efe591bce8 100644 --- a/packages/rxjs/test/types/pipeable-api.ts +++ b/packages/rxjs/test/types/pipeable-api.ts @@ -1,8 +1,8 @@ -import { filter, map, rx, type MonoTypeOperatorFunction, type ObservableInput, type OperatorFunction, type UnaryFunction } from 'rxjs'; +import { filter, map, rx, type OperatorFunction, type UnaryFunction } from 'rxjs'; const input: ObservableInput = [1, 2, 3]; const stringify: OperatorFunction = map((value) => String(value)); -const positive: MonoTypeOperatorFunction = filter((value) => value > 0); +const positive: OperatorFunction = filter((value) => value > 0); const length: UnaryFunction = (value) => value.length; const strings: Observable = rx(input, positive, stringify); From 794cdef51fe2abfb75a211cef9f3fd1e4211cb86 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Thu, 6 Aug 2026 14:24:43 -0500 Subject: [PATCH 5/7] feat(rxjs): extend pipeable pilot --- packages/rxjs/package.json | 209 +++++++++++++++++++ packages/rxjs/src/index.ts | 3 + packages/rxjs/src/map.ts | 2 +- packages/rxjs/src/pipeable/map-operator.ts | 16 ++ packages/rxjs/src/pipeable/map.ts | 21 +- packages/rxjs/src/pipeable/subscribe.spec.ts | 78 +++++++ packages/rxjs/src/pipeable/subscribe.ts | 79 +++++++ packages/rxjs/src/pipeable/take-operator.ts | 33 +++ packages/rxjs/src/pipeable/take.spec.ts | 53 +++++ packages/rxjs/src/pipeable/take.ts | 27 +++ packages/rxjs/src/pipeable/to-array.spec.ts | 53 +++++ packages/rxjs/src/pipeable/to-array.ts | 37 ++++ packages/rxjs/src/rx.ts | 1 + packages/rxjs/src/take.ts | 33 +-- packages/rxjs/test/import/commonjs.cjs | 25 ++- packages/rxjs/test/import/esm.mjs | 25 ++- packages/rxjs/test/types/pipeable-api.ts | 30 ++- 17 files changed, 671 insertions(+), 54 deletions(-) create mode 100644 packages/rxjs/src/pipeable/map-operator.ts create mode 100644 packages/rxjs/src/pipeable/subscribe.spec.ts create mode 100644 packages/rxjs/src/pipeable/subscribe.ts create mode 100644 packages/rxjs/src/pipeable/take-operator.ts create mode 100644 packages/rxjs/src/pipeable/take.spec.ts create mode 100644 packages/rxjs/src/pipeable/take.ts create mode 100644 packages/rxjs/src/pipeable/to-array.spec.ts create mode 100644 packages/rxjs/src/pipeable/to-array.ts diff --git a/packages/rxjs/package.json b/packages/rxjs/package.json index e333395d0a..47ea1d208e 100644 --- a/packages/rxjs/package.json +++ b/packages/rxjs/package.json @@ -154,6 +154,11 @@ "./partition": "./src/partition.ts", "./per-subscription-subject-base": "./src/per-subscription-subject-base.ts", "./pipe": "./src/pipe.ts", + "./pipeable/filter": "./src/pipeable/filter.ts", + "./pipeable/map": "./src/pipeable/map.ts", + "./pipeable/subscribe": "./src/pipeable/subscribe.ts", + "./pipeable/take": "./src/pipeable/take.ts", + "./pipeable/to-array": "./src/pipeable/to-array.ts", "./pluck": "./src/pluck.ts", "./publish": "./src/publish.ts", "./publish-behavior": "./src/publish-behavior.ts", @@ -167,6 +172,7 @@ "./replay-subject": "./src/replay-subject.ts", "./retry": "./src/retry.ts", "./retry-when": "./src/retry-when.ts", + "./rx": "./src/rx.ts", "./sample": "./src/sample.ts", "./sample-time": "./src/sample-time.ts", "./scan": "./src/scan.ts", @@ -181,7 +187,11 @@ "./skip-while": "./src/skip-while.ts", "./start-with": "./src/start-with.ts", "./subject": "./src/subject.ts", + "./subscribe": "./src/pipeable/subscribe.ts", "./subscribe-on": "./src/subscribe-on.ts", + "./symbol/filter": "./src/filter.ts", + "./symbol/map": "./src/map.ts", + "./symbol/take": "./src/take.ts", "./switch-map": "./src/switch-map.ts", "./switch-scan": "./src/switch-scan.ts", "./take": "./src/take.ts", @@ -196,6 +206,7 @@ "./timeout-error": "./src/timeout-error.ts", "./timer": "./src/timer.ts", "./timestamp": "./src/timestamp.ts", + "./to-array": "./src/pipeable/to-array.ts", "./window": "./src/window.ts", "./window-count": "./src/window-count.ts", "./window-time": "./src/window-time.ts", @@ -1415,6 +1426,96 @@ "default": "./dist/esm/pipe.js" } }, + "./pipeable/filter": { + "browser": { + "types": "./dist/esm/pipeable/filter.d.ts", + "default": "./dist/esm/pipeable/filter.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/filter.d.ts", + "default": "./dist/esm/pipeable/filter.js" + }, + "import": { + "types": "./dist/esm/pipeable/filter.d.ts", + "default": "./dist/esm/pipeable/filter.js" + }, + "require": { + "types": "./dist/esm/pipeable/filter.d.ts", + "default": "./dist/esm/pipeable/filter.js" + } + }, + "./pipeable/map": { + "browser": { + "types": "./dist/esm/pipeable/map.d.ts", + "default": "./dist/esm/pipeable/map.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/map.d.ts", + "default": "./dist/esm/pipeable/map.js" + }, + "import": { + "types": "./dist/esm/pipeable/map.d.ts", + "default": "./dist/esm/pipeable/map.js" + }, + "require": { + "types": "./dist/esm/pipeable/map.d.ts", + "default": "./dist/esm/pipeable/map.js" + } + }, + "./pipeable/subscribe": { + "browser": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + }, + "import": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + }, + "require": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + } + }, + "./pipeable/take": { + "browser": { + "types": "./dist/esm/pipeable/take.d.ts", + "default": "./dist/esm/pipeable/take.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/take.d.ts", + "default": "./dist/esm/pipeable/take.js" + }, + "import": { + "types": "./dist/esm/pipeable/take.d.ts", + "default": "./dist/esm/pipeable/take.js" + }, + "require": { + "types": "./dist/esm/pipeable/take.d.ts", + "default": "./dist/esm/pipeable/take.js" + } + }, + "./pipeable/to-array": { + "browser": { + "types": "./dist/esm/pipeable/to-array.d.ts", + "default": "./dist/esm/pipeable/to-array.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/to-array.d.ts", + "default": "./dist/esm/pipeable/to-array.js" + }, + "import": { + "types": "./dist/esm/pipeable/to-array.d.ts", + "default": "./dist/esm/pipeable/to-array.js" + }, + "require": { + "types": "./dist/esm/pipeable/to-array.d.ts", + "default": "./dist/esm/pipeable/to-array.js" + } + }, "./pluck": { "browser": { "types": "./dist/esm/pluck.d.ts", @@ -1649,6 +1750,24 @@ "default": "./dist/esm/retry-when.js" } }, + "./rx": { + "browser": { + "types": "./dist/esm/rx.d.ts", + "default": "./dist/esm/rx.js" + }, + "webpack": { + "types": "./dist/esm/rx.d.ts", + "default": "./dist/esm/rx.js" + }, + "import": { + "types": "./dist/esm/rx.d.ts", + "default": "./dist/esm/rx.js" + }, + "require": { + "types": "./dist/esm/rx.d.ts", + "default": "./dist/esm/rx.js" + } + }, "./sample": { "browser": { "types": "./dist/esm/sample.d.ts", @@ -1901,6 +2020,24 @@ "default": "./dist/esm/subject.js" } }, + "./subscribe": { + "browser": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + }, + "import": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + }, + "require": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + } + }, "./subscribe-on": { "browser": { "types": "./dist/esm/subscribe-on.d.ts", @@ -1919,6 +2056,60 @@ "default": "./dist/esm/subscribe-on.js" } }, + "./symbol/filter": { + "browser": { + "types": "./dist/esm/filter.d.ts", + "default": "./dist/esm/filter.js" + }, + "webpack": { + "types": "./dist/esm/filter.d.ts", + "default": "./dist/esm/filter.js" + }, + "import": { + "types": "./dist/esm/filter.d.ts", + "default": "./dist/esm/filter.js" + }, + "require": { + "types": "./dist/esm/filter.d.ts", + "default": "./dist/esm/filter.js" + } + }, + "./symbol/map": { + "browser": { + "types": "./dist/esm/map.d.ts", + "default": "./dist/esm/map.js" + }, + "webpack": { + "types": "./dist/esm/map.d.ts", + "default": "./dist/esm/map.js" + }, + "import": { + "types": "./dist/esm/map.d.ts", + "default": "./dist/esm/map.js" + }, + "require": { + "types": "./dist/esm/map.d.ts", + "default": "./dist/esm/map.js" + } + }, + "./symbol/take": { + "browser": { + "types": "./dist/esm/take.d.ts", + "default": "./dist/esm/take.js" + }, + "webpack": { + "types": "./dist/esm/take.d.ts", + "default": "./dist/esm/take.js" + }, + "import": { + "types": "./dist/esm/take.d.ts", + "default": "./dist/esm/take.js" + }, + "require": { + "types": "./dist/esm/take.d.ts", + "default": "./dist/esm/take.js" + } + }, "./switch-map": { "browser": { "types": "./dist/esm/switch-map.d.ts", @@ -2171,6 +2362,24 @@ "default": "./dist/esm/timestamp.js" } }, + "./to-array": { + "browser": { + "types": "./dist/esm/pipeable/to-array.d.ts", + "default": "./dist/esm/pipeable/to-array.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/to-array.d.ts", + "default": "./dist/esm/pipeable/to-array.js" + }, + "import": { + "types": "./dist/esm/pipeable/to-array.d.ts", + "default": "./dist/esm/pipeable/to-array.js" + }, + "require": { + "types": "./dist/esm/pipeable/to-array.d.ts", + "default": "./dist/esm/pipeable/to-array.js" + } + }, "./window": { "browser": { "types": "./dist/esm/window.d.ts", diff --git a/packages/rxjs/src/index.ts b/packages/rxjs/src/index.ts index 9d60501956..32891a6f39 100644 --- a/packages/rxjs/src/index.ts +++ b/packages/rxjs/src/index.ts @@ -23,6 +23,9 @@ export { export { PerSubscriptionSubjectBase } from './per-subscription-subject-base.js'; export { filter } from './pipeable/filter.js'; export { map } from './pipeable/map.js'; +export { subscribe, type Subscription } from './pipeable/subscribe.js'; +export { take } from './pipeable/take.js'; +export { toArray } from './pipeable/to-array.js'; export type { OperatorFunction, UnaryFunction } from './pipeable/types.js'; export { replaySubject, type ReplaySubjectConfig } from './replay-subject.js'; export { rx } from './rx.js'; diff --git a/packages/rxjs/src/map.ts b/packages/rxjs/src/map.ts index e2cde588db..0579dda700 100644 --- a/packages/rxjs/src/map.ts +++ b/packages/rxjs/src/map.ts @@ -1,4 +1,4 @@ -import { mapOperator } from './pipeable/map.js'; +import { mapOperator } from './pipeable/map-operator.js'; import { operate } from './pipeable/operate.js'; export const map: unique symbol = Symbol('map'); diff --git a/packages/rxjs/src/pipeable/map-operator.ts b/packages/rxjs/src/pipeable/map-operator.ts new file mode 100644 index 0000000000..ed13430696 --- /dev/null +++ b/packages/rxjs/src/pipeable/map-operator.ts @@ -0,0 +1,16 @@ +import { subscribeToSource } from '../util/observable-helpers.js'; + +/** @internal */ +export function mapOperator( + project: (value: In, index: number) => Out +): (source: Observable, subscriber: Subscriber) => void { + return (source, subscriber) => { + let index = 0; + + subscribeToSource(source, subscriber, { + next(value) { + subscriber.next(project(value, index++)); + }, + }); + }; +} diff --git a/packages/rxjs/src/pipeable/map.ts b/packages/rxjs/src/pipeable/map.ts index 353fcabd6e..9316793031 100644 --- a/packages/rxjs/src/pipeable/map.ts +++ b/packages/rxjs/src/pipeable/map.ts @@ -1,4 +1,4 @@ -import { subscribeToSource } from '../util/observable-helpers.js'; +import { mapOperator } from './map-operator.js'; import { operate } from './operate.js'; import type { OperatorFunction } from './types.js'; @@ -13,8 +13,8 @@ import type { OperatorFunction } from './types.js'; * Errors thrown by `project` are delivered to the result Observable and close * the active upstream work. * - * @typeParam T The source value type. - * @typeParam R The projected value type. + * @typeParam In The source value type. + * @typeParam Out The projected value type. * @param project Converts each source value and index into a result value. * @returns A unary operator for use with `rx` or another composition helper. * @@ -33,18 +33,3 @@ import type { OperatorFunction } from './types.js'; export function map(project: (value: In, index: number) => Out): OperatorFunction { return operate(mapOperator(project)); } - -/** @internal */ -export function mapOperator( - project: (value: In, index: number) => Out -): (source: Observable, subscriber: Subscriber) => void { - return (source, subscriber) => { - let index = 0; - - subscribeToSource(source, subscriber, { - next(value) { - subscriber.next(project(value, index++)); - }, - }); - }; -} diff --git a/packages/rxjs/src/pipeable/subscribe.spec.ts b/packages/rxjs/src/pipeable/subscribe.spec.ts new file mode 100644 index 0000000000..5a28158ffa --- /dev/null +++ b/packages/rxjs/src/pipeable/subscribe.spec.ts @@ -0,0 +1,78 @@ +import { describe, expect, expectTypeOf, it } from 'vitest'; +import { rx } from '../rx.js'; +import { subscribe, type Subscription } from './subscribe.js'; + +describe('pipeable subscribe', () => { + it('returns a live AbortSignal-backed cancellation handle', () => { + let sourceSubscriber: Subscriber | undefined; + let teardowns = 0; + const values: number[] = []; + const source = new Observable((subscriber) => { + sourceSubscriber = subscriber; + subscriber.addTeardown(() => teardowns++); + }); + + const subscription = subscribe((value) => values.push(value))(source); + expectTypeOf(subscription).toEqualTypeOf(); + expect(subscription.closed).toBe(false); + + sourceSubscriber?.next(1); + subscription.unsubscribe(); + sourceSubscriber?.next(2); + + expect(values).toEqual([1]); + expect(subscription.closed).toBe(true); + expect(teardowns).toBe(1); + }); + + it('is already closed when a synchronous source completes', () => { + const notifications: Array = []; + const subscription = rx( + [1, 2], + subscribe({ + next: (value) => notifications.push(value), + complete: () => notifications.push('complete'), + }) + ); + + expectTypeOf(subscription).toEqualTypeOf(); + expect(notifications).toEqual([1, 2, 'complete']); + expect(subscription.closed).toBe(true); + }); + + it('closes on source error after notifying the observer', () => { + const failure = new Error('failed'); + const errors: unknown[] = []; + const source = new Observable((subscriber) => subscriber.error(failure)); + + const subscription = subscribe({ error: (error) => errors.push(error) })(source); + + expect(errors).toEqual([failure]); + expect(subscription.closed).toBe(true); + }); + + it('cancels one observer without cancelling a shared source for another', () => { + let sourceSubscriber: Subscriber | undefined; + let teardowns = 0; + const source = new Observable((subscriber) => { + sourceSubscriber = subscriber; + subscriber.addTeardown(() => teardowns++); + }); + const firstValues: number[] = []; + const secondValues: number[] = []; + const first = subscribe((value) => firstValues.push(value))(source); + const second = subscribe((value) => secondValues.push(value))(source); + + first.unsubscribe(); + sourceSubscriber?.next(1); + + expect(first.closed).toBe(true); + expect(second.closed).toBe(false); + expect(firstValues).toEqual([]); + expect(secondValues).toEqual([1]); + expect(teardowns).toBe(0); + + second.unsubscribe(); + expect(teardowns).toBe(1); + }); +}); diff --git a/packages/rxjs/src/pipeable/subscribe.ts b/packages/rxjs/src/pipeable/subscribe.ts new file mode 100644 index 0000000000..d0fe2a3468 --- /dev/null +++ b/packages/rxjs/src/pipeable/subscribe.ts @@ -0,0 +1,79 @@ +import '@rxjs/observable-polyfill'; +import type { UnaryFunction } from './types.js'; + +/** + * A minimal compatibility handle for cancelling one Observable observer. + * + * `closed` is a live view of the handle's backing `AbortSignal`. It becomes + * `true` after `unsubscribe()`, source completion, or source error. + */ +export interface Subscription { + readonly closed: boolean; + unsubscribe(): void; +} + +/** + * Subscribes to a source and returns a minimal AbortSignal-backed handle. + * + * This is an optional compatibility terminal for code that needs the familiar + * `unsubscribe()` shape. It does not recreate RxJS 7's Subscription tree, + * teardown aggregation, or `add`/`remove` methods. + * + * @typeParam In The source value type. + * @param observer A next callback or partial Observer. + * @returns A terminal unary function for use with `rx` or another composition + * helper. + * + * @example Subscribe and cancel through `rx` + * ```ts + * import { rx, subscribe } from 'rxjs'; + * + * const subscription = rx([1, 2, 3], subscribe(console.log)); + * subscription.unsubscribe(); + * console.log(subscription.closed); // true + * ``` + */ +export function subscribe( + observer?: Partial> | ((value: In) => void) | null +): UnaryFunction, Subscription> { + return (source) => { + const controller = new AbortController(); + const destination = typeof observer === 'function' ? { next: observer } : observer; + + source.subscribe( + { + next(value) { + destination?.next?.(value); + }, + error(error) { + try { + if (destination?.error) { + destination.error(error); + } else { + throw error; + } + } finally { + controller.abort(error); + } + }, + complete() { + try { + destination?.complete?.(); + } finally { + controller.abort(); + } + }, + }, + { signal: controller.signal } + ); + + return { + get closed() { + return controller.signal.aborted; + }, + unsubscribe() { + controller.abort(); + }, + }; + }; +} diff --git a/packages/rxjs/src/pipeable/take-operator.ts b/packages/rxjs/src/pipeable/take-operator.ts new file mode 100644 index 0000000000..47644d2e48 --- /dev/null +++ b/packages/rxjs/src/pipeable/take-operator.ts @@ -0,0 +1,33 @@ +import { subscribeToSource } from '../util/observable-helpers.js'; + +/** @internal */ +export function takeOperator(count: number): (source: Observable, subscriber: Subscriber) => void { + return (source, subscriber) => { + if (count <= 0) { + subscriber.complete(); + return; + } + + let seen = 0; + const sourceController = new AbortController(); + subscribeToSource( + source, + subscriber, + { + next(value) { + if (++seen <= count) { + const reachedLimit = count <= seen; + if (reachedLimit) { + sourceController.abort(); + } + subscriber.next(value); + if (reachedLimit) { + subscriber.complete(); + } + } + }, + }, + sourceController.signal + ); + }; +} diff --git a/packages/rxjs/src/pipeable/take.spec.ts b/packages/rxjs/src/pipeable/take.spec.ts new file mode 100644 index 0000000000..196f95c101 --- /dev/null +++ b/packages/rxjs/src/pipeable/take.spec.ts @@ -0,0 +1,53 @@ +import { describe, expect, expectTypeOf, it } from 'vitest'; +import { take as takeSymbol } from '../take.js'; +import { take } from './take.js'; + +describe('pipeable take', () => { + it('emits the requested values and cancels synchronous source work', () => { + const produced: number[] = []; + const values: Array = []; + const source = new Observable((subscriber) => { + for (const value of [1, 2, 3, 4]) { + if (!subscriber.active) { + break; + } + produced.push(value); + subscriber.next(value); + } + }); + + const firstTwo = take(2)(source); + expectTypeOf(firstTwo).toEqualTypeOf>(); + firstTwo.subscribe({ + next: (value) => values.push(value), + complete: () => values.push('complete'), + }); + + expect(values).toEqual([1, 2, 'complete']); + expect(produced).toEqual([1, 2]); + }); + + it.each([0, -1])('completes without activating the source for a count of %i', (count) => { + let activations = 0; + const values: string[] = []; + const source = new Observable(() => activations++); + + take(count)(source).subscribe({ complete: () => values.push('complete') }); + + expect(activations).toBe(0); + expect(values).toEqual(['complete']); + }); + + it('keeps the pipeable and exact-Symbol forms behaviorally aligned', () => { + const pipeableValues: number[] = []; + const symbolValues: number[] = []; + + take(2)(Observable.from([1, 2, 3])).subscribe((value) => pipeableValues.push(value)); + Observable.from([1, 2, 3]) + [takeSymbol](2) + .subscribe((value) => symbolValues.push(value)); + + expect(pipeableValues).toEqual([1, 2]); + expect(symbolValues).toEqual(pipeableValues); + }); +}); diff --git a/packages/rxjs/src/pipeable/take.ts b/packages/rxjs/src/pipeable/take.ts new file mode 100644 index 0000000000..2a9e7776b2 --- /dev/null +++ b/packages/rxjs/src/pipeable/take.ts @@ -0,0 +1,27 @@ +import { operate } from './operate.js'; +import { takeOperator } from './take-operator.js'; +import type { OperatorFunction } from './types.js'; + +/** + * Emits at most `count` values from the source, then completes. + * + * Reaching the limit cancels upstream work before the last value is delivered, + * which prevents a synchronous producer from continuing after the result has + * completed. Counts less than or equal to zero complete without activating the + * source. + * + * @typeParam In The source value type. + * @param count The maximum number of values to emit. + * @returns A unary operator for use with `rx` or another composition helper. + * + * @example Take the first two values + * ```ts + * import { rx, take } from 'rxjs'; + * + * const firstTwo = rx([1, 2, 3, 4], take(2)); + * firstTwo.subscribe(console.log); // 1, 2 + * ``` + */ +export function take(count: number): OperatorFunction { + return operate(takeOperator(count)); +} diff --git a/packages/rxjs/src/pipeable/to-array.spec.ts b/packages/rxjs/src/pipeable/to-array.spec.ts new file mode 100644 index 0000000000..f331cb7054 --- /dev/null +++ b/packages/rxjs/src/pipeable/to-array.spec.ts @@ -0,0 +1,53 @@ +import { describe, expect, expectTypeOf, it } from 'vitest'; +import { toArray } from './to-array.js'; + +describe('pipeable toArray', () => { + it('emits one collected array and remains an Observable', () => { + const values: number[][] = []; + const collected = toArray()(Observable.from([1, 2, 3])); + + expectTypeOf(collected).toEqualTypeOf>(); + expect(collected).toBeInstanceOf(Observable); + expect(collected).not.toBeInstanceOf(Promise); + collected.subscribe((value) => values.push(value)); + + expect(values).toEqual([[1, 2, 3]]); + }); + + it('forwards errors without emitting a partial array', () => { + const failure = new Error('source failed'); + const values: number[][] = []; + const errors: unknown[] = []; + const source = new Observable((subscriber) => { + subscriber.next(1); + subscriber.error(failure); + }); + + toArray()(source).subscribe({ + next: (value) => values.push(value), + error: (error) => errors.push(error), + }); + + expect(values).toEqual([]); + expect(errors).toEqual([failure]); + }); + + it('discards active collection state when its last observer cancels', () => { + let sourceSubscriber: Subscriber | undefined; + let teardowns = 0; + const source = new Observable((subscriber) => { + sourceSubscriber = subscriber; + subscriber.addTeardown(() => teardowns++); + }); + const controller = new AbortController(); + const values: number[][] = []; + + toArray()(source).subscribe((value) => values.push(value), { signal: controller.signal }); + sourceSubscriber?.next(1); + controller.abort(); + sourceSubscriber?.complete(); + + expect(values).toEqual([]); + expect(teardowns).toBe(1); + }); +}); diff --git a/packages/rxjs/src/pipeable/to-array.ts b/packages/rxjs/src/pipeable/to-array.ts new file mode 100644 index 0000000000..667fc87ccd --- /dev/null +++ b/packages/rxjs/src/pipeable/to-array.ts @@ -0,0 +1,37 @@ +import { subscribeToSource } from '../util/observable-helpers.js'; +import { operate } from './operate.js'; +import type { OperatorFunction } from './types.js'; + +/** + * Collects every source value and emits one array when the source completes. + * + * Unlike the platform `Observable.prototype.toArray()`, this RxJS function + * returns an Observable. Source errors are forwarded without emitting a + * partial array, and cancellation discards the active collection. + * + * @typeParam In The source value type. + * @returns A unary operator for use with `rx` or another composition helper. + * + * @example Collect values without crossing into a Promise + * ```ts + * import { rx, toArray } from 'rxjs'; + * + * const collected = rx([1, 2, 3], toArray()); + * collected.subscribe(console.log); // [1, 2, 3] + * ``` + */ +export function toArray(): OperatorFunction { + return operate((source, subscriber) => { + const values: In[] = []; + + subscribeToSource(source, subscriber, { + next(value) { + values.push(value); + }, + complete() { + subscriber.next(values); + subscriber.complete(); + }, + }); + }); +} diff --git a/packages/rxjs/src/rx.ts b/packages/rxjs/src/rx.ts index d0863dbece..566a00648b 100644 --- a/packages/rxjs/src/rx.ts +++ b/packages/rxjs/src/rx.ts @@ -1,3 +1,4 @@ +import '@rxjs/observable-polyfill'; import type { UnaryFunction } from './pipeable/types.js'; /** diff --git a/packages/rxjs/src/take.ts b/packages/rxjs/src/take.ts index 817580eb62..c1ad7fa5c9 100644 --- a/packages/rxjs/src/take.ts +++ b/packages/rxjs/src/take.ts @@ -1,5 +1,5 @@ -import { create } from './create.js'; -import { subscribeToSource } from './util/observable-helpers.js'; +import { operate } from './pipeable/operate.js'; +import { takeOperator } from './pipeable/take-operator.js'; export const take: unique symbol = Symbol('take'); @@ -10,32 +10,5 @@ declare global { } Observable.prototype[take] = function (this: Observable, count: number): Observable { - return this[create]((subscriber) => { - if (count <= 0) { - subscriber.complete(); - return; - } - - let seen = 0; - const sourceController = new AbortController(); - subscribeToSource( - this, - subscriber, - { - next: (value) => { - if (++seen <= count) { - const reachedLimit = count <= seen; - if (reachedLimit) { - sourceController.abort(); - } - subscriber.next(value); - if (reachedLimit) { - subscriber.complete(); - } - } - }, - }, - sourceController.signal - ); - }); + return operate(takeOperator(count))(this); }; diff --git a/packages/rxjs/test/import/commonjs.cjs b/packages/rxjs/test/import/commonjs.cjs index 9a5aad0b19..795d2dace8 100644 --- a/packages/rxjs/test/import/commonjs.cjs +++ b/packages/rxjs/test/import/commonjs.cjs @@ -1,6 +1,13 @@ const assert = require('node:assert/strict'); -const { ColdObservable, Subject, TimeoutError, filter, map, rx } = require('rxjs'); -const { map: mapSymbol } = require('rxjs/map'); +const { ColdObservable, Subject, TimeoutError, filter, map, rx, subscribe, take, toArray } = require('rxjs'); +const deepMapModule = require('rxjs/pipeable/map'); +const deepTakeModule = require('rxjs/pipeable/take'); +const { rx: deepRx } = require('rxjs/rx'); +const { subscribe: deepSubscribe } = require('rxjs/subscribe'); +const { filter: filterSymbol } = require('rxjs/symbol/filter'); +const { map: mapSymbol } = require('rxjs/symbol/map'); +const { take: takeSymbol } = require('rxjs/symbol/take'); +const { toArray: deepToArray } = require('rxjs/to-array'); const { pipe } = require('rxjs/pipe'); const { scan } = require('rxjs/scan'); const { switchMap } = require('rxjs/switch-map'); @@ -14,8 +21,22 @@ assert.equal(typeof TimeoutError, 'function'); assert.equal(typeof rx, 'function'); assert.equal(typeof map, 'function'); assert.equal(typeof filter, 'function'); +assert.equal(typeof take, 'function'); +assert.equal(typeof toArray, 'function'); +assert.equal(typeof subscribe, 'function'); +assert.equal(typeof deepMapModule.map, 'function'); +assert.equal(typeof deepTakeModule.take, 'function'); +assert.equal('mapOperator' in deepMapModule, false); +assert.equal('takeOperator' in deepTakeModule, false); +assert.equal(typeof deepRx, 'function'); +assert.equal(typeof deepSubscribe, 'function'); +assert.equal(typeof deepToArray, 'function'); assert.equal(typeof mapSymbol, 'symbol'); +assert.equal(typeof filterSymbol, 'symbol'); +assert.equal(typeof takeSymbol, 'symbol'); assert.equal(typeof globalThis.Observable.prototype[mapSymbol], 'function'); +assert.equal(typeof globalThis.Observable.prototype[filterSymbol], 'function'); +assert.equal(typeof globalThis.Observable.prototype[takeSymbol], 'function'); for (const symbol of [pipe, scan, switchMap, timeout, timer]) { assert.equal(typeof symbol, 'symbol'); } diff --git a/packages/rxjs/test/import/esm.mjs b/packages/rxjs/test/import/esm.mjs index 20e5de9f2f..e0723a2807 100644 --- a/packages/rxjs/test/import/esm.mjs +++ b/packages/rxjs/test/import/esm.mjs @@ -1,6 +1,13 @@ import assert from 'node:assert/strict'; -import { ColdObservable, Subject, TimeoutError, filter, map, rx } from 'rxjs'; -import { map as mapSymbol } from 'rxjs/map'; +import { ColdObservable, Subject, TimeoutError, filter, map, rx, subscribe, take, toArray } from 'rxjs'; +import * as deepMapModule from 'rxjs/pipeable/map'; +import * as deepTakeModule from 'rxjs/pipeable/take'; +import { rx as deepRx } from 'rxjs/rx'; +import { subscribe as deepSubscribe } from 'rxjs/subscribe'; +import { filter as filterSymbol } from 'rxjs/symbol/filter'; +import { map as mapSymbol } from 'rxjs/symbol/map'; +import { take as takeSymbol } from 'rxjs/symbol/take'; +import { toArray as deepToArray } from 'rxjs/to-array'; import { pipe } from 'rxjs/pipe'; import { scan } from 'rxjs/scan'; import { switchMap } from 'rxjs/switch-map'; @@ -14,8 +21,22 @@ assert.equal(typeof TimeoutError, 'function'); assert.equal(typeof rx, 'function'); assert.equal(typeof map, 'function'); assert.equal(typeof filter, 'function'); +assert.equal(typeof take, 'function'); +assert.equal(typeof toArray, 'function'); +assert.equal(typeof subscribe, 'function'); +assert.equal(typeof deepMapModule.map, 'function'); +assert.equal(typeof deepTakeModule.take, 'function'); +assert.equal('mapOperator' in deepMapModule, false); +assert.equal('takeOperator' in deepTakeModule, false); +assert.equal(typeof deepRx, 'function'); +assert.equal(typeof deepSubscribe, 'function'); +assert.equal(typeof deepToArray, 'function'); assert.equal(typeof mapSymbol, 'symbol'); +assert.equal(typeof filterSymbol, 'symbol'); +assert.equal(typeof takeSymbol, 'symbol'); assert.equal(typeof globalThis.Observable.prototype[mapSymbol], 'function'); +assert.equal(typeof globalThis.Observable.prototype[filterSymbol], 'function'); +assert.equal(typeof globalThis.Observable.prototype[takeSymbol], 'function'); for (const symbol of [pipe, scan, switchMap, timeout, timer]) { assert.equal(typeof symbol, 'symbol'); } diff --git a/packages/rxjs/test/types/pipeable-api.ts b/packages/rxjs/test/types/pipeable-api.ts index efe591bce8..907f1e414f 100644 --- a/packages/rxjs/test/types/pipeable-api.ts +++ b/packages/rxjs/test/types/pipeable-api.ts @@ -1,4 +1,9 @@ -import { filter, map, rx, type OperatorFunction, type UnaryFunction } from 'rxjs'; +import { filter, map, rx, subscribe, take, toArray, type OperatorFunction, type Subscription, type UnaryFunction } from 'rxjs'; +import { map as deepMap } from 'rxjs/pipeable/map'; +import { rx as deepRx } from 'rxjs/rx'; +import { subscribe as deepSubscribe } from 'rxjs/subscribe'; +import { map as mapSymbol } from 'rxjs/symbol/map'; +import { toArray as deepToArray } from 'rxjs/to-array'; const input: ObservableInput = [1, 2, 3]; const stringify: OperatorFunction = map((value) => String(value)); @@ -16,6 +21,22 @@ const narrowed: Observable = rx( const nullable: ObservableInput<0 | 1 | '' | 'value' | null | undefined> = [0, 1, '', 'value', null, undefined]; const truthy: Observable<1 | 'value'> = rx(nullable, filter(Boolean)); +const firstTwo: Observable = rx(input, take(2)); +const collected: Observable = rx(input, take(2), toArray()); +const subscription: Subscription = rx( + input, + subscribe((value) => value.toFixed()) +); +const deepMapped: Observable = deepRx( + input, + deepMap((value) => value.toFixed()) +); +const deepCollected: Observable = deepRx(input, deepToArray()); +const deepSubscription: Subscription = deepRx( + input, + deepSubscribe((value) => value.toFixed()) +); +const symbolMapped: Observable = Observable.from(input)[mapSymbol]((value) => value.toFixed()); const increment = (value: number) => value + 1; const first = (_source: Observable) => 0; @@ -29,5 +50,12 @@ void strings; void finalLength; void narrowed; void truthy; +void firstTwo; +void collected; +void subscription; +void deepMapped; +void deepCollected; +void deepSubscription; +void symbolMapped; void nine; void unsafeTen; From 1b57381e81f9e050fb69b6af92cde4cf5c1064dc Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Thu, 6 Aug 2026 14:25:07 -0500 Subject: [PATCH 6/7] docs(rxjs): record second pipeable slice --- docs/rxjs-next/ARCHITECTURE.md | 19 ++++++- docs/rxjs-next/COMPATIBILITY.md | 29 +++++----- docs/rxjs-next/DECISIONS.md | 16 ++++++ docs/rxjs-next/OPEN_QUESTIONS.md | 15 +++-- docs/rxjs-next/PROJECT_PLAN.md | 28 +++++++++ packages/rxjs/MIGRATION.md | 51 ++++++++++++++--- packages/rxjs/README.md | 19 ++++--- packages/rxjs/docs/API.md | 43 ++++++++++++-- packages/rxjs/docs/PIPEABLE_EXPERIMENT.md | 57 ++++++++++++++++--- .../rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md | 36 ++++++------ .../ported/unsupported-surface-catalog.json | 12 ++-- 11 files changed, 251 insertions(+), 74 deletions(-) diff --git a/docs/rxjs-next/ARCHITECTURE.md b/docs/rxjs-next/ARCHITECTURE.md index b7ea964769..ff00c4204d 100644 --- a/docs/rxjs-next/ARCHITECTURE.md +++ b/docs/rxjs-next/ARCHITECTURE.md @@ -568,8 +568,8 @@ smaller than the proposed destination: - the ambient `ObservableInput` union names the platform conversion boundary; public `UnaryFunction` and `OperatorFunction` type aliases describe composition without a redundant mono-type alias; -- pipeable `map` and `filter` are root exports and use an internal `operate` - helper; +- pipeable `map`, `filter`, and `take` are root exports and use an internal + `operate` helper; - `operate` creates through the source's D-037 `[create]` protocol and catches synchronous connection failures, while `subscribeToSource` continues to own signal propagation and notification-callback safety; @@ -578,13 +578,26 @@ smaller than the proposed destination: The first maintainer review selected a shared internal callback for behavior implemented by both public forms. Pipeable `map` and exact-Symbol `[map]` now apply the same `mapOperator(project)` callback through `operate`; neither public -surface delegates through the other. +surface delegates through the other. The second slice applies the same pattern +to `takeOperator(count)`. + +The post-review slice also adds two terminal shapes. RxJS `toArray()` is an +`OperatorFunction` that emits one array on source completion instead +of returning the Promise produced by the platform string method. The optional +`subscribe(observer)` terminal returns a minimal AbortSignal-backed +`Subscription` with `unsubscribe()` and a live `closed` getter; it is not an +RxJS 7 Subscription tree. The pilot does not settle the package layout. In particular, `rxjs/map` and `rxjs/filter` still export their existing Symbols even though the root exports pipeable functions with those names. Moving exact Symbols to an `rxjs/symbol` boundary and making ordinary deep imports pipeable would alter public exports and package side effects and remains gated on maintainer review. +The pilot now exposes additive `rxjs/pipeable/{map,filter,take}` and +`rxjs/symbol/{map,filter,take}` aliases so both per-operator directions can be +tested without changing the established paths. `rxjs/rx`, `rxjs/to-array`, and +`rxjs/subscribe` are direct deep imports because they have no legacy Symbol +collision. The initial `rx` declaration uses explicit overloads through nine transformations and an `unknown` fallback after that point. This makes the diff --git a/docs/rxjs-next/COMPATIBILITY.md b/docs/rxjs-next/COMPATIBILITY.md index 1adf2fb8f8..8c6fe0c8ce 100644 --- a/docs/rxjs-next/COMPATIBILITY.md +++ b/docs/rxjs-next/COMPATIBILITY.md @@ -113,16 +113,16 @@ remain unimplemented review items. D-050 stabilizes `ColdObservable`, `PerSubscriptionSubjectBase`, the Subject family, and the Symbol-keyed `pipe` as this intentional Next surface. -| Intentional API | Public form | Own contract | -| ---------------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `ColdObservable` | Root and `rxjs/cold-observable` class | One producer and compatibility Subscriber per direct `subscribe()` call | -| `Subject` | Root and `rxjs/subject` class | Hot live fanout plus a non-mutating `asObservable()` platform view | -| `AsyncSubject` | Root and `rxjs/async-subject` class | Hot final-value-on-completion fanout with retained terminal behavior | -| Behavior subject | Root and `rxjs/behavior-subject` lowercase factory | Hot current-value delivery for every direct observer | -| Replay subject | Root and `rxjs/replay-subject` lowercase factory | Hot size/host-time-bounded replay followed by live fanout | -| `PerSubscriptionSubjectBase` | Root and explicit advanced-base subpath | Protected per-direct-observer setup hook for specialized hot Subject implementations | -| Exact Symbol-keyed `pipe` | `rxjs/pipe` static and instance Symbol | Typed one-to-seven-step composition; no `.pipe`, pipeable imports, or `OperatorFunction` claim | -| Pipeable pilot | Root `rx`, `map`, `filter`, and composition types | New Next contracts with a nine-transformation `rx` type horizon | +| Intentional API | Public form | Own contract | +| ---------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `ColdObservable` | Root and `rxjs/cold-observable` class | One producer and compatibility Subscriber per direct `subscribe()` call | +| `Subject` | Root and `rxjs/subject` class | Hot live fanout plus a non-mutating `asObservable()` platform view | +| `AsyncSubject` | Root and `rxjs/async-subject` class | Hot final-value-on-completion fanout with retained terminal behavior | +| Behavior subject | Root and `rxjs/behavior-subject` lowercase factory | Hot current-value delivery for every direct observer | +| Replay subject | Root and `rxjs/replay-subject` lowercase factory | Hot size/host-time-bounded replay followed by live fanout | +| `PerSubscriptionSubjectBase` | Root and explicit advanced-base subpath | Protected per-direct-observer setup hook for specialized hot Subject implementations | +| Exact Symbol-keyed `pipe` | `rxjs/pipe` static and instance Symbol | Typed one-to-seven-step composition; no `.pipe`, pipeable imports, or `OperatorFunction` claim | +| Pipeable pilot | Root `rx`, `map`, `filter`, `take`, `toArray`, `subscribe`, and composition types | New Next contracts with a nine-transformation `rx` horizon and a minimal AbortSignal-backed subscription handle | `PerSubscriptionSubjectBase` is hot: its Subject producer exists as soon as the instance is constructed. Its distinction from `Subject` is that it inherits @@ -234,11 +234,14 @@ support: producer-per-subscription Next semantics. The exact Symbol-addressed `[pipe]` remains an intentional Next API. D-060's -parallel pilot now adds root `rx`, pipeable `map` and `filter`, plus +parallel pilot now adds root `rx`, pipeable `map`, `filter`, `take`, and +Observable-returning `toArray`, plus `UnaryFunction` and `OperatorFunction`. `OperatorFunction` replaces the redundant `MonoTypeOperatorFunction` alias. These are new Next contracts and do -not imply that RxJS 7 import paths, scheduler -overloads, broad `ObservableInput`, or `Subscription` behavior are restored. +not imply that RxJS 7 import paths, scheduler overloads, broad +`ObservableInput`, or full `Subscription` behavior are restored. The optional +`subscribe` terminal exposes only `unsubscribe()` and a live `closed` getter +backed by one AbortSignal. The initial `rx` overloads preserve exact types through nine transformations and return `unknown` for longer chains. Migration tooling must not hide that diff --git a/docs/rxjs-next/DECISIONS.md b/docs/rxjs-next/DECISIONS.md index 15f0ab3a1d..22e7a982ba 100644 --- a/docs/rxjs-next/DECISIONS.md +++ b/docs/rxjs-next/DECISIONS.md @@ -1554,6 +1554,22 @@ Status meanings: overload horizon, public-versus-internal `operate`, terminal consumers, and lite subscription facade remain subject to later review. +### Second review slice + +- **Status:** Proposed implementation for review +- **Boundary:** Add root pipeable `take`, Observable-returning `toArray`, and + optional `subscribe`. `take` and exact-Symbol `[take]` share + `takeOperator(count)` through `operate`. `toArray` collects without invoking + the platform Promise-returning method. +- **Subscription shape:** `subscribe(observer)` returns a minimal interface + whose `unsubscribe()` aborts one observer and whose live `closed` getter reads + the same backing AbortSignal. Completion and error abort it. No RxJS 7 + Subscription tree, `add`, `remove`, or teardown aggregation is restored. +- **Provisional paths:** Add direct `rxjs/rx`, `rxjs/to-array`, and + `rxjs/subscribe` paths plus additive per-operator `rxjs/pipeable/*` and + `rxjs/symbol/*` aliases for `map`, `filter`, and `take`. Established Symbol + subpaths are unchanged. + ## D-061 — Name the platform conversion union `ObservableInput` - **Status:** Accepted diff --git a/docs/rxjs-next/OPEN_QUESTIONS.md b/docs/rxjs-next/OPEN_QUESTIONS.md index a676cac35e..ea1ceeaf4b 100644 --- a/docs/rxjs-next/OPEN_QUESTIONS.md +++ b/docs/rxjs-next/OPEN_QUESTIONS.md @@ -177,9 +177,10 @@ accepted decision and product contract. ### 10. How should pipeable functions and exact Symbols coexist during beta? -D-060 proposes both surfaces and the first pilot proves only root `rx`, `map`, -and `filter`. The existing `rxjs/map` and `rxjs/filter` deep imports still -export exact Symbols. Before expanding the catalog, decide: +D-060 proposes both surfaces. After the first review, the pilot proves root +`rx`, `map`, `filter`, `take`, Observable-returning `toArray`, and a lite +`subscribe` terminal. The existing `rxjs/map`, `rxjs/filter`, and `rxjs/take` +deep imports still export exact Symbols. Before expanding the catalog, decide: - whether ordinary deep imports become pipeable functions; - whether Symbols move to one `rxjs/symbol` barrel, per-operator @@ -187,13 +188,15 @@ export exact Symbols. Before expanding the catalog, decide: - whether `operate` is internal or public; - whether nine fixed transformations is the accepted `rx` type horizon or a different design passes representative type-check performance gates; -- which Observable-returning terminal consumer and lite `subscribe` contract - should be the next review slice. +- whether the tested Observable-returning `toArray` and live AbortSignal-backed + lite `subscribe` contracts should be accepted. The first review resolved implementation sharing for overlapping behavior: both public forms use the same internal operator callback through `operate`, beginning with `mapOperator`. Package layout, overload evidence, helper -visibility, and the exact next terminal/subscription contracts remain open. +visibility, terminal/subscription acceptance, and the complete-catalog layout +remain open. Additive per-operator `rxjs/pipeable/*` and `rxjs/symbol/*` pilot +aliases gather path evidence without moving the established exports. Do not answer these questions implicitly through bulk file moves or operator conversion. The first pilot and its comparison document are the evidence for diff --git a/docs/rxjs-next/PROJECT_PLAN.md b/docs/rxjs-next/PROJECT_PLAN.md index 1e0aa87905..1b65bd7691 100644 --- a/docs/rxjs-next/PROJECT_PLAN.md +++ b/docs/rxjs-next/PROJECT_PLAN.md @@ -1706,6 +1706,11 @@ review`. This completes P6.9; the later P6.10 ruleset migration must preserve - Stop after presenting the pilot implementation and evidence to the user. Any broader file layout, export, helper, or operator-family structure remains gated on that review. +- The first maintainer review permits one follow-up slice: apply the requested + type cleanup, share map implementation logic, then add only pipeable `take`, + Observable-returning `toArray`, and the optional live AbortSignal-backed + `subscribe` facade with additive pilot deep imports. Return for review before + expanding the catalog or moving established Symbol paths. #### P6.1 completion bar @@ -3780,3 +3785,26 @@ conformance implementation depends on a runnable harness. audits, ESM and Node `require(esm)` imports, package documentation links, build, lint with zero errors, and diff hygiene. P6.12 remains `NEXT` and work stops here for the requested maintainer review. + +### 2026-08-06 — P6.12 maintainer-review continuation + +- Applied the first review: renamed the ambient conversion union directly to + `ObservableInput`, changed `UnaryFunction` to a type alias, spelled + `OperatorFunction` directly, removed `MonoTypeOperatorFunction`, and + recorded D-061. +- Moved common behavior into internal `mapOperator(project)` and + `takeOperator(count)` callbacks used through `operate` by both pipeable and + exact-Symbol forms. Public deep modules do not export those internal helpers. +- Added the bounded second slice: root pipeable `take`, Observable-returning + `toArray`, and optional AbortSignal-backed `subscribe` with `unsubscribe()` + and a live `closed` getter. Added direct non-colliding deep imports plus + additive `rxjs/pipeable/*` and `rxjs/symbol/*` aliases for the pilot without + changing established Symbol paths or the 97-Symbol catalog. +- Passed 113 source files and 774 tests in a serial full run, 28 focused tests, + 52 polyfill unit tests, both package/build/type/import gates, migration and + generated-document freshness, all 97 Symbol installation audits, package + documentation links, lint with zero errors, and diff hygiene. Three unrelated + synchronous stress tests first hit the parallel five-second ceiling; all + three passed alone and the complete serial run was green. +- P6.12 remains `NEXT`; stop after this second slice for maintainer review + before converting more operators or moving established Symbol subpaths. diff --git a/packages/rxjs/MIGRATION.md b/packages/rxjs/MIGRATION.md index e86b005987..a09d712527 100644 --- a/packages/rxjs/MIGRATION.md +++ b/packages/rxjs/MIGRATION.md @@ -2,8 +2,10 @@ RxJS 9 is a new platform-based generation of RxJS. It extends the active web-platform `Observable` with exact Symbol-keyed capabilities instead of -shipping the RxJS 7 Observable, Subscription, pipeable-operator, or scheduler -runtime. The first planned prerelease is `9.0.0-beta.0`. +shipping the RxJS 7 Observable or scheduler runtime. This branch also contains +a review-gated pipeable pilot and a minimal AbortSignal-backed subscription +handle; neither restores the complete RxJS 7 surface. The first planned +prerelease is `9.0.0-beta.0`. This is a semantic migration, not a package-version bump. Before changing imports, decide which producer, sharing, cancellation, and timing behavior each @@ -55,8 +57,8 @@ properties. ## Operator imports and composition -RxJS 7 pipeable operators become exact Symbol imports and Symbol-keyed calls. -The root package does not install the operator catalog. +The complete reviewed migration target remains exact Symbol imports and +Symbol-keyed calls. The root package does not install the Symbol catalog. ```ts // RxJS 7 @@ -81,6 +83,23 @@ The platform and RxJS forms can coexist. For example, `source[map](project)` is the RxJS contract. Importing the RxJS Symbol must not replace the platform string-named method. +The experimental branch also supports ordinary composition for its reviewed +subset: + +```ts +import { filter, map, rx } from 'rxjs'; + +const names = rx( + users, + filter((user) => user.active), + map((user) => user.name) +); +``` + +This familiar syntax does not restore the entire RxJS 7 operator catalog, +`.pipe`, scheduler overloads, or producer-per-subscription behavior. Review +the target lifecycle before choosing it as a migration destination. + RxJS 9 does not accept the RxJS 7 callback `thisArg` parameter on `every`, `filter`, `find`, `findIndex`, `map`, or `partition`. Capture state with a closure or bind the callback explicitly: @@ -101,13 +120,15 @@ import { pipe } from 'rxjs/pipe'; const names = users[pipe]((source) => source[map]((user) => user.name)); ``` -RxJS 9 does not publish `.pipe`, RxJS 7 pipeable operator functions, or the -`OperatorFunction` type family. +RxJS 9 does not publish `.pipe`. The pilot publishes a small pipeable subset, +`UnaryFunction`, and `OperatorFunction`; it is not yet a full compatibility +surface. ## Cancellation and teardown -`subscribe()` returns `undefined`. Own cancellation with an -`AbortController`, and pass its signal in the subscription options. +Platform `Observable.prototype.subscribe()` returns `undefined`. Own +cancellation with an `AbortController`, and pass its signal in the subscription +options. ```ts const controller = new AbortController(); @@ -123,6 +144,20 @@ source.subscribe( controller.abort('view disposed'); ``` +The pilot's optional `subscribe(observer)` terminal supplies only the familiar +`unsubscribe()` and live `closed` shape: + +```ts +import { rx, subscribe } from 'rxjs'; + +const subscription = rx(source, subscribe(consume)); +subscription.unsubscribe(); +console.log(subscription.closed); // true +``` + +It is one AbortController-backed observer handle, not an RxJS 7 Subscription +tree. It has no `add`, `remove`, parentage, or teardown aggregation contract. + Inside a producer, register cleanup with `subscriber.addTeardown()` instead of returning teardown logic: diff --git a/packages/rxjs/README.md b/packages/rxjs/README.md index e0cd18742a..2f99af54ca 100644 --- a/packages/rxjs/README.md +++ b/packages/rxjs/README.md @@ -24,22 +24,25 @@ prevents the old RxJS 8 work from being mistaken for this product. ## Try the pipeable pilot ```ts -import { filter, map, rx } from 'rxjs'; +import { filter, map, rx, subscribe, take, toArray } from 'rxjs'; -const result = rx( +const subscription = rx( [1, 2, 3, 4], filter((value) => value % 2 === 0), - map((value) => value * 10) + map((value) => value * 10), + take(2), + toArray(), + subscribe(console.log) ); -result.subscribe(console.log); // 20, 40 +console.log(subscription.closed); // true after synchronous completion ``` This branch is evaluating the root-level pipeable surface alongside the -existing exact-Symbol catalog. The pilot is intentionally limited to `rx`, -`map`, and `filter` until its implementation and typing approach are reviewed. -Existing operator subpaths still export their exact Symbols and install only -those capabilities. +existing exact-Symbol catalog. After the first review, the pilot contains +`rx`, `map`, `filter`, `take`, Observable-returning `toArray`, and the optional +AbortSignal-backed `subscribe` compatibility terminal. Existing operator +subpaths still export their exact Symbols and install only those capabilities. ## Choose the lifecycle deliberately diff --git a/packages/rxjs/docs/API.md b/packages/rxjs/docs/API.md index b51449e9a4..3010e401dc 100644 --- a/packages/rxjs/docs/API.md +++ b/packages/rxjs/docs/API.md @@ -18,6 +18,9 @@ import { map, replaySubject, rx, + subscribe, + take, + toArray, } from 'rxjs'; ``` @@ -28,8 +31,10 @@ The root also exports notifications and public errors, including claiming that a Subject is cold. Importing `rxjs` conditionally initializes the platform Observable surface. It -does not install every Symbol operator. The experimental `map` and `filter` -root exports are ordinary pipeable functions and do not patch operator keys. +does not install every Symbol operator. The experimental `map`, `filter`, +`take`, and `toArray` root exports are ordinary pipeable functions and do not +patch operator keys. The experimental `subscribe` export is a terminal +composition function. ## Pipeable pilot @@ -45,12 +50,34 @@ const result = rx( result.subscribe(console.log); // 20, 40 ``` +Platform `toArray()` returns a Promise. The RxJS function intentionally stays +inside the Observable graph: + +```ts +import { rx, subscribe, toArray } from 'rxjs'; + +const subscription = rx( + [1, 2, 3], + toArray(), + subscribe((values) => console.log(values)) +); + +console.log(subscription.closed); // true after synchronous completion +``` + The ambient platform declarations expose `ObservableInput`; the root exports `UnaryFunction` and `OperatorFunction` as supporting types. Use `OperatorFunction` when an operator preserves its value type. See the [all-pipeable experiment](PIPEABLE_EXPERIMENT.md) for the overload horizon, checking-cost tradeoffs, and unresolved import layout. +The pilot exposes additive deep imports at `rxjs/rx`, `rxjs/to-array`, and +`rxjs/subscribe`. Operators whose ordinary subpaths still name exact Symbols +are also available under `rxjs/pipeable/map`, `rxjs/pipeable/filter`, and +`rxjs/pipeable/take`. Matching additive Symbol aliases exist at +`rxjs/symbol/map`, `rxjs/symbol/filter`, and `rxjs/symbol/take`; the established +Symbol subpaths remain unchanged while the final layout is under review. + ## Symbol operators ```ts @@ -103,8 +130,9 @@ const normalized = Observable[pipe]([1, 2], (values) => values[map](String)); ``` The existing Symbol form does not install `.pipe`. The review-gated root pilot -does publish `rx`, two pipeable operators, and `OperatorFunction`; it does not -yet convert the full catalog. +does publish `rx`, three pipeable source operators, Observable-returning +`toArray`, a lite `subscribe` terminal, and `OperatorFunction`; it does not yet +convert the full catalog. ## Construction and input boundaries @@ -120,11 +148,16 @@ lifecycle assumptions. ## Cancellation and teardown -Subscriptions accept `{ signal: AbortSignal }`. Operators own upstream work +Platform subscriptions accept `{ signal: AbortSignal }`. Operators own upstream work through the downstream Subscriber lifecycle, and cancellation does not become completion. Teardown functions and `subscriber.addTeardown()` participate in the same platform lifecycle. +The optional pipeable `subscribe(observer)` terminal returns a minimal +`Subscription` interface with `unsubscribe()` and a live `closed` getter. It is +backed by one AbortController and does not recreate RxJS 7's Subscription tree, +teardown aggregation, or `add`/`remove` methods. + ## Environment and distribution The package requires Node 22.13+ and publishes ESM only. Node `require()` uses diff --git a/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md b/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md index 70f1558dd4..a61f5cc967 100644 --- a/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md +++ b/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md @@ -3,7 +3,9 @@ This branch evaluates an all-pipeable RxJS 9 surface alongside the existing exact-Symbol surface. It is deliberately small: the first review slice contains `rx`, pipeable `map` and `filter`, the public composition types, and an internal -`operate` helper. The rest of the operator catalog and the Symbol import move +`operate` helper. After the first maintainer review, a second small slice adds +pipeable `take`, Observable-returning `toArray`, and the optional lite +`subscribe` terminal. The rest of the catalog and final Symbol import move remain gated on maintainer review. The experiment does not change the platform foundation. `rx` converts its @@ -63,8 +65,8 @@ result.subscribe(console.log); // 20, 40 This form is concise for methods the platform defines, but it cannot represent the complete RxJS catalog. Platform terminal consumers such as `first`, -`last`, `reduce`, and `toArray` return Promises; the proposed RxJS pipeable -counterparts would be separate Observable-returning contracts. +`last`, `reduce`, and `toArray` return Promises; RxJS pipeable counterparts use +separate Observable-returning contracts. ## Critical comparison @@ -89,6 +91,49 @@ contract selection at native-overlap names, and exact-key collision isolation. Platform methods have the best familiarity but cannot carry the complete RxJS contract. +## Observable-returning terminal form + +The platform `source.toArray()` contract returns a Promise. The RxJS +`toArray()` function intentionally emits one array as an Observable value: + +```ts +import { rx, toArray } from 'rxjs'; + +const result = rx([1, 2, 3], toArray()); +result.subscribe(console.log); // [1, 2, 3] +``` + +This keeps cancellation, sharing, error forwarding, and later Observable +composition inside the same graph. It does not wrap the platform Promise; it +collects source values through `operate` and emits only on completion. + +## Lite subscription terminal + +```ts +import { rx, subscribe } from 'rxjs'; + +const subscription = rx(source, subscribe(console.log)); +subscription.unsubscribe(); +console.log(subscription.closed); // true +``` + +The returned `Subscription` is intentionally only an interface with +`unsubscribe()` and a live `closed` getter over one backing AbortSignal. Normal +completion and source error abort that signal too. This does not restore the +RxJS 7 class, child teardowns, `add`, `remove`, or aggregate unsubscription +errors. + +## Provisional deep imports + +New names without collisions use `rxjs/rx`, `rxjs/to-array`, and +`rxjs/subscribe`. While `rxjs/map`, `rxjs/filter`, and `rxjs/take` retain their +exact Symbols, the pilot functions are available at `rxjs/pipeable/map`, +`rxjs/pipeable/filter`, and `rxjs/pipeable/take`. Additive aliases at +`rxjs/symbol/map`, `rxjs/symbol/filter`, and `rxjs/symbol/take` exercise the +per-operator Symbol direction without moving or removing the established +subpaths. These aliases are evidence for the final layout, not a decision that +the complete catalog must use this exact arrangement. + ## TypeScript limits and checking cost `rx` has explicit overloads for one through nine transformations. At each @@ -161,10 +206,8 @@ The pilot intentionally leaves these decisions open: 2. Whether nine transformations is the right overload horizon and which representative projects should supply type-check performance evidence. 3. Whether `operate` remains internal or becomes an advanced public API. -4. Which first Promise-returning platform consumer should be reimplemented as - an Observable-returning pipeable operator. -5. The exact lite `subscribe` result and whether `closed` is a snapshot or a - live getter over the backing `AbortSignal`. +4. Whether the Observable-returning `toArray` and live AbortSignal-backed lite + `subscribe` contracts should become accepted public APIs after the pilot. The first implementation has now been reviewed. The next slice may add only a small representative set covering an ordinary operator, an diff --git a/packages/rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md b/packages/rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md index 92cf0fd30f..65d891bd60 100644 --- a/packages/rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md +++ b/packages/rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md @@ -24,27 +24,27 @@ Regenerate it with `pnpm --filter rxjs run test:unit:unsupported:generate`; the ## Imports and package paths -| RxJS 7 surface | Disposition | Migration direction | Why | Decisions | -| ------------------------------------------------------------------------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------------- | -| `rxjs/operators`
`root-imported operator functions`
`source.pipe(...)` | Replace | Import exact Symbols from rxjs/ and invoke source[symbol](...). Use rxjs/pipe only for deliberate Symbol composition. | RxJS Next does not publish the RxJS 7 pipeable-function or string-named .pipe surface. | D-003, D-039, D-050 | -| `rxjs:Observable`
`rxjs:Subscriber` | Replace | Use the active realm's ambient Observable and Subscriber after @rxjs/observable-polyfill initialization when needed. | The platform owns these constructors; the rxjs root does not re-export compatibility classes for them. | D-039, D-040, D-041 | -| `rxjs/testing`
`TestScheduler`
`VirtualTimeScheduler`
`VirtualAction` | Replace | Use @rxjs/test rxTest() and its explicit cold(), hot(), observable(), virtual host-time, and assertion helpers. | The public scheduler classes and manual TestScheduler mode are not part of the Next runtime or test contract. | D-012, D-033, D-039 | -| `rxjs/ajax`
`rxjs/fetch`
`rxjs/webSocket`
`ajax`
`fromFetch`
`webSocket`
`WebSocketSubject` | Manual Review | Use platform fetch, XMLHttpRequest, WebSocket, EventTarget.when, or an application adapter selected for the required cancellation and sharing contract. | RxJS Next does not currently publish the RxJS 7 DOM specialty packages or their wrapper types. | D-039, D-040 | -| `rxjs/internal/*`
`rxjs/src/*`
`unexported package paths` | Unsupported | Replace with an accepted public Next subpath or application-owned code after semantic review. | RxJS 7 internals are not preserved as public package contracts and must not be revived to satisfy migration tests. | D-039, D-040 | -| `bindCallback`
`bindNodeCallback`
`scheduled`
`using`
`isObservable` | Manual Review | Wrap callback or resource ownership explicitly with Observable and AbortSignal; use platform conversion or capability-specific mappings where applicable. | No accepted public Next function preserves these RxJS 7 imports and complete overload contracts. | D-039, D-040, D-049 | -| `ObjectUnsubscribedError`
`UnsubscriptionError` | Unsupported | Use platform error and AbortSignal reason handling or an application-owned aggregate error contract. | These errors belong to removed RxJS 7 Subscription and closed-Subject internals. | D-039, D-040 | +| RxJS 7 surface | Disposition | Migration direction | Why | Decisions | +| ------------------------------------------------------------------------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | -------------------------- | +| `rxjs/operators`
`root-imported operator functions`
`source.pipe(...)` | Replace | Use exact Symbols for the complete reviewed catalog. The D-060 pilot also offers root rx composition for its small reviewed operator subset. | RxJS Next does not preserve the complete RxJS 7 pipeable-function catalog or the string-named .pipe surface. | D-003, D-039, D-050, D-060 | +| `rxjs:Observable`
`rxjs:Subscriber` | Replace | Use the active realm's ambient Observable and Subscriber after @rxjs/observable-polyfill initialization when needed. | The platform owns these constructors; the rxjs root does not re-export compatibility classes for them. | D-039, D-040, D-041 | +| `rxjs/testing`
`TestScheduler`
`VirtualTimeScheduler`
`VirtualAction` | Replace | Use @rxjs/test rxTest() and its explicit cold(), hot(), observable(), virtual host-time, and assertion helpers. | The public scheduler classes and manual TestScheduler mode are not part of the Next runtime or test contract. | D-012, D-033, D-039 | +| `rxjs/ajax`
`rxjs/fetch`
`rxjs/webSocket`
`ajax`
`fromFetch`
`webSocket`
`WebSocketSubject` | Manual Review | Use platform fetch, XMLHttpRequest, WebSocket, EventTarget.when, or an application adapter selected for the required cancellation and sharing contract. | RxJS Next does not currently publish the RxJS 7 DOM specialty packages or their wrapper types. | D-039, D-040 | +| `rxjs/internal/*`
`rxjs/src/*`
`unexported package paths` | Unsupported | Replace with an accepted public Next subpath or application-owned code after semantic review. | RxJS 7 internals are not preserved as public package contracts and must not be revived to satisfy migration tests. | D-039, D-040 | +| `bindCallback`
`bindNodeCallback`
`scheduled`
`using`
`isObservable` | Manual Review | Wrap callback or resource ownership explicitly with Observable and AbortSignal; use platform conversion or capability-specific mappings where applicable. | No accepted public Next function preserves these RxJS 7 imports and complete overload contracts. | D-039, D-040, D-049 | +| `ObjectUnsubscribedError`
`UnsubscriptionError` | Unsupported | Use platform error and AbortSignal reason handling or an application-owned aggregate error contract. | These errors belong to removed RxJS 7 Subscription and closed-Subject internals. | D-039, D-040 | ## Types -| RxJS 7 surface | Disposition | Migration direction | Why | Decisions | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------- | -| `MonoTypeOperatorFunction` | Replace | Use the root OperatorFunction type for an operator that preserves its value type. | RxJS Next publishes direct UnaryFunction and OperatorFunction aliases without the redundant mono-type alias. | D-060 | -| `Subscription`
`SubscriptionLike`
`Unsubscribable`
`TeardownLogic` | Replace | Use AbortController, AbortSignal, SubscribeOptions, and Subscriber.addTeardown inside producers. | subscribe() returns undefined and cancellation is signal-owned; no Subscription facade is published. | D-039, D-041, D-049 | -| `ObservableInput`
`ObservableLike`
`InteropObservable`
`Subscribable`
`SubscribableOrPromise`
`ReadableStreamLike` | Replace | Use the ambient ObservableInput/platform Observable.from input contract and review custom inputs manually. | The platform conversion boundary deliberately excludes arbitrary subscribables and legacy observable interop. | D-039, D-049 | -| `NextObserver`
`ErrorObserver`
`CompletionObserver`
`PartialObserver`
`SubjectLike`
`Connectable` | Replace | Use ambient Observer/Subscriber shapes or the concrete intentional Subject/connectable APIs; define application protocols locally when needed. | These RxJS 7 helper interfaces are not a public Next import family. | D-035, D-039, D-040 | -| `SchedulerLike`
`SchedulerAction`
`TimestampProvider` | Replace | Use host timing APIs, Date.now-compatible narrow providers where explicitly documented, and @rxjs/test virtual host time. | There is no general public scheduler abstraction in RxJS Next. | D-012, D-033, D-039 | -| `FactoryOrValue`
`ObservedValueOf`
`ObservedValueUnionFromArray`
`ObservedValuesFromArray`
`ObservedValueTupleFromArray`
`ObservableInputTuple`
`Cons`
`Head`
`Tail`
`ValueFromArray`
`Falsy`
`TruthyTypesOf` | Unsupported | Use inference from the accepted Next API or application-owned utility types; do not deep-import RxJS internals. | These RxJS 7 implementation-facing inference helpers are not stable Next public types. | D-039, D-040 | -| `GroupedObservable`
`Timestamp`
`TimeInterval` | Replace | Use the structural keyed group view, structural timestamp result, or TimeInterval exported by the exact rxjs/time-interval capability as applicable. | The RxJS 7 root type imports are not preserved even where a capability exposes an intentional structural or subpath-specific result. | D-003, D-039, D-040 | +| RxJS 7 surface | Disposition | Migration direction | Why | Decisions | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | +| `MonoTypeOperatorFunction` | Replace | Use the root OperatorFunction type for an operator that preserves its value type. | RxJS Next publishes direct UnaryFunction and OperatorFunction aliases without the redundant mono-type alias. | D-060 | +| `Subscription`
`SubscriptionLike`
`Unsubscribable`
`TeardownLogic` | Replace | Use AbortController, AbortSignal, SubscribeOptions, and Subscriber.addTeardown inside producers. The D-060 pilot's subscribe terminal offers only unsubscribe() and live closed. | Platform subscribe() returns undefined and cancellation is signal-owned; the pilot handle does not restore Subscription trees, add/remove, or teardown aggregation. | D-039, D-041, D-049, D-060 | +| `ObservableInput`
`ObservableLike`
`InteropObservable`
`Subscribable`
`SubscribableOrPromise`
`ReadableStreamLike` | Replace | Use the ambient ObservableInput/platform Observable.from input contract and review custom inputs manually. | The platform conversion boundary deliberately excludes arbitrary subscribables and legacy observable interop. | D-039, D-049 | +| `NextObserver`
`ErrorObserver`
`CompletionObserver`
`PartialObserver`
`SubjectLike`
`Connectable` | Replace | Use ambient Observer/Subscriber shapes or the concrete intentional Subject/connectable APIs; define application protocols locally when needed. | These RxJS 7 helper interfaces are not a public Next import family. | D-035, D-039, D-040 | +| `SchedulerLike`
`SchedulerAction`
`TimestampProvider` | Replace | Use host timing APIs, Date.now-compatible narrow providers where explicitly documented, and @rxjs/test virtual host time. | There is no general public scheduler abstraction in RxJS Next. | D-012, D-033, D-039 | +| `FactoryOrValue`
`ObservedValueOf`
`ObservedValueUnionFromArray`
`ObservedValuesFromArray`
`ObservedValueTupleFromArray`
`ObservableInputTuple`
`Cons`
`Head`
`Tail`
`ValueFromArray`
`Falsy`
`TruthyTypesOf` | Unsupported | Use inference from the accepted Next API or application-owned utility types; do not deep-import RxJS internals. | These RxJS 7 implementation-facing inference helpers are not stable Next public types. | D-039, D-040 | +| `GroupedObservable`
`Timestamp`
`TimeInterval` | Replace | Use the structural keyed group view, structural timestamp result, or TimeInterval exported by the exact rxjs/time-interval capability as applicable. | The RxJS 7 root type imports are not preserved even where a capability exposes an intentional structural or subpath-specific result. | D-003, D-039, D-040 | ## Schedulers and scheduler overloads diff --git a/packages/rxjs/test/ported/unsupported-surface-catalog.json b/packages/rxjs/test/ported/unsupported-surface-catalog.json index 37b897c635..d5665b12d5 100644 --- a/packages/rxjs/test/ported/unsupported-surface-catalog.json +++ b/packages/rxjs/test/ported/unsupported-surface-catalog.json @@ -10,9 +10,9 @@ "id": "imports:pipeable-functions", "surfaces": ["rxjs/operators", "root-imported operator functions", "source.pipe(...)"], "disposition": "replace", - "replacement": "Import exact Symbols from rxjs/ and invoke source[symbol](...). Use rxjs/pipe only for deliberate Symbol composition.", - "rationale": "RxJS Next does not publish the RxJS 7 pipeable-function or string-named .pipe surface.", - "decisions": ["D-003", "D-039", "D-050"] + "replacement": "Use exact Symbols for the complete reviewed catalog. The D-060 pilot also offers root rx composition for its small reviewed operator subset.", + "rationale": "RxJS Next does not preserve the complete RxJS 7 pipeable-function catalog or the string-named .pipe surface.", + "decisions": ["D-003", "D-039", "D-050", "D-060"] }, { "id": "imports:platform-constructors", @@ -76,9 +76,9 @@ "id": "types:subscription", "surfaces": ["Subscription", "SubscriptionLike", "Unsubscribable", "TeardownLogic"], "disposition": "replace", - "replacement": "Use AbortController, AbortSignal, SubscribeOptions, and Subscriber.addTeardown inside producers.", - "rationale": "subscribe() returns undefined and cancellation is signal-owned; no Subscription facade is published.", - "decisions": ["D-039", "D-041", "D-049"] + "replacement": "Use AbortController, AbortSignal, SubscribeOptions, and Subscriber.addTeardown inside producers. The D-060 pilot's subscribe terminal offers only unsubscribe() and live closed.", + "rationale": "Platform subscribe() returns undefined and cancellation is signal-owned; the pilot handle does not restore Subscription trees, add/remove, or teardown aggregation.", + "decisions": ["D-039", "D-041", "D-049", "D-060"] }, { "id": "types:conversion", From 027f282cd53a0ff258b02cc733c13d7a133f1329 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Fri, 7 Aug 2026 10:18:09 -0500 Subject: [PATCH 7/7] feat(rxjs): add complete pipeable catalog --- docs/rxjs-next/ARCHITECTURE.md | 74 +- docs/rxjs-next/COMPATIBILITY.md | 23 +- docs/rxjs-next/DECISIONS.md | 38 +- docs/rxjs-next/OPEN_QUESTIONS.md | 35 +- docs/rxjs-next/PROJECT_PLAN.md | 81 +- packages/rxjs/MIGRATION.md | 33 +- packages/rxjs/README.md | 22 +- packages/rxjs/docs/API.md | 63 +- packages/rxjs/docs/PIPEABLE_EXPERIMENT.md | 171 +- .../rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md | 36 +- packages/rxjs/package.json | 4607 +++++++++++++++-- packages/rxjs/src/animation-frames.ts | 15 + packages/rxjs/src/buffer-time.ts | 17 + packages/rxjs/src/buffer-toggle.ts | 17 + packages/rxjs/src/buffer.ts | 25 + packages/rxjs/src/catch-error.ts | 17 + packages/rxjs/src/combine-latest-all.ts | 18 + packages/rxjs/src/combine-latest.ts | 32 + packages/rxjs/src/combine.ts | 28 + packages/rxjs/src/concat.ts | 28 + packages/rxjs/src/connect.ts | 17 + packages/rxjs/src/count.ts | 17 + packages/rxjs/src/debounce.ts | 17 + packages/rxjs/src/default-if-empty.ts | 17 + packages/rxjs/src/delay-when.ts | 17 + packages/rxjs/src/delay.ts | 17 + packages/rxjs/src/dematerialize.ts | 17 + packages/rxjs/src/distinct-until-changed.ts | 18 + .../rxjs/src/distinct-until-key-changed.ts | 17 + packages/rxjs/src/distinct.ts | 17 + packages/rxjs/src/element-at.ts | 17 + packages/rxjs/src/every.ts | 18 + packages/rxjs/src/exhaust-map.ts | 19 + packages/rxjs/src/expand.ts | 17 + packages/rxjs/src/finalize.ts | 17 + packages/rxjs/src/find-index.ts | 17 + packages/rxjs/src/find.ts | 18 + packages/rxjs/src/first.ts | 22 + packages/rxjs/src/fork-join.ts | 24 + packages/rxjs/src/generate.ts | 18 + packages/rxjs/src/group-by.ts | 26 + packages/rxjs/src/index.ts | 117 + packages/rxjs/src/interval.ts | 15 + packages/rxjs/src/is-empty.ts | 17 + packages/rxjs/src/iterate-buffered-values.ts | 17 + packages/rxjs/src/iterate-each-value.ts | 17 + packages/rxjs/src/iterate-latest-value.ts | 17 + packages/rxjs/src/iterate-next-value.ts | 17 + packages/rxjs/src/last.ts | 21 + packages/rxjs/src/materialize.ts | 17 + packages/rxjs/src/max.ts | 17 + packages/rxjs/src/merge-map.ts | 17 + packages/rxjs/src/merge-scan.ts | 17 + packages/rxjs/src/merge.ts | 28 + packages/rxjs/src/min.ts | 17 + packages/rxjs/src/multicast.ts | 17 + packages/rxjs/src/observe-on.ts | 17 + packages/rxjs/src/on-error-resume-next.ts | 28 + packages/rxjs/src/pairwise.ts | 17 + packages/rxjs/src/partition.ts | 19 + packages/rxjs/src/pipe.ts | 23 + packages/rxjs/src/pipeable/buffer-time.ts | 1 + packages/rxjs/src/pipeable/buffer-toggle.ts | 1 + packages/rxjs/src/pipeable/buffer.ts | 1 + packages/rxjs/src/pipeable/catalog.json | 209 + packages/rxjs/src/pipeable/catalog.spec.ts | 72 + packages/rxjs/src/pipeable/catch-error.ts | 1 + .../rxjs/src/pipeable/combine-latest-all.ts | 1 + .../rxjs/src/pipeable/combine-latest-with.ts | 1 + packages/rxjs/src/pipeable/combine-with.ts | 1 + packages/rxjs/src/pipeable/concat-with.ts | 1 + packages/rxjs/src/pipeable/connect.ts | 2 + packages/rxjs/src/pipeable/count.ts | 1 + packages/rxjs/src/pipeable/debounce.ts | 1 + .../rxjs/src/pipeable/default-if-empty.ts | 1 + packages/rxjs/src/pipeable/delay-when.ts | 1 + packages/rxjs/src/pipeable/delay.ts | 1 + packages/rxjs/src/pipeable/dematerialize.ts | 1 + .../src/pipeable/distinct-until-changed.ts | 1 + .../pipeable/distinct-until-key-changed.ts | 1 + packages/rxjs/src/pipeable/distinct.ts | 1 + packages/rxjs/src/pipeable/element-at.ts | 1 + packages/rxjs/src/pipeable/every.ts | 1 + packages/rxjs/src/pipeable/exhaust-map.ts | 1 + packages/rxjs/src/pipeable/expand.ts | 2 + packages/rxjs/src/pipeable/finalize.ts | 1 + packages/rxjs/src/pipeable/find-index.ts | 1 + packages/rxjs/src/pipeable/find.ts | 1 + packages/rxjs/src/pipeable/first.ts | 1 + packages/rxjs/src/pipeable/group-by.ts | 2 + packages/rxjs/src/pipeable/index.ts | 94 + packages/rxjs/src/pipeable/is-empty.ts | 1 + .../src/pipeable/iterate-buffered-values.ts | 1 + .../rxjs/src/pipeable/iterate-each-value.ts | 1 + .../rxjs/src/pipeable/iterate-latest-value.ts | 1 + .../rxjs/src/pipeable/iterate-next-value.ts | 1 + packages/rxjs/src/pipeable/last.ts | 1 + packages/rxjs/src/pipeable/materialize.ts | 1 + packages/rxjs/src/pipeable/max.ts | 1 + packages/rxjs/src/pipeable/merge-map.ts | 1 + packages/rxjs/src/pipeable/merge-scan.ts | 1 + packages/rxjs/src/pipeable/merge-with.ts | 1 + packages/rxjs/src/pipeable/min.ts | 1 + packages/rxjs/src/pipeable/multicast.ts | 1 + packages/rxjs/src/pipeable/observe-on.ts | 1 + .../src/pipeable/on-error-resume-next-with.ts | 1 + packages/rxjs/src/pipeable/pairwise.ts | 1 + packages/rxjs/src/pipeable/pipe.ts | 1 + packages/rxjs/src/pipeable/pluck.ts | 1 + .../rxjs/src/pipeable/publish-behavior.ts | 1 + packages/rxjs/src/pipeable/publish-last.ts | 1 + packages/rxjs/src/pipeable/publish-replay.ts | 2 + packages/rxjs/src/pipeable/publish.ts | 1 + packages/rxjs/src/pipeable/race-with.ts | 1 + packages/rxjs/src/pipeable/reduce.ts | 1 + packages/rxjs/src/pipeable/ref-count.ts | 1 + packages/rxjs/src/pipeable/repeat-when.ts | 1 + packages/rxjs/src/pipeable/repeat.ts | 1 + packages/rxjs/src/pipeable/retry-when.ts | 1 + packages/rxjs/src/pipeable/retry.ts | 1 + packages/rxjs/src/pipeable/sample-time.ts | 1 + packages/rxjs/src/pipeable/sample.ts | 1 + packages/rxjs/src/pipeable/scan.ts | 1 + packages/rxjs/src/pipeable/sequence-equal.ts | 1 + packages/rxjs/src/pipeable/share-replay.ts | 2 + packages/rxjs/src/pipeable/share.ts | 2 + packages/rxjs/src/pipeable/single.ts | 1 + packages/rxjs/src/pipeable/skip-last.ts | 1 + packages/rxjs/src/pipeable/skip-until.ts | 1 + packages/rxjs/src/pipeable/skip-while.ts | 1 + packages/rxjs/src/pipeable/skip.ts | 1 + packages/rxjs/src/pipeable/start-with.ts | 1 + packages/rxjs/src/pipeable/subscribe-on.ts | 1 + packages/rxjs/src/pipeable/switch-map.ts | 1 + packages/rxjs/src/pipeable/switch-scan.ts | 1 + packages/rxjs/src/pipeable/take-last.ts | 1 + packages/rxjs/src/pipeable/take-until.ts | 1 + packages/rxjs/src/pipeable/take-while.ts | 1 + packages/rxjs/src/pipeable/tap.ts | 2 + packages/rxjs/src/pipeable/throttle.ts | 1 + packages/rxjs/src/pipeable/throw-if-empty.ts | 1 + packages/rxjs/src/pipeable/time-interval.ts | 2 + packages/rxjs/src/pipeable/timeout.ts | 1 + packages/rxjs/src/pipeable/timestamp.ts | 2 + packages/rxjs/src/pipeable/window-count.ts | 1 + packages/rxjs/src/pipeable/window-time.ts | 1 + packages/rxjs/src/pipeable/window-toggle.ts | 1 + packages/rxjs/src/pipeable/window-when.ts | 1 + packages/rxjs/src/pipeable/window.ts | 1 + .../rxjs/src/pipeable/with-latest-from.ts | 1 + packages/rxjs/src/pipeable/zip-all.ts | 1 + packages/rxjs/src/pipeable/zip-with.ts | 1 + packages/rxjs/src/pluck.ts | 25 + packages/rxjs/src/publish-behavior.ts | 17 + packages/rxjs/src/publish-last.ts | 17 + packages/rxjs/src/publish-replay.ts | 17 + packages/rxjs/src/publish.ts | 17 + packages/rxjs/src/race.ts | 28 + packages/rxjs/src/reduce.ts | 19 + packages/rxjs/src/ref-count.ts | 17 + packages/rxjs/src/repeat-when.ts | 17 + packages/rxjs/src/repeat.ts | 17 + packages/rxjs/src/retry-when.ts | 17 + packages/rxjs/src/retry.ts | 21 + packages/rxjs/src/sample-time.ts | 17 + packages/rxjs/src/sample.ts | 17 + packages/rxjs/src/scan.ts | 17 + packages/rxjs/src/sequence-equal.ts | 17 + packages/rxjs/src/share-replay.ts | 17 + packages/rxjs/src/share.ts | 17 + packages/rxjs/src/single.ts | 18 + packages/rxjs/src/skip-last.ts | 17 + packages/rxjs/src/skip-until.ts | 17 + packages/rxjs/src/skip-while.ts | 18 + packages/rxjs/src/skip.ts | 17 + packages/rxjs/src/start-with.ts | 17 + packages/rxjs/src/static/animation-frames.ts | 2 + packages/rxjs/src/static/combine-latest.ts | 1 + packages/rxjs/src/static/combine.ts | 1 + packages/rxjs/src/static/concat.ts | 1 + packages/rxjs/src/static/fork-join.ts | 1 + packages/rxjs/src/static/generate.ts | 2 + packages/rxjs/src/static/index.ts | 12 + packages/rxjs/src/static/interval.ts | 1 + packages/rxjs/src/static/merge.ts | 1 + .../rxjs/src/static/on-error-resume-next.ts | 1 + packages/rxjs/src/static/partition.ts | 1 + packages/rxjs/src/static/race.ts | 1 + packages/rxjs/src/static/timer.ts | 1 + packages/rxjs/src/subscribe-on.ts | 17 + packages/rxjs/src/switch-map.ts | 17 + packages/rxjs/src/switch-scan.ts | 17 + packages/rxjs/src/symbol/animation-frames.ts | 2 + packages/rxjs/src/symbol/buffer-time.ts | 1 + packages/rxjs/src/symbol/buffer-toggle.ts | 1 + packages/rxjs/src/symbol/buffer.ts | 1 + packages/rxjs/src/symbol/catch-error.ts | 1 + .../rxjs/src/symbol/combine-latest-all.ts | 1 + packages/rxjs/src/symbol/combine-latest.ts | 1 + packages/rxjs/src/symbol/combine.ts | 1 + packages/rxjs/src/symbol/concat.ts | 1 + packages/rxjs/src/symbol/connect.ts | 2 + packages/rxjs/src/symbol/count.ts | 1 + packages/rxjs/src/symbol/create.ts | 1 + packages/rxjs/src/symbol/debounce.ts | 1 + packages/rxjs/src/symbol/default-if-empty.ts | 1 + packages/rxjs/src/symbol/delay-when.ts | 1 + packages/rxjs/src/symbol/delay.ts | 1 + packages/rxjs/src/symbol/dematerialize.ts | 1 + .../rxjs/src/symbol/distinct-until-changed.ts | 1 + .../src/symbol/distinct-until-key-changed.ts | 1 + packages/rxjs/src/symbol/distinct.ts | 1 + packages/rxjs/src/symbol/element-at.ts | 1 + packages/rxjs/src/symbol/every.ts | 1 + packages/rxjs/src/symbol/exhaust-map.ts | 1 + packages/rxjs/src/symbol/expand.ts | 2 + packages/rxjs/src/symbol/filter.ts | 1 + packages/rxjs/src/symbol/finalize.ts | 1 + packages/rxjs/src/symbol/find-index.ts | 1 + packages/rxjs/src/symbol/find.ts | 1 + packages/rxjs/src/symbol/first.ts | 1 + packages/rxjs/src/symbol/fork-join.ts | 1 + packages/rxjs/src/symbol/generate.ts | 2 + packages/rxjs/src/symbol/group-by.ts | 2 + packages/rxjs/src/symbol/index.ts | 98 + packages/rxjs/src/symbol/interval.ts | 1 + packages/rxjs/src/symbol/is-empty.ts | 1 + .../src/symbol/iterate-buffered-values.ts | 1 + .../rxjs/src/symbol/iterate-each-value.ts | 1 + .../rxjs/src/symbol/iterate-latest-value.ts | 1 + .../rxjs/src/symbol/iterate-next-value.ts | 1 + packages/rxjs/src/symbol/last.ts | 1 + packages/rxjs/src/symbol/map.ts | 1 + packages/rxjs/src/symbol/materialize.ts | 1 + packages/rxjs/src/symbol/max.ts | 1 + packages/rxjs/src/symbol/merge-map.ts | 1 + packages/rxjs/src/symbol/merge-scan.ts | 1 + packages/rxjs/src/symbol/merge.ts | 1 + packages/rxjs/src/symbol/min.ts | 1 + packages/rxjs/src/symbol/multicast.ts | 1 + packages/rxjs/src/symbol/observe-on.ts | 1 + .../rxjs/src/symbol/on-error-resume-next.ts | 1 + packages/rxjs/src/symbol/pairwise.ts | 1 + packages/rxjs/src/symbol/partition.ts | 1 + packages/rxjs/src/symbol/pipe.ts | 1 + packages/rxjs/src/symbol/pluck.ts | 1 + packages/rxjs/src/symbol/publish-behavior.ts | 1 + packages/rxjs/src/symbol/publish-last.ts | 1 + packages/rxjs/src/symbol/publish-replay.ts | 2 + packages/rxjs/src/symbol/publish.ts | 1 + packages/rxjs/src/symbol/race.ts | 1 + packages/rxjs/src/symbol/reduce.ts | 1 + packages/rxjs/src/symbol/ref-count.ts | 1 + packages/rxjs/src/symbol/repeat-when.ts | 1 + packages/rxjs/src/symbol/repeat.ts | 1 + packages/rxjs/src/symbol/retry-when.ts | 1 + packages/rxjs/src/symbol/retry.ts | 1 + packages/rxjs/src/symbol/sample-time.ts | 1 + packages/rxjs/src/symbol/sample.ts | 1 + packages/rxjs/src/symbol/scan.ts | 1 + packages/rxjs/src/symbol/sequence-equal.ts | 1 + packages/rxjs/src/symbol/share-replay.ts | 2 + packages/rxjs/src/symbol/share.ts | 2 + packages/rxjs/src/symbol/single.ts | 1 + packages/rxjs/src/symbol/skip-last.ts | 1 + packages/rxjs/src/symbol/skip-until.ts | 1 + packages/rxjs/src/symbol/skip-while.ts | 1 + packages/rxjs/src/symbol/skip.ts | 1 + packages/rxjs/src/symbol/start-with.ts | 1 + packages/rxjs/src/symbol/subscribe-on.ts | 1 + packages/rxjs/src/symbol/switch-map.ts | 1 + packages/rxjs/src/symbol/switch-scan.ts | 1 + packages/rxjs/src/symbol/take-last.ts | 1 + packages/rxjs/src/symbol/take-until.ts | 1 + packages/rxjs/src/symbol/take-while.ts | 1 + packages/rxjs/src/symbol/take.ts | 1 + packages/rxjs/src/symbol/tap.ts | 2 + packages/rxjs/src/symbol/throttle.ts | 1 + packages/rxjs/src/symbol/throw-if-empty.ts | 1 + packages/rxjs/src/symbol/time-interval.ts | 2 + packages/rxjs/src/symbol/timeout.ts | 1 + packages/rxjs/src/symbol/timer.ts | 1 + packages/rxjs/src/symbol/timestamp.ts | 2 + packages/rxjs/src/symbol/window-count.ts | 1 + packages/rxjs/src/symbol/window-time.ts | 1 + packages/rxjs/src/symbol/window-toggle.ts | 1 + packages/rxjs/src/symbol/window-when.ts | 1 + packages/rxjs/src/symbol/window.ts | 1 + packages/rxjs/src/symbol/with-latest-from.ts | 1 + packages/rxjs/src/symbol/zip-all.ts | 1 + packages/rxjs/src/symbol/zip-with.ts | 1 + packages/rxjs/src/take-last.ts | 17 + packages/rxjs/src/take-until.ts | 17 + packages/rxjs/src/take-while.ts | 18 + packages/rxjs/src/tap.ts | 18 + packages/rxjs/src/throttle.ts | 17 + packages/rxjs/src/throw-if-empty.ts | 17 + packages/rxjs/src/time-interval.ts | 17 + packages/rxjs/src/timeout.ts | 22 + packages/rxjs/src/timer.ts | 16 + packages/rxjs/src/timestamp.ts | 17 + packages/rxjs/src/window-count.ts | 17 + packages/rxjs/src/window-time.ts | 17 + packages/rxjs/src/window-toggle.ts | 17 + packages/rxjs/src/window-when.ts | 17 + packages/rxjs/src/window.ts | 17 + packages/rxjs/src/with-latest-from.ts | 18 + packages/rxjs/src/zip-all.ts | 19 + packages/rxjs/src/zip-with.ts | 17 + packages/rxjs/test/import/bundler.mjs | 6 +- packages/rxjs/test/import/esm.mjs | 28 +- .../rxjs/test/import/fixture-scenario.mjs | 19 +- packages/rxjs/test/import/fixtures.mjs | 2 +- .../ported/unsupported-surface-catalog.json | 14 +- packages/rxjs/test/types/pipeable-api.ts | 81 +- scripts/generate-pipeable-surface.mjs | 495 ++ 316 files changed, 7808 insertions(+), 579 deletions(-) create mode 100644 packages/rxjs/src/pipeable/buffer-time.ts create mode 100644 packages/rxjs/src/pipeable/buffer-toggle.ts create mode 100644 packages/rxjs/src/pipeable/buffer.ts create mode 100644 packages/rxjs/src/pipeable/catalog.json create mode 100644 packages/rxjs/src/pipeable/catalog.spec.ts create mode 100644 packages/rxjs/src/pipeable/catch-error.ts create mode 100644 packages/rxjs/src/pipeable/combine-latest-all.ts create mode 100644 packages/rxjs/src/pipeable/combine-latest-with.ts create mode 100644 packages/rxjs/src/pipeable/combine-with.ts create mode 100644 packages/rxjs/src/pipeable/concat-with.ts create mode 100644 packages/rxjs/src/pipeable/connect.ts create mode 100644 packages/rxjs/src/pipeable/count.ts create mode 100644 packages/rxjs/src/pipeable/debounce.ts create mode 100644 packages/rxjs/src/pipeable/default-if-empty.ts create mode 100644 packages/rxjs/src/pipeable/delay-when.ts create mode 100644 packages/rxjs/src/pipeable/delay.ts create mode 100644 packages/rxjs/src/pipeable/dematerialize.ts create mode 100644 packages/rxjs/src/pipeable/distinct-until-changed.ts create mode 100644 packages/rxjs/src/pipeable/distinct-until-key-changed.ts create mode 100644 packages/rxjs/src/pipeable/distinct.ts create mode 100644 packages/rxjs/src/pipeable/element-at.ts create mode 100644 packages/rxjs/src/pipeable/every.ts create mode 100644 packages/rxjs/src/pipeable/exhaust-map.ts create mode 100644 packages/rxjs/src/pipeable/expand.ts create mode 100644 packages/rxjs/src/pipeable/finalize.ts create mode 100644 packages/rxjs/src/pipeable/find-index.ts create mode 100644 packages/rxjs/src/pipeable/find.ts create mode 100644 packages/rxjs/src/pipeable/first.ts create mode 100644 packages/rxjs/src/pipeable/group-by.ts create mode 100644 packages/rxjs/src/pipeable/index.ts create mode 100644 packages/rxjs/src/pipeable/is-empty.ts create mode 100644 packages/rxjs/src/pipeable/iterate-buffered-values.ts create mode 100644 packages/rxjs/src/pipeable/iterate-each-value.ts create mode 100644 packages/rxjs/src/pipeable/iterate-latest-value.ts create mode 100644 packages/rxjs/src/pipeable/iterate-next-value.ts create mode 100644 packages/rxjs/src/pipeable/last.ts create mode 100644 packages/rxjs/src/pipeable/materialize.ts create mode 100644 packages/rxjs/src/pipeable/max.ts create mode 100644 packages/rxjs/src/pipeable/merge-map.ts create mode 100644 packages/rxjs/src/pipeable/merge-scan.ts create mode 100644 packages/rxjs/src/pipeable/merge-with.ts create mode 100644 packages/rxjs/src/pipeable/min.ts create mode 100644 packages/rxjs/src/pipeable/multicast.ts create mode 100644 packages/rxjs/src/pipeable/observe-on.ts create mode 100644 packages/rxjs/src/pipeable/on-error-resume-next-with.ts create mode 100644 packages/rxjs/src/pipeable/pairwise.ts create mode 100644 packages/rxjs/src/pipeable/pipe.ts create mode 100644 packages/rxjs/src/pipeable/pluck.ts create mode 100644 packages/rxjs/src/pipeable/publish-behavior.ts create mode 100644 packages/rxjs/src/pipeable/publish-last.ts create mode 100644 packages/rxjs/src/pipeable/publish-replay.ts create mode 100644 packages/rxjs/src/pipeable/publish.ts create mode 100644 packages/rxjs/src/pipeable/race-with.ts create mode 100644 packages/rxjs/src/pipeable/reduce.ts create mode 100644 packages/rxjs/src/pipeable/ref-count.ts create mode 100644 packages/rxjs/src/pipeable/repeat-when.ts create mode 100644 packages/rxjs/src/pipeable/repeat.ts create mode 100644 packages/rxjs/src/pipeable/retry-when.ts create mode 100644 packages/rxjs/src/pipeable/retry.ts create mode 100644 packages/rxjs/src/pipeable/sample-time.ts create mode 100644 packages/rxjs/src/pipeable/sample.ts create mode 100644 packages/rxjs/src/pipeable/scan.ts create mode 100644 packages/rxjs/src/pipeable/sequence-equal.ts create mode 100644 packages/rxjs/src/pipeable/share-replay.ts create mode 100644 packages/rxjs/src/pipeable/share.ts create mode 100644 packages/rxjs/src/pipeable/single.ts create mode 100644 packages/rxjs/src/pipeable/skip-last.ts create mode 100644 packages/rxjs/src/pipeable/skip-until.ts create mode 100644 packages/rxjs/src/pipeable/skip-while.ts create mode 100644 packages/rxjs/src/pipeable/skip.ts create mode 100644 packages/rxjs/src/pipeable/start-with.ts create mode 100644 packages/rxjs/src/pipeable/subscribe-on.ts create mode 100644 packages/rxjs/src/pipeable/switch-map.ts create mode 100644 packages/rxjs/src/pipeable/switch-scan.ts create mode 100644 packages/rxjs/src/pipeable/take-last.ts create mode 100644 packages/rxjs/src/pipeable/take-until.ts create mode 100644 packages/rxjs/src/pipeable/take-while.ts create mode 100644 packages/rxjs/src/pipeable/tap.ts create mode 100644 packages/rxjs/src/pipeable/throttle.ts create mode 100644 packages/rxjs/src/pipeable/throw-if-empty.ts create mode 100644 packages/rxjs/src/pipeable/time-interval.ts create mode 100644 packages/rxjs/src/pipeable/timeout.ts create mode 100644 packages/rxjs/src/pipeable/timestamp.ts create mode 100644 packages/rxjs/src/pipeable/window-count.ts create mode 100644 packages/rxjs/src/pipeable/window-time.ts create mode 100644 packages/rxjs/src/pipeable/window-toggle.ts create mode 100644 packages/rxjs/src/pipeable/window-when.ts create mode 100644 packages/rxjs/src/pipeable/window.ts create mode 100644 packages/rxjs/src/pipeable/with-latest-from.ts create mode 100644 packages/rxjs/src/pipeable/zip-all.ts create mode 100644 packages/rxjs/src/pipeable/zip-with.ts create mode 100644 packages/rxjs/src/static/animation-frames.ts create mode 100644 packages/rxjs/src/static/combine-latest.ts create mode 100644 packages/rxjs/src/static/combine.ts create mode 100644 packages/rxjs/src/static/concat.ts create mode 100644 packages/rxjs/src/static/fork-join.ts create mode 100644 packages/rxjs/src/static/generate.ts create mode 100644 packages/rxjs/src/static/index.ts create mode 100644 packages/rxjs/src/static/interval.ts create mode 100644 packages/rxjs/src/static/merge.ts create mode 100644 packages/rxjs/src/static/on-error-resume-next.ts create mode 100644 packages/rxjs/src/static/partition.ts create mode 100644 packages/rxjs/src/static/race.ts create mode 100644 packages/rxjs/src/static/timer.ts create mode 100644 packages/rxjs/src/symbol/animation-frames.ts create mode 100644 packages/rxjs/src/symbol/buffer-time.ts create mode 100644 packages/rxjs/src/symbol/buffer-toggle.ts create mode 100644 packages/rxjs/src/symbol/buffer.ts create mode 100644 packages/rxjs/src/symbol/catch-error.ts create mode 100644 packages/rxjs/src/symbol/combine-latest-all.ts create mode 100644 packages/rxjs/src/symbol/combine-latest.ts create mode 100644 packages/rxjs/src/symbol/combine.ts create mode 100644 packages/rxjs/src/symbol/concat.ts create mode 100644 packages/rxjs/src/symbol/connect.ts create mode 100644 packages/rxjs/src/symbol/count.ts create mode 100644 packages/rxjs/src/symbol/create.ts create mode 100644 packages/rxjs/src/symbol/debounce.ts create mode 100644 packages/rxjs/src/symbol/default-if-empty.ts create mode 100644 packages/rxjs/src/symbol/delay-when.ts create mode 100644 packages/rxjs/src/symbol/delay.ts create mode 100644 packages/rxjs/src/symbol/dematerialize.ts create mode 100644 packages/rxjs/src/symbol/distinct-until-changed.ts create mode 100644 packages/rxjs/src/symbol/distinct-until-key-changed.ts create mode 100644 packages/rxjs/src/symbol/distinct.ts create mode 100644 packages/rxjs/src/symbol/element-at.ts create mode 100644 packages/rxjs/src/symbol/every.ts create mode 100644 packages/rxjs/src/symbol/exhaust-map.ts create mode 100644 packages/rxjs/src/symbol/expand.ts create mode 100644 packages/rxjs/src/symbol/filter.ts create mode 100644 packages/rxjs/src/symbol/finalize.ts create mode 100644 packages/rxjs/src/symbol/find-index.ts create mode 100644 packages/rxjs/src/symbol/find.ts create mode 100644 packages/rxjs/src/symbol/first.ts create mode 100644 packages/rxjs/src/symbol/fork-join.ts create mode 100644 packages/rxjs/src/symbol/generate.ts create mode 100644 packages/rxjs/src/symbol/group-by.ts create mode 100644 packages/rxjs/src/symbol/index.ts create mode 100644 packages/rxjs/src/symbol/interval.ts create mode 100644 packages/rxjs/src/symbol/is-empty.ts create mode 100644 packages/rxjs/src/symbol/iterate-buffered-values.ts create mode 100644 packages/rxjs/src/symbol/iterate-each-value.ts create mode 100644 packages/rxjs/src/symbol/iterate-latest-value.ts create mode 100644 packages/rxjs/src/symbol/iterate-next-value.ts create mode 100644 packages/rxjs/src/symbol/last.ts create mode 100644 packages/rxjs/src/symbol/map.ts create mode 100644 packages/rxjs/src/symbol/materialize.ts create mode 100644 packages/rxjs/src/symbol/max.ts create mode 100644 packages/rxjs/src/symbol/merge-map.ts create mode 100644 packages/rxjs/src/symbol/merge-scan.ts create mode 100644 packages/rxjs/src/symbol/merge.ts create mode 100644 packages/rxjs/src/symbol/min.ts create mode 100644 packages/rxjs/src/symbol/multicast.ts create mode 100644 packages/rxjs/src/symbol/observe-on.ts create mode 100644 packages/rxjs/src/symbol/on-error-resume-next.ts create mode 100644 packages/rxjs/src/symbol/pairwise.ts create mode 100644 packages/rxjs/src/symbol/partition.ts create mode 100644 packages/rxjs/src/symbol/pipe.ts create mode 100644 packages/rxjs/src/symbol/pluck.ts create mode 100644 packages/rxjs/src/symbol/publish-behavior.ts create mode 100644 packages/rxjs/src/symbol/publish-last.ts create mode 100644 packages/rxjs/src/symbol/publish-replay.ts create mode 100644 packages/rxjs/src/symbol/publish.ts create mode 100644 packages/rxjs/src/symbol/race.ts create mode 100644 packages/rxjs/src/symbol/reduce.ts create mode 100644 packages/rxjs/src/symbol/ref-count.ts create mode 100644 packages/rxjs/src/symbol/repeat-when.ts create mode 100644 packages/rxjs/src/symbol/repeat.ts create mode 100644 packages/rxjs/src/symbol/retry-when.ts create mode 100644 packages/rxjs/src/symbol/retry.ts create mode 100644 packages/rxjs/src/symbol/sample-time.ts create mode 100644 packages/rxjs/src/symbol/sample.ts create mode 100644 packages/rxjs/src/symbol/scan.ts create mode 100644 packages/rxjs/src/symbol/sequence-equal.ts create mode 100644 packages/rxjs/src/symbol/share-replay.ts create mode 100644 packages/rxjs/src/symbol/share.ts create mode 100644 packages/rxjs/src/symbol/single.ts create mode 100644 packages/rxjs/src/symbol/skip-last.ts create mode 100644 packages/rxjs/src/symbol/skip-until.ts create mode 100644 packages/rxjs/src/symbol/skip-while.ts create mode 100644 packages/rxjs/src/symbol/skip.ts create mode 100644 packages/rxjs/src/symbol/start-with.ts create mode 100644 packages/rxjs/src/symbol/subscribe-on.ts create mode 100644 packages/rxjs/src/symbol/switch-map.ts create mode 100644 packages/rxjs/src/symbol/switch-scan.ts create mode 100644 packages/rxjs/src/symbol/take-last.ts create mode 100644 packages/rxjs/src/symbol/take-until.ts create mode 100644 packages/rxjs/src/symbol/take-while.ts create mode 100644 packages/rxjs/src/symbol/take.ts create mode 100644 packages/rxjs/src/symbol/tap.ts create mode 100644 packages/rxjs/src/symbol/throttle.ts create mode 100644 packages/rxjs/src/symbol/throw-if-empty.ts create mode 100644 packages/rxjs/src/symbol/time-interval.ts create mode 100644 packages/rxjs/src/symbol/timeout.ts create mode 100644 packages/rxjs/src/symbol/timer.ts create mode 100644 packages/rxjs/src/symbol/timestamp.ts create mode 100644 packages/rxjs/src/symbol/window-count.ts create mode 100644 packages/rxjs/src/symbol/window-time.ts create mode 100644 packages/rxjs/src/symbol/window-toggle.ts create mode 100644 packages/rxjs/src/symbol/window-when.ts create mode 100644 packages/rxjs/src/symbol/window.ts create mode 100644 packages/rxjs/src/symbol/with-latest-from.ts create mode 100644 packages/rxjs/src/symbol/zip-all.ts create mode 100644 packages/rxjs/src/symbol/zip-with.ts create mode 100644 scripts/generate-pipeable-surface.mjs diff --git a/docs/rxjs-next/ARCHITECTURE.md b/docs/rxjs-next/ARCHITECTURE.md index ff00c4204d..942c74d931 100644 --- a/docs/rxjs-next/ARCHITECTURE.md +++ b/docs/rxjs-next/ARCHITECTURE.md @@ -560,16 +560,17 @@ consequences of that split. ## Proposed all-pipeable beta experiment D-060 proposes exposing ordinary pipeable functions from the `rxjs` root while -retaining exact Symbols during beta. The first review slice is intentionally -smaller than the proposed destination: +retaining exact Symbols during beta. After two bounded review slices, the +maintainer approved expanding the experiment across the current catalog: - `rx(input, ...functions)` converts `input` through the active platform `Observable.from` and applies unary functions from left to right; - the ambient `ObservableInput` union names the platform conversion boundary; public `UnaryFunction` and `OperatorFunction` type aliases describe composition without a redundant mono-type alias; -- pipeable `map`, `filter`, and `take` are root exports and use an internal - `operate` helper; +- 91 source-bound functions are root exports; six dual static/source + capabilities use `*With` operator names, while 12 static forms retain their + ordinary names; - `operate` creates through the source's D-037 `[create]` protocol and catches synchronous connection failures, while `subscribeToSource` continues to own signal propagation and notification-callback safety; @@ -581,23 +582,34 @@ apply the same `mapOperator(project)` callback through `operate`; neither public surface delegates through the other. The second slice applies the same pattern to `takeOperator(count)`. -The post-review slice also adds two terminal shapes. RxJS `toArray()` is an +The post-review slices also add terminal shapes. RxJS `toArray()` is an `OperatorFunction` that emits one array on source completion instead of returning the Promise produced by the platform string method. The optional `subscribe(observer)` terminal returns a minimal AbortSignal-backed `Subscription` with `unsubscribe()` and a live `closed` getter; it is not an -RxJS 7 Subscription tree. - -The pilot does not settle the package layout. In particular, `rxjs/map` and -`rxjs/filter` still export their existing Symbols even though the root exports -pipeable functions with those names. Moving exact Symbols to an -`rxjs/symbol` boundary and making ordinary deep imports pipeable would alter -public exports and package side effects and remains gated on maintainer review. -The pilot now exposes additive `rxjs/pipeable/{map,filter,take}` and -`rxjs/symbol/{map,filter,take}` aliases so both per-operator directions can be -tested without changing the established paths. `rxjs/rx`, `rxjs/to-array`, and -`rxjs/subscribe` are direct deep imports because they have no legacy Symbol -collision. +RxJS 7 Subscription tree. The four async-iteration terminals return their +exact `AsyncGenerator` types, so `rx(source, iterateEachValue())` crosses out of +the Observable graph without result coercion. + +The complete additive layout has `rxjs/pipeable`, `rxjs/static`, and +`rxjs/symbol` barrels plus per-capability paths. Existing `rxjs/map`-style +paths still export their Symbols; switching those paths remains a separate +breaking decision. `rxjs/rx`, `rxjs/to-array`, `rxjs/subscribe`, and the six +new `*With` names also have direct paths. + +The broad facade is generated from the ambient instance/static Symbol +signatures, preserving overloads, type guards, tuple results, and explicit +`this` receiver restrictions. `map` and `take` keep their reviewed shared +`operate` callbacks. Other generated functions delegate to the corresponding +exact-Symbol implementation as a branch-by-abstraction seam. A freshness gate +reconciles 91 operators, 12 statics, and all 98 exported Symbols including the +package-private D-037 construction protocol. + +That seam changes root import behavior: the root re-exports load the shared +side-effectful Symbol modules, so the prior root-core-only installation +contract no longer holds on this branch. Focused deep imports remain available, +and final acceptance requires explicit bundle-retention evidence or a further +split between implementation and Symbol installation. The initial `rx` declaration uses explicit overloads through nine transformations and an `unknown` fallback after that point. This makes the @@ -1025,8 +1037,11 @@ and none of these contracts creates an RxJS 7 compatibility claim. See `@rxjs/observable-polyfill`. - Every public `rxjs` source entry reaches the conditional initializer before reading or extending `Observable`. -- The root source exports the approved non-operator core. Each public source - subpath has one ESM runtime and declaration export. +- The P6.12 experiment exports the complete functional catalog from the root + alongside the approved non-operator core. Because most generated facades + currently share their exact-Symbol modules, evaluating that root installs + those exact keys. Each public source subpath still has one ESM runtime and + declaration export. - The polyfill's ambient declarations are emitted from its package entry. - All four release packages build one ESM output without self-links or source specs in the packed artifact. Browser, Webpack, `import`, and Node @@ -1042,7 +1057,7 @@ The published runtime map has three products: | Package | Accepted responsibility | | --------------------------- | -------------------------------------------------------------------------------------------------- | | `@rxjs/observable-polyfill` | Independently publishable conditional fallback and owner of the base ambient platform declarations | -| `rxjs` | Symbol extensions plus intentional non-operator RxJS Next classes and values | +| `rxjs` | Symbol extensions, experimental functional facades, and intentional RxJS Next classes and values | | `@rxjs/test` | Implementation-neutral test harness that consumes an already initialized realm | `@rxjs/observable` has no target role and is removed. No runtime @@ -1050,10 +1065,21 @@ compatibility package replaces it. `rxjs` declares a runtime dependency on `@rxjs/observable-polyfill`. Every public root or subpath import first evaluates the conditional initializer. The -root exports non-operator core values—cold, Subject, connectable, notification, -and public-error primitives—without installing the operator and factory -catalog. An operator or factory subpath installs only its exported exact Symbol -capability and internal kernel dependencies. +accepted pre-P6.12 root exported non-operator core values—cold, Subject, +connectable, notification, and public-error primitives—without installing the +operator and factory catalog. The P6.12 branch deliberately replaces that +property for review: root functional re-exports share most exact-Symbol +implementation modules and therefore install the catalog as they evaluate. +Focused exact-Symbol subpaths retain their established behavior, while focused +`rxjs/pipeable/*` and `rxjs/static/*` paths bound the requested functional +graph. + +This is not yet accepted release architecture. The production Webpack fixture +emits 64,874 bytes against its 22,000-byte ceiling with the experimental root. +That expected failure quantifies the root-retention risk; it is not permission +to raise the release budget. P6.12 remains review-gated on either separating +shared implementations from installation or explicitly accepting a different +root contract and its measured cost. The polyfill package owns the ambient TypeScript declarations for `Observable`, `Subscriber`, `ObservableInput`, and `EventTarget.when`. diff --git a/docs/rxjs-next/COMPATIBILITY.md b/docs/rxjs-next/COMPATIBILITY.md index 8c6fe0c8ce..b38f00c9c4 100644 --- a/docs/rxjs-next/COMPATIBILITY.md +++ b/docs/rxjs-next/COMPATIBILITY.md @@ -234,14 +234,21 @@ support: producer-per-subscription Next semantics. The exact Symbol-addressed `[pipe]` remains an intentional Next API. D-060's -parallel pilot now adds root `rx`, pipeable `map`, `filter`, `take`, and -Observable-returning `toArray`, plus -`UnaryFunction` and `OperatorFunction`. `OperatorFunction` replaces the -redundant `MonoTypeOperatorFunction` alias. These are new Next contracts and do -not imply that RxJS 7 import paths, scheduler overloads, broad -`ObservableInput`, or full `Subscription` behavior are restored. The optional -`subscribe` terminal exposes only `unsubscribe()` and a live `closed` getter -backed by one AbortSignal. +parallel experiment now adds root `rx`, 91 source-bound functions, 12 static +functions, Observable-returning `toArray`, `UnaryFunction`, and +`OperatorFunction`. `OperatorFunction` replaces the redundant +`MonoTypeOperatorFunction` alias. Six dual static/source capabilities use +`*With` names for their pipeable forms. These are new Next contracts and do +not imply that RxJS 7 scheduler overloads, broad `ObservableInput`, or full +`Subscription` behavior are restored. The optional `subscribe` terminal +exposes only `unsubscribe()` and a live `closed` getter backed by one +AbortSignal. + +The four async-iteration functions deliberately return `AsyncGenerator` +instead of Observable. The complete additive import layout exposes +`rxjs/pipeable`, `rxjs/static`, and `rxjs/symbol` barrels and focused paths; +established `rxjs/map`-style paths continue to export Symbols until a separate +breaking package-layout decision is accepted. The initial `rx` overloads preserve exact types through nine transformations and return `unknown` for longer chains. Migration tooling must not hide that diff --git a/docs/rxjs-next/DECISIONS.md b/docs/rxjs-next/DECISIONS.md index 22e7a982ba..a58c71bc0e 100644 --- a/docs/rxjs-next/DECISIONS.md +++ b/docs/rxjs-next/DECISIONS.md @@ -1516,7 +1516,7 @@ Status meanings: ## D-060 — Evaluate an all-pipeable beta surface alongside exact Symbols -- **Status:** Proposed +- **Status:** Proposed; complete catalog experiment implemented for review - **Direction under review:** Add ordinary pipeable operator functions at the `rxjs` root and compose them with `rx(input, ...functions)`. `rx` converts its first input through the active platform `Observable.from` and returns the @@ -1570,6 +1570,42 @@ Status meanings: `rxjs/symbol/*` aliases for `map`, `filter`, and `take`. Established Symbol subpaths are unchanged. +### Complete-catalog review slice + +- **Status:** Proposed implementation for review +- **Maintainer direction:** Expand the experiment to every current + source-bound Symbol capability. Where one capability also has a static form, + keep the ordinary static name and use a `*With` name for the source-bound + function. +- **Catalog:** The experiment exposes 91 source-bound functions and 12 static + functions. Six capabilities occur in both groups, covering all 97 public + capability Symbols. The D-037 construction protocol remains Symbol-only. +- **Static/source-bound names:** `combine`/`combineWith`, + `combineLatest`/`combineLatestWith`, `concat`/`concatWith`, + `merge`/`mergeWith`, `onErrorResumeNext`/`onErrorResumeNextWith`, and + `race`/`raceWith` are deliberately distinct. +- **Hook rejection:** A private hook on a static function cannot affect + `rx(source, merge(other))` because `merge(other)` is evaluated before `rx`. + Branding the returned Observable would give one value hidden + context-dependent behavior and did not preserve the fixed overloads' + generic output or callback contextual typing without substantially more + recursive type machinery. +- **Terminal preservation:** `iterateBufferedValues`, `iterateEachValue`, + `iterateLatestValue`, and `iterateNextValue` remain unary terminal functions + returning their exact `AsyncGenerator` types. +- **Implementation seam:** `map` and `take` retain their reviewed shared + `operate` callbacks. The broad catalog uses generated, overload-preserving + facades over the existing exact-Symbol implementation so runtime behavior + and the historical tests remain one seam during evaluation. +- **Paths:** Add complete `rxjs/pipeable`, `rxjs/static`, and `rxjs/symbol` + barrels plus per-capability paths. Existing ordinary Symbol deep imports are + retained until the final package-layout decision. +- **Consequence:** Importing the complete `rxjs` root now loads the shared + side-effectful Symbol implementation modules. The previous root-core-only + import fixture is replaced by a functional-surface coexistence fixture. + Bundle retention and whether implementation modules must be separated from + Symbol installation remain explicit final-review gates. + ## D-061 — Name the platform conversion union `ObservableInput` - **Status:** Accepted diff --git a/docs/rxjs-next/OPEN_QUESTIONS.md b/docs/rxjs-next/OPEN_QUESTIONS.md index ea1ceeaf4b..0fe7e925ee 100644 --- a/docs/rxjs-next/OPEN_QUESTIONS.md +++ b/docs/rxjs-next/OPEN_QUESTIONS.md @@ -177,27 +177,28 @@ accepted decision and product contract. ### 10. How should pipeable functions and exact Symbols coexist during beta? -D-060 proposes both surfaces. After the first review, the pilot proves root -`rx`, `map`, `filter`, `take`, Observable-returning `toArray`, and a lite -`subscribe` terminal. The existing `rxjs/map`, `rxjs/filter`, and `rxjs/take` -deep imports still export exact Symbols. Before expanding the catalog, decide: +D-060 proposes both surfaces. After two bounded reviews, the maintainer +approved a complete-catalog experiment. It now exposes 91 source-bound +functions, 12 static functions, Observable-returning `toArray`, the lite +`subscribe` terminal, and four exact-`AsyncGenerator` terminal functions. The +existing `rxjs/map`-style deep imports still export exact Symbols. Decide: - whether ordinary deep imports become pipeable functions; -- whether Symbols move to one `rxjs/symbol` barrel, per-operator - `rxjs/symbol/map` paths, or both; - whether `operate` is internal or public; - whether nine fixed transformations is the accepted `rx` type horizon or a different design passes representative type-check performance gates; - whether the tested Observable-returning `toArray` and live AbortSignal-backed - lite `subscribe` contracts should be accepted. - -The first review resolved implementation sharing for overlapping behavior: -both public forms use the same internal operator callback through `operate`, -beginning with `mapOperator`. Package layout, overload evidence, helper -visibility, terminal/subscription acceptance, and the complete-catalog layout -remain open. Additive per-operator `rxjs/pipeable/*` and `rxjs/symbol/*` pilot -aliases gather path evidence without moving the established exports. - -Do not answer these questions implicitly through bulk file moves or operator -conversion. The first pilot and its comparison document are the evidence for + lite `subscribe` contracts should be accepted; +- whether the root may load the shared side-effectful Symbol implementation + modules, or implementation and installation must be split before shipping. + +The complete experiment resolves the additive layout question: `rxjs/pipeable`, +`rxjs/static`, and `rxjs/symbol` each have a barrel and focused deep imports. +It also rejects a private static-function hook in favor of `*With` operator +names. The final ordinary-deep-import move, overload evidence, helper +visibility, terminal/subscription acceptance, root-import side effects, and +bundle retention remain open. + +Do not answer the remaining questions implicitly through bulk file moves. The +complete experiment and its comparison document are the evidence for the final maintainer review. diff --git a/docs/rxjs-next/PROJECT_PLAN.md b/docs/rxjs-next/PROJECT_PLAN.md index 1b65bd7691..af02578638 100644 --- a/docs/rxjs-next/PROJECT_PLAN.md +++ b/docs/rxjs-next/PROJECT_PLAN.md @@ -83,9 +83,11 @@ truthful status signals and security automation and validated their first live GitHub results. The user then explicitly prioritized P6.11, which removed inherited callback `thisArg` parameters and their hot-path dispatch cost. The user has now paused first-beta publication to evaluate an all-pipeable public -surface alongside the exact-Symbol surface. P6.12 is the sole `NEXT` item and -is review-gated after a small pilot; P6.10 returns to `PLANNED` until that beta -architecture is settled. +surface alongside the exact-Symbol surface. After two bounded review slices, +the maintainer approved a complete-catalog experiment with `*With` names for +dual static/source capabilities. P6.12 is the sole `NEXT` item and remains +review-gated on the complete evidence; P6.10 returns to `PLANNED` until that +beta architecture is settled. RxJS 9 and `9.0.0-beta.0` are selected under D-007. D-053 defines runtime, browser, bundler, channel, and RxJS 7 maintenance policy. Dates and staffing @@ -1689,28 +1691,26 @@ review`. This completes P6.9; the later P6.10 ruleset migration must preserve #### P6.12 completion bar -- A dedicated branch adds `rx`, a typed `operate` foundation, and only two - representative pipeable operators without removing or changing the existing - exact-Symbol implementations or their tests. -- The pipeable APIs are available from the `rxjs` root, accept platform - `ObservableInput` through `Observable.from`, construct through the accepted - D-037 creation protocol, and preserve signal-owned source cancellation and - stream error forwarding. -- Focused runtime tests cover composition, shared activation, cancellation, - restart, callback errors, and coexistence with the existing Symbol forms; - public declaration tests cover inference and the initial overload boundary. -- Documentation records the experiment separately from the accepted Symbol - architecture, including TypeScript overload limits and checking cost. No - Symbol file move, full-catalog conversion, Promise-consumer replacement, or - compatibility `subscribe` facade is attempted before maintainer review. -- Stop after presenting the pilot implementation and evidence to the user. - Any broader file layout, export, helper, or operator-family structure remains - gated on that review. -- The first maintainer review permits one follow-up slice: apply the requested - type cleanup, share map implementation logic, then add only pipeable `take`, - Observable-returning `toArray`, and the optional live AbortSignal-backed - `subscribe` facade with additive pilot deep imports. Return for review before - expanding the catalog or moving established Symbol paths. +- A dedicated branch adds `rx`, the typed `operate` foundation, all 91 current + source-bound capability functions, and all 12 ordinary static functions + without removing the exact-Symbol implementations or their behavioral tests. +- Dual static/source capabilities use reviewed `*With` operator names. The + private-hook alternative is rejected with runtime and TypeScript evidence; + all four async-iteration terminals retain exact `AsyncGenerator` results. +- The complete functions are available from the `rxjs` root and through + `rxjs/pipeable`, `rxjs/static`, and focused paths. Exact Symbols are available + through a complete `rxjs/symbol` barrel and focused paths while established + Symbol deep imports remain executable for the experiment. +- Generated declarations preserve catalog overloads, type guards, tuple + results, and receiver restrictions. A freshness gate reconciles every + operator, static function, and Symbol export. +- Runtime, public declaration, built-package, and import tests cover + composition, shared activation, cancellation, restart, callback errors, + static/`*With` separation, AsyncIterable terminals, and coexistence with the + existing Symbol forms. +- Documentation records TypeScript limits, checking cost, package-layout + choices, root-import side effects, and bundle-retention risk. Stop after + presenting the complete experiment and evidence for final maintainer review. #### P6.1 completion bar @@ -3808,3 +3808,34 @@ conformance implementation depends on a runnable harness. three passed alone and the complete serial run was green. - P6.12 remains `NEXT`; stop after this second slice for maintainer review before converting more operators or moving established Symbol subpaths. + +### 2026-08-06 — P6.12 complete-catalog experiment + +- Expanded the reviewed pilot to all 91 source-bound capabilities and all 12 + ordinary statics. The six dual capabilities use `combineWith`, + `combineLatestWith`, `concatWith`, `mergeWith`, `onErrorResumeNextWith`, and + `raceWith`; the four async-iteration terminals retain exact + `AsyncGenerator` results. +- Added an AST-backed generator and freshness gate that preserve overloads, + type guards, tuple results, conditional results, and receiver restrictions + while reconciling root, `rxjs/pipeable`, `rxjs/static`, `rxjs/symbol`, and + focused package paths. All 97 public capability Symbols remain installed and + independently importable. +- Rejected the private static-to-pipeable hook: JavaScript evaluates the static + call before `rx` can inspect the function, while branding returned + Observables or recursively typing the handoff either hides behavior or loses + the generic source/output and callback-context relationships. Separate + `*With` names preserve those relationships without context-sensitive calls. +- Passed 114 source files and 780 tests, the complete package/build/type/import + gate, functional-surface freshness, migration-document freshness, all 97 + installation audits, and lint with zero errors. The strict executable audits + retained exactly 2,299/2,338 cold passes and 2,321/2,343 polyfill-mode passes; + the latter includes five passing platform-lifecycle cases beyond the + source-pinned 2,316/2,338 baseline. +- The production Webpack fixture emits 64,874 bytes against its 22,000-byte + release ceiling because the experimental root re-exports side-effectful + shared Symbol modules. This expected failure is recorded as the decisive + root-retention review cost rather than weakening the budget. +- P6.12 remains the sole `NEXT` item for final maintainer review. Ordinary + `rxjs/map`-style paths still expose Symbols, and no release architecture or + bundle-budget change is accepted by this experiment alone. diff --git a/packages/rxjs/MIGRATION.md b/packages/rxjs/MIGRATION.md index a09d712527..52d013f8f1 100644 --- a/packages/rxjs/MIGRATION.md +++ b/packages/rxjs/MIGRATION.md @@ -3,9 +3,9 @@ RxJS 9 is a new platform-based generation of RxJS. It extends the active web-platform `Observable` with exact Symbol-keyed capabilities instead of shipping the RxJS 7 Observable or scheduler runtime. This branch also contains -a review-gated pipeable pilot and a minimal AbortSignal-backed subscription -handle; neither restores the complete RxJS 7 surface. The first planned -prerelease is `9.0.0-beta.0`. +a review-gated complete functional facade and a minimal AbortSignal-backed +subscription handle; neither restores the complete RxJS 7 surface. The first +planned prerelease is `9.0.0-beta.0`. This is a semantic migration, not a package-version bump. Before changing imports, decide which producer, sharing, cancellation, and timing behavior each @@ -57,8 +57,9 @@ properties. ## Operator imports and composition -The complete reviewed migration target remains exact Symbol imports and -Symbol-keyed calls. The root package does not install the Symbol catalog. +The accepted migration target remains exact Symbol imports and Symbol-keyed +calls. The branch experiment additionally exposes a complete functional +surface; root imports currently load its shared Symbol implementation modules. ```ts // RxJS 7 @@ -72,8 +73,7 @@ const names = users.pipe( ```ts // RxJS 9 -import { filter } from 'rxjs/filter'; -import { map } from 'rxjs/map'; +import { filter, map } from 'rxjs/symbol'; const names = users[filter]((user) => user.active)[map]((user) => user.name); ``` @@ -83,8 +83,8 @@ The platform and RxJS forms can coexist. For example, `source[map](project)` is the RxJS contract. Importing the RxJS Symbol must not replace the platform string-named method. -The experimental branch also supports ordinary composition for its reviewed -subset: +The experimental branch also supports ordinary composition across the current +catalog: ```ts import { filter, map, rx } from 'rxjs'; @@ -96,9 +96,9 @@ const names = rx( ); ``` -This familiar syntax does not restore the entire RxJS 7 operator catalog, -`.pipe`, scheduler overloads, or producer-per-subscription behavior. Review -the target lifecycle before choosing it as a migration destination. +This familiar syntax does not restore removed RxJS 7 aliases, `.pipe`, +scheduler overloads, or producer-per-subscription behavior. Review the target +lifecycle before choosing it as a migration destination. RxJS 9 does not accept the RxJS 7 callback `thisArg` parameter on `every`, `filter`, `find`, `findIndex`, `map`, or `partition`. Capture state with a @@ -114,15 +114,14 @@ Use the exact `pipe` Symbol only when deliberate multi-step composition is clearer than direct Symbol chaining: ```ts -import { map } from 'rxjs/map'; -import { pipe } from 'rxjs/pipe'; +import { map, pipe } from 'rxjs/symbol'; const names = users[pipe]((source) => source[map]((user) => user.name)); ``` -RxJS 9 does not publish `.pipe`. The pilot publishes a small pipeable subset, -`UnaryFunction`, and `OperatorFunction`; it is not yet a full compatibility -surface. +RxJS 9 does not publish `.pipe`. The experiment publishes the complete current +source-bound catalog, `UnaryFunction`, and `OperatorFunction`; it is still not +an RxJS 7 compatibility surface. ## Cancellation and teardown diff --git a/packages/rxjs/README.md b/packages/rxjs/README.md index 2f99af54ca..1ff49be481 100644 --- a/packages/rxjs/README.md +++ b/packages/rxjs/README.md @@ -1,9 +1,10 @@ # `rxjs` 9 beta RxJS 9 extends the web-platform Observable with exact Symbol-keyed operators -and factories, plus a small set of intentional RxJS primitives. It uses a -native `Observable` when one exists and otherwise initializes the separately -published `@rxjs/observable-polyfill` fallback. +and factories, plus an experimental complete functional facade and a small set +of intentional RxJS primitives. It uses a native `Observable` when one exists +and otherwise initializes the separately published +`@rxjs/observable-polyfill` fallback. This is prerelease software. Install the current beta with: @@ -21,7 +22,7 @@ finalized. RxJS 9 is a new platform-based generation, not a release of that paused implementation. The version communicates that architectural break and prevents the old RxJS 8 work from being mistaken for this product. -## Try the pipeable pilot +## Try the complete pipeable experiment ```ts import { filter, map, rx, subscribe, take, toArray } from 'rxjs'; @@ -38,11 +39,12 @@ const subscription = rx( console.log(subscription.closed); // true after synchronous completion ``` -This branch is evaluating the root-level pipeable surface alongside the -existing exact-Symbol catalog. After the first review, the pilot contains -`rx`, `map`, `filter`, `take`, Observable-returning `toArray`, and the optional -AbortSignal-backed `subscribe` compatibility terminal. Existing operator -subpaths still export their exact Symbols and install only those capabilities. +This branch is evaluating 91 root-level source operators and 12 static +functions alongside the existing exact-Symbol catalog. Dual static/source +capabilities use names such as `merge` and `mergeWith`. Async-iteration +terminals remain `AsyncGenerator` results. Complete `rxjs/pipeable`, +`rxjs/static`, and `rxjs/symbol` barrels and focused deep imports are available; +established Symbol subpaths remain unchanged during final review. ## Choose the lifecycle deliberately @@ -69,7 +71,7 @@ and Node's `require(esm)` bridge resolve the same files and exact Symbols. ```js const { ColdObservable } = require('rxjs'); -const { map } = require('rxjs/map'); +const { map } = require('rxjs/pipeable/map'); ``` The bridge requires Node 22.13 or newer. It is not a CommonJS build and does diff --git a/packages/rxjs/docs/API.md b/packages/rxjs/docs/API.md index 3010e401dc..63550d3c86 100644 --- a/packages/rxjs/docs/API.md +++ b/packages/rxjs/docs/API.md @@ -1,8 +1,9 @@ # RxJS 9 API and import guide RxJS 9 separates the platform Observable contract from RxJS capabilities. -This branch also contains a review-gated pipeable pilot at the root; the -existing Symbol catalog remains available from its current subpaths. +This branch also contains a review-gated complete functional facade at the +root; the existing Symbol catalog remains available from its current subpaths +and the complete `rxjs/symbol` boundary. ## Root exports @@ -30,13 +31,13 @@ The root also exports notifications and public errors, including `PerSubscriptionSubjectBase` when it needs observer-local setup without claiming that a Subject is cold. -Importing `rxjs` conditionally initializes the platform Observable surface. It -does not install every Symbol operator. The experimental `map`, `filter`, -`take`, and `toArray` root exports are ordinary pipeable functions and do not -patch operator keys. The experimental `subscribe` export is a terminal -composition function. +Importing `rxjs` conditionally initializes the platform Observable surface and +loads the implementation modules for the complete functional facade. Most of +those modules also install their exact Symbols; `map`, `filter`, and `take` +retain their separately reviewed function implementations. The experimental +`subscribe` export is a terminal composition function. -## Pipeable pilot +## Complete functional experiment ```ts import { filter, map, rx } from 'rxjs'; @@ -71,20 +72,18 @@ The ambient platform declarations expose `ObservableInput`; the root exports [all-pipeable experiment](PIPEABLE_EXPERIMENT.md) for the overload horizon, checking-cost tradeoffs, and unresolved import layout. -The pilot exposes additive deep imports at `rxjs/rx`, `rxjs/to-array`, and -`rxjs/subscribe`. Operators whose ordinary subpaths still name exact Symbols -are also available under `rxjs/pipeable/map`, `rxjs/pipeable/filter`, and -`rxjs/pipeable/take`. Matching additive Symbol aliases exist at -`rxjs/symbol/map`, `rxjs/symbol/filter`, and `rxjs/symbol/take`; the established -Symbol subpaths remain unchanged while the final layout is under review. +The complete source-bound catalog is available from `rxjs/pipeable` and +per-capability paths such as `rxjs/pipeable/map` and +`rxjs/pipeable/merge-with`. Static functions are available from `rxjs/static` +and paths such as `rxjs/static/merge`. Exact Symbols are available from +`rxjs/symbol` and paths such as `rxjs/symbol/map`. Established Symbol subpaths +remain unchanged while the final ordinary-deep-import layout is under review. ## Symbol operators ```ts import 'rxjs'; -import { filter } from 'rxjs/filter'; -import { map } from 'rxjs/map'; -import { switchMap } from 'rxjs/switch-map'; +import { filter, map, switchMap } from 'rxjs/symbol'; const result = source[filter]((value) => value.active)[map]((value) => value.id); ``` @@ -111,28 +110,34 @@ in the [generated ledger](MIGRATION_EVIDENCE_LEDGER.md). ## Factories and composition -Factories such as `timer` are static Symbols: +Factories such as `timer` are ordinary root functions in the experiment and +remain static Symbols through the separate Symbol boundary: ```ts -import { timer } from 'rxjs/timer'; +import { timer } from 'rxjs'; +import { timer as timerSymbol } from 'rxjs/symbol'; -Observable[timer](1000).subscribe(console.log); +timer(1000).subscribe(console.log); +Observable[timerSymbol](1000).subscribe(console.log); ``` -The `pipe` Symbol supports instance and static composition: +The root `pipe` function creates a reusable source-bound composition, while the +exact `pipe` Symbol retains instance and static composition: ```ts -import { map } from 'rxjs/map'; -import { pipe } from 'rxjs/pipe'; +import { map, pipe } from 'rxjs'; +import { map as mapSymbol, pipe as pipeSymbol } from 'rxjs/symbol'; -const doubled = source[pipe]((values) => values[map]((value) => value * 2)); -const normalized = Observable[pipe]([1, 2], (values) => values[map](String)); +const double = pipe(map((value: number) => value * 2)); +const doubled = double(source); +const normalized = Observable[pipeSymbol]([1, 2], (values) => values[mapSymbol](String)); ``` -The existing Symbol form does not install `.pipe`. The review-gated root pilot -does publish `rx`, three pipeable source operators, Observable-returning -`toArray`, a lite `subscribe` terminal, and `OperatorFunction`; it does not yet -convert the full catalog. +Neither form installs `.pipe`. The review-gated root experiment publishes the +complete current source-bound catalog, static functions, +Observable-returning `toArray`, a lite `subscribe` terminal, and +`OperatorFunction`. Six dual capabilities use `*With` source-operator names; +the four async-iteration terminals retain exact `AsyncGenerator` results. ## Construction and input boundaries diff --git a/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md b/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md index a61f5cc967..7e93b8a67a 100644 --- a/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md +++ b/packages/rxjs/docs/PIPEABLE_EXPERIMENT.md @@ -1,12 +1,18 @@ # All-pipeable beta experiment This branch evaluates an all-pipeable RxJS 9 surface alongside the existing -exact-Symbol surface. It is deliberately small: the first review slice contains -`rx`, pipeable `map` and `filter`, the public composition types, and an internal -`operate` helper. After the first maintainer review, a second small slice adds -pipeable `take`, Observable-returning `toArray`, and the optional lite -`subscribe` terminal. The rest of the catalog and final Symbol import move -remain gated on maintainer review. +exact-Symbol surface. Two review slices established `rx`, the composition +types, `operate`, `map`, `filter`, `take`, Observable-returning `toArray`, and +the lite `subscribe` terminal. The maintainer then approved expanding the +experiment across the current catalog and using `*With` names where one +capability has both static and source-bound forms. + +The complete experiment contains 91 source-bound functions and 12 ordinary +static functions. Six capabilities occur in both groups, so together they +cover all 97 public capability Symbols. The package-private construction +protocol remains a Symbol only. The four async-iteration terminals retain +their exact `AsyncGenerator` results instead of being normalized to an +Observable. The experiment does not change the platform foundation. `rx` converts its first argument with the active realm's `Observable.from`; pipeable operators @@ -36,8 +42,7 @@ return type. ```ts import 'rxjs'; -import { filter } from 'rxjs/filter'; -import { map } from 'rxjs/map'; +import { filter, map } from 'rxjs/symbol'; const source = Observable.from([1, 2, 3, 4]); const result = source[filter]((value) => value % 2 === 0)[map]((value, index) => `${index}: ${value * 10}`); @@ -45,11 +50,11 @@ const result = source[filter]((value) => value % 2 === 0)[map]((value, index) => result.subscribe(console.log); // '0: 20', '1: 40' ``` -The current deep imports still export Symbols. The proposed eventual shape is -for ordinary deep imports to export pipeable functions and for exact Symbols -to move under a clearly separate `rxjs/symbol` boundary. This pilot does not -perform that move because it would answer package-layout and barrel-versus- -per-operator questions before the implementation pattern is reviewed. +The established `rxjs/map`-style deep imports still export Symbols during the +experiment. Exact Symbols are also available from the complete `rxjs/symbol` +barrel and from per-capability paths such as `rxjs/symbol/map`. This preserves +existing evidence while allowing the eventual ordinary-deep-import move to be +reviewed separately. ## Platform method form @@ -70,19 +75,19 @@ separate Observable-returning contracts. ## Critical comparison -| Concern | `rx` plus pipeable functions | Exact Symbol chaining | Platform methods | -| -------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| Visual flow | Reads left-to-right as a list of transformations and keeps punctuation light | Reads left-to-right on the value, but bracket access is unfamiliar and visually dense | Familiar method chaining with the least import ceremony | -| Catalog uniformity | One syntax can cover every RxJS operator, factory adapter, and terminal Observable | One syntax can cover the full RxJS catalog without taking string names | Limited to the standardized platform catalog | -| Type inference | Strong within the declared overload horizon; depends on contextual typing across one overloaded call | Each receiver call is inferred independently with no chain-length horizon | Each receiver call is inferred independently | -| Long chains | This pilot preserves nine transformations and returns `unknown` beyond that point | No fixed composition overload limit | No fixed composition overload limit | -| Type-error locality | An incompatibility can be reported at an overload boundary or later argument instead of exactly at the bad handoff | Usually points at the exact Symbol call whose receiver type is incompatible | Usually points at the exact method call | -| TypeScript work | More overloads increase declaration size and overload-resolution work at every call site | Work grows one ordinary call at a time | Work grows one ordinary call at a time | -| Runtime mutation | Pipeable functions do not install operator properties | Importing a capability patches its exact Symbol onto the active constructor or prototype | Owned by the native implementation or fallback | -| Collision behavior | Ordinary lexical imports; no global property collision | Exact module-owned Symbols isolate unrelated libraries and package copies | String names belong to the platform contract | -| Tree shaking | A function import can be removed when unused if the module remains side-effect-free | Capability imports are side effects and must be retained even when the Symbol binding appears unused | No RxJS operator module is needed | -| Native overlap | RxJS owns a distinct function contract even when the platform has the same familiar name | The distinct exact key makes the boundary explicit at the call site | Always selects the platform contract | -| Agent-generated code | Common JavaScript functional-composition syntax is easy to synthesize and refactor | Exact keys are unambiguous but require less familiar syntax | Familiar, but agents must know which names return Promises or lack RxJS behavior | +| Concern | `rx` plus pipeable functions | Exact Symbol chaining | Platform methods | +| -------------------- | --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| Visual flow | Reads left-to-right as a list of transformations and keeps punctuation light | Reads left-to-right on the value, but bracket access is unfamiliar and visually dense | Familiar method chaining with the least import ceremony | +| Catalog uniformity | One syntax can cover every RxJS operator, factory adapter, and terminal Observable | One syntax can cover the full RxJS catalog without taking string names | Limited to the standardized platform catalog | +| Type inference | Strong within the declared overload horizon; depends on contextual typing across one overloaded call | Each receiver call is inferred independently with no chain-length horizon | Each receiver call is inferred independently | +| Long chains | This pilot preserves nine transformations and returns `unknown` beyond that point | No fixed composition overload limit | No fixed composition overload limit | +| Type-error locality | An incompatibility can be reported at an overload boundary or later argument instead of exactly at the bad handoff | Usually points at the exact Symbol call whose receiver type is incompatible | Usually points at the exact method call | +| TypeScript work | More overloads increase declaration size and overload-resolution work at every call site | Work grows one ordinary call at a time | Work grows one ordinary call at a time | +| Runtime mutation | The complete facade currently imports the shared Symbol implementations, so a root import installs those exact keys | Importing a capability patches its exact Symbol onto the active constructor or prototype | Owned by the native implementation or fallback | +| Collision behavior | Ordinary lexical imports; no global property collision | Exact module-owned Symbols isolate unrelated libraries and package copies | String names belong to the platform contract | +| Tree shaking | Root re-exports share side-effectful implementation modules in this experiment; use focused deep imports for smaller graphs | Capability imports are side effects and must be retained even when the Symbol binding appears unused | No RxJS operator module is needed | +| Native overlap | RxJS owns a distinct function contract even when the platform has the same familiar name | The distinct exact key makes the boundary explicit at the call site | Always selects the platform contract | +| Agent-generated code | Common JavaScript functional-composition syntax is easy to synthesize and refactor | Exact keys are unambiguous but require less familiar syntax | Familiar, but agents must know which names return Promises or lack RxJS behavior | Readability is subjective, but the tradeoffs are not. Pipeable syntax removes the brackets users objected to and matches existing RxJS experience. Symbol @@ -107,6 +112,56 @@ This keeps cancellation, sharing, error forwarding, and later Observable composition inside the same graph. It does not wrap the platform Promise; it collects source values through `operate` and emits only on completion. +## AsyncIterable terminal forms + +Async-iteration is a real composition boundary rather than an Observable +operator result. All four strategies retain their exact generator types: + +```ts +import { iterateEachValue, map, rx } from 'rxjs'; + +const values = rx( + [1, 2, 3], + map((value) => value * 10), + iterateEachValue() +); + +for await (const value of values) { + console.log(value); // 10, 20, 30 +} +``` + +`iterateBufferedValues`, `iterateLatestValue`, and `iterateNextValue` follow +the same rule. Because `rx` composes arbitrary unary functions, no special +AsyncIterable overload or result coercion is required. + +## Static functions and source-bound `*With` operators + +A static creator and a source-bound operator cannot safely share one call +syntax. Static `merge` and pipeable `mergeWith` therefore remain distinct: + +```ts +import { merge, mergeWith, rx } from 'rxjs'; + +const created = merge([[1, 2], ['three']]); +const extended = rx([1, 2], mergeWith([['three']])); +``` + +The same split applies to `combine`/`combineWith`, +`combineLatest`/`combineLatestWith`, `concat`/`concatWith`, +`onErrorResumeNext`/`onErrorResumeNextWith`, and `race`/`raceWith`. Pure static +creators such as `timer`, `interval`, `forkJoin`, and `generate` remain +ordinary functions and are not presented as source operators. + +The rejected private-hook proposal had a runtime problem before its typing +problem: JavaScript evaluates `merge(other)` before calling `rx`, so `rx` +receives the returned Observable and cannot inspect a hook on `merge`. +Branding that returned Observable would introduce hidden context-dependent +behavior. It also caused the generic source/output relationship to collapse +toward `Observable` in fixed `rx` overloads; recursive conditional +alternatives degraded the contextual callback inference those overloads exist +to preserve. The explicit `*With` functions avoid both failures. + ## Lite subscription terminal ```ts @@ -125,14 +180,17 @@ errors. ## Provisional deep imports -New names without collisions use `rxjs/rx`, `rxjs/to-array`, and -`rxjs/subscribe`. While `rxjs/map`, `rxjs/filter`, and `rxjs/take` retain their -exact Symbols, the pilot functions are available at `rxjs/pipeable/map`, -`rxjs/pipeable/filter`, and `rxjs/pipeable/take`. Additive aliases at -`rxjs/symbol/map`, `rxjs/symbol/filter`, and `rxjs/symbol/take` exercise the -per-operator Symbol direction without moving or removing the established -subpaths. These aliases are evidence for the final layout, not a decision that -the complete catalog must use this exact arrangement. +The complete functional surface is available from `rxjs` and the +`rxjs/pipeable` barrel. Every source-bound capability also has a focused path, +for example `rxjs/pipeable/buffer` or `rxjs/pipeable/merge-with`. Static +functions have `rxjs/static` and `rxjs/static/merge` forms. Exact Symbols have +both `rxjs/symbol` and `rxjs/symbol/merge` forms. + +Direct non-colliding paths such as `rxjs/rx`, `rxjs/to-array`, +`rxjs/subscribe`, and `rxjs/merge-with` remain available. Established paths +such as `rxjs/map` still expose Symbols in this experiment so the existing +test and migration corpus remains executable. Whether those ordinary paths +switch to functions before beta remains a final review decision. ## TypeScript limits and checking cost @@ -162,7 +220,7 @@ callback parameter type restores that information. Symbol and platform method calls start from a concrete receiver type, so they are less exposed to that particular failure mode. -## Initial implementation pattern +## Implementation pattern Pipeable operators are built with internal `operate(init)`. It returns an `OperatorFunction` that creates its result through the source's versioned @@ -181,6 +239,28 @@ pass that callback through `operate`, so the two public forms share lifecycle, index, cancellation, and callback-error behavior without making either form delegate through the other's public API. +`takeOperator(count)` follows the same shared-callback pattern. For the broad +catalog experiment, generated typed facades delegate to the already-tested +exact-Symbol implementation in the same module. This is a branch-by- +abstraction seam: overloads and runtime behavior stay aligned while both +surfaces are evaluated. A generator preserves every overload and emits the +root, pipeable, static, and Symbol inventories; a `--check` fitness gate fails +when the catalog and generated surface drift. + +The delegation means importing the complete root currently installs the +shared exact-Symbol implementations. That is materially different from the +small pilot's root-isolation property and can increase side effects and bundle +retention. It is recorded as experiment evidence, not silently treated as a +free consequence of familiar syntax. + +The existing Webpack release fixture makes that cost concrete: its production +bundle grows from the accepted 22,000-byte ceiling to 64,874 bytes when it +consumes the experimental root. The failure is expected evidence for this +branch, not a proposed budget increase. Focused `rxjs/pipeable/*` paths remain +available for bounded graphs, but the root cannot ship in this form unless the +shared implementations are separated from exact-Symbol installation or the +maintainer explicitly accepts the retention cost. + ## First maintainer review The first review approved continued work with four API corrections: @@ -197,19 +277,18 @@ used by both the pipeable and exact-Symbol forms, beginning with `mapOperator`. This resolves the implementation-sharing question for the next pilot slice; it does not yet settle the package-path move for the complete catalog. -## Review gates before expanding the catalog +## Review gates after the catalog expansion -The pilot intentionally leaves these decisions open: +The complete implementation leaves these decisions open: -1. Whether pipeable deep imports should be `rxjs/map` and Symbols should be a - `rxjs/symbol` barrel, per-operator `rxjs/symbol/map` paths, or both. +1. Whether ordinary `rxjs/map` paths should switch to functions now that both + the `rxjs/pipeable` and `rxjs/symbol` barrel/per-capability layouts exist. 2. Whether nine transformations is the right overload horizon and which representative projects should supply type-check performance evidence. 3. Whether `operate` remains internal or becomes an advanced public API. -4. Whether the Observable-returning `toArray` and live AbortSignal-backed lite - `subscribe` contracts should become accepted public APIs after the pilot. - -The first implementation has now been reviewed. The next slice may add only a -small representative set covering an ordinary operator, an -Observable-returning terminal consumer, and the optional lite subscription -facade before returning for another review. +4. Whether the Observable-returning `toArray`, live AbortSignal-backed lite + `subscribe`, and generated Symbol-delegation seam should become accepted + public architecture after the experiment. +5. Whether root-import side effects and bundle retention are acceptable, or + shared implementations must be split from Symbol installation before the + pipeable surface can ship. diff --git a/packages/rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md b/packages/rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md index 65d891bd60..732d0f0ea7 100644 --- a/packages/rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md +++ b/packages/rxjs/docs/UNSUPPORTED_RXJS_7_SURFACES.md @@ -24,15 +24,15 @@ Regenerate it with `pnpm --filter rxjs run test:unit:unsupported:generate`; the ## Imports and package paths -| RxJS 7 surface | Disposition | Migration direction | Why | Decisions | -| ------------------------------------------------------------------------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | -------------------------- | -| `rxjs/operators`
`root-imported operator functions`
`source.pipe(...)` | Replace | Use exact Symbols for the complete reviewed catalog. The D-060 pilot also offers root rx composition for its small reviewed operator subset. | RxJS Next does not preserve the complete RxJS 7 pipeable-function catalog or the string-named .pipe surface. | D-003, D-039, D-050, D-060 | -| `rxjs:Observable`
`rxjs:Subscriber` | Replace | Use the active realm's ambient Observable and Subscriber after @rxjs/observable-polyfill initialization when needed. | The platform owns these constructors; the rxjs root does not re-export compatibility classes for them. | D-039, D-040, D-041 | -| `rxjs/testing`
`TestScheduler`
`VirtualTimeScheduler`
`VirtualAction` | Replace | Use @rxjs/test rxTest() and its explicit cold(), hot(), observable(), virtual host-time, and assertion helpers. | The public scheduler classes and manual TestScheduler mode are not part of the Next runtime or test contract. | D-012, D-033, D-039 | -| `rxjs/ajax`
`rxjs/fetch`
`rxjs/webSocket`
`ajax`
`fromFetch`
`webSocket`
`WebSocketSubject` | Manual Review | Use platform fetch, XMLHttpRequest, WebSocket, EventTarget.when, or an application adapter selected for the required cancellation and sharing contract. | RxJS Next does not currently publish the RxJS 7 DOM specialty packages or their wrapper types. | D-039, D-040 | -| `rxjs/internal/*`
`rxjs/src/*`
`unexported package paths` | Unsupported | Replace with an accepted public Next subpath or application-owned code after semantic review. | RxJS 7 internals are not preserved as public package contracts and must not be revived to satisfy migration tests. | D-039, D-040 | -| `bindCallback`
`bindNodeCallback`
`scheduled`
`using`
`isObservable` | Manual Review | Wrap callback or resource ownership explicitly with Observable and AbortSignal; use platform conversion or capability-specific mappings where applicable. | No accepted public Next function preserves these RxJS 7 imports and complete overload contracts. | D-039, D-040, D-049 | -| `ObjectUnsubscribedError`
`UnsubscriptionError` | Unsupported | Use platform error and AbortSignal reason handling or an application-owned aggregate error contract. | These errors belong to removed RxJS 7 Subscription and closed-Subject internals. | D-039, D-040 | +| RxJS 7 surface | Disposition | Migration direction | Why | Decisions | +| ------------------------------------------------------------------------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | +| `rxjs/operators`
`root-imported operator functions`
`source.pipe(...)` | Replace | Use exact Symbols for the accepted migration target, or review the D-060 root rx and complete functional experiment capability by capability. | The experiment provides functions for the current Next catalog, but does not preserve rxjs/operators, the string-named .pipe surface, removed aliases, or RxJS 7 lifecycle semantics. | D-003, D-039, D-050, D-060 | +| `rxjs:Observable`
`rxjs:Subscriber` | Replace | Use the active realm's ambient Observable and Subscriber after @rxjs/observable-polyfill initialization when needed. | The platform owns these constructors; the rxjs root does not re-export compatibility classes for them. | D-039, D-040, D-041 | +| `rxjs/testing`
`TestScheduler`
`VirtualTimeScheduler`
`VirtualAction` | Replace | Use @rxjs/test rxTest() and its explicit cold(), hot(), observable(), virtual host-time, and assertion helpers. | The public scheduler classes and manual TestScheduler mode are not part of the Next runtime or test contract. | D-012, D-033, D-039 | +| `rxjs/ajax`
`rxjs/fetch`
`rxjs/webSocket`
`ajax`
`fromFetch`
`webSocket`
`WebSocketSubject` | Manual Review | Use platform fetch, XMLHttpRequest, WebSocket, EventTarget.when, or an application adapter selected for the required cancellation and sharing contract. | RxJS Next does not currently publish the RxJS 7 DOM specialty packages or their wrapper types. | D-039, D-040 | +| `rxjs/internal/*`
`rxjs/src/*`
`unexported package paths` | Unsupported | Replace with an accepted public Next subpath or application-owned code after semantic review. | RxJS 7 internals are not preserved as public package contracts and must not be revived to satisfy migration tests. | D-039, D-040 | +| `bindCallback`
`bindNodeCallback`
`scheduled`
`using`
`isObservable` | Manual Review | Wrap callback or resource ownership explicitly with Observable and AbortSignal; use platform conversion or capability-specific mappings where applicable. | No accepted public Next function preserves these RxJS 7 imports and complete overload contracts. | D-039, D-040, D-049 | +| `ObjectUnsubscribedError`
`UnsubscriptionError` | Unsupported | Use platform error and AbortSignal reason handling or an application-owned aggregate error contract. | These errors belong to removed RxJS 7 Subscription and closed-Subject internals. | D-039, D-040 | ## Types @@ -64,15 +64,15 @@ Regenerate it with `pnpm --filter rxjs run test:unit:unsupported:generate`; the ## Deprecated and removed aliases -| RxJS 7 surface | Disposition | Migration direction | Why | Decisions | -| --------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------- | -| `combineAll`
`exhaust`
`flatMap`
`pipeable partition` | Replace | Use combineLatestAll, exhaustMap(identity), mergeMap, or Observable[partition] respectively. | The deprecated RxJS 7 names are not public Next Symbol identities; migration uses their canonical accepted mappings. | D-003, D-039, D-049 | -| `empty()`
`never()` | Replace | Use EMPTY and NEVER. | The deprecated creation functions are not retained as callable Next aliases. | D-039, D-040 | -| `mapTo`
`concatMapTo`
`mergeMapTo`
`switchMapTo`
`pluck` | Replace | Use map with a constant or property projection, or the corresponding canonical flattening Symbol with an explicit projection. | Migration may preserve behavior through exact mappings, but the deprecated pipeable function/import shape is not supported. | D-003, D-039 | -| `pipeable combineLatest`
`pipeable concat`
`pipeable merge`
`pipeable race`
`pipeable zip`
`onErrorResumeNextWith` | Replace | Use the accepted unified or With-form exact Symbol and its documented source-array/result-selector mapping. | Legacy pipeable aliases are migration inputs, not preserved function exports. | D-003, D-039, D-049 | -| `multicast`
`publish`
`publishBehavior`
`publishLast`
`publishReplay`
`refCount` | Manual Review | Prefer share, shareReplay, connect, or connectable with an explicit connector/reset contract; exact legacy-named Symbols remain migration evidence, not a compatibility promise. | Producer sharing, replay, reset, and ref-count semantics require explicit lifecycle review. | D-035, D-039, D-049 | -| `new BehaviorSubject(value)`
`new ReplaySubject(size, windowTime, scheduler)`
`ColdSubject` | Replace | Use behaviorSubject(value), replaySubject({ size, maxAge }), or the advanced PerSubscriptionSubjectBase only for a justified custom hot Subject. | D-050 stabilizes lowercase factories and removes the misleading ColdSubject name without aliases. | D-035, D-036, D-050 | -| `eachValueFrom`
`bufferedValuesFrom` | Replace | Use one of iterateEachValue, iterateBufferedValues, iterateLatestValue, or iterateNextValue from its exact Symbol subpath. | The exploratory standalone helpers were removed so buffering and dropping policy stays explicit. | D-038, D-039 | +| RxJS 7 surface | Disposition | Migration direction | Why | Decisions | +| --------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------- | +| `combineAll`
`exhaust`
`flatMap`
`pipeable partition` | Replace | Use combineLatestAll, exhaustMap(identity), mergeMap, or Observable[partition] respectively. | The deprecated RxJS 7 names are not public Next Symbol identities; migration uses their canonical accepted mappings. | D-003, D-039, D-049 | +| `empty()`
`never()` | Replace | Use EMPTY and NEVER. | The deprecated creation functions are not retained as callable Next aliases. | D-039, D-040 | +| `mapTo`
`concatMapTo`
`mergeMapTo`
`switchMapTo`
`pluck` | Replace | Use the root map, mergeMap, switchMap, or pluck function with an explicit projection, or use the corresponding exact Symbol. | The deprecated \*To names are not restored; the canonical Next function and Symbol names remain lifecycle-reviewed mappings. | D-003, D-039 | +| `pipeable combineLatest`
`pipeable concat`
`pipeable merge`
`pipeable race`
`pipeable zip`
`onErrorResumeNextWith` | Replace | Use combineLatestWith, concatWith, mergeWith, raceWith, zipWith, or onErrorResumeNextWith from the root functional experiment, or the corresponding accepted exact Symbol. | The functional names exist, but their Next source-array and lifecycle contracts are not a claim of unchanged RxJS 7 overloads or behavior. | D-003, D-039, D-049 | +| `multicast`
`publish`
`publishBehavior`
`publishLast`
`publishReplay`
`refCount` | Manual Review | Prefer share, shareReplay, connect, or connectable with an explicit connector/reset contract; exact legacy-named Symbols remain migration evidence, not a compatibility promise. | Producer sharing, replay, reset, and ref-count semantics require explicit lifecycle review. | D-035, D-039, D-049 | +| `new BehaviorSubject(value)`
`new ReplaySubject(size, windowTime, scheduler)`
`ColdSubject` | Replace | Use behaviorSubject(value), replaySubject({ size, maxAge }), or the advanced PerSubscriptionSubjectBase only for a justified custom hot Subject. | D-050 stabilizes lowercase factories and removes the misleading ColdSubject name without aliases. | D-035, D-036, D-050 | +| `eachValueFrom`
`bufferedValuesFrom` | Replace | Use the root iterateEachValue, iterateBufferedValues, iterateLatestValue, or iterateNextValue terminal, or its exact Symbol form. | The exploratory standalone helpers were removed so buffering and dropping policy stays explicit. | D-038, D-039 | ## Review rule diff --git a/packages/rxjs/package.json b/packages/rxjs/package.json index 47ea1d208e..0c1ed0d43f 100644 --- a/packages/rxjs/package.json +++ b/packages/rxjs/package.json @@ -36,8 +36,9 @@ "test:unit:report": "node test/ported/report.mjs", "test:unit:failures:generate": "node test/ported/tools/generate-failure-tracker.mjs", "test:imports": "node test/import/esm.mjs && node test/import/commonjs.cjs && node test/import/fixtures.mjs && node test/import/bundler.mjs", + "test:functional-surface": "node ../../scripts/generate-pipeable-surface.mjs --check", "test:kernel": "pnpm --filter @rxjs/observable-polyfill build && pnpm run build && node test/kernel/run.mjs", - "test:package": "pnpm run build && pnpm run test:types && pnpm run test:migration-contracts && pnpm run test:installations && pnpm run test:imports", + "test:package": "pnpm run build && pnpm run test:functional-surface && pnpm run test:types && pnpm run test:migration-contracts && pnpm run test:installations && pnpm run test:imports", "test:installations": "node test/import/check-extension-installs.mjs", "test:types": "tsc -p test/types/tsconfig.json --noEmit", "test:unit:parity:generate": "node test/ported/tools/generate-parity-doc.mjs", @@ -86,7 +87,6 @@ "src/**/*.spec.ts" ], "exports": { - "./package.json": "./package.json", ".": "./src/index.ts", "./animation-frames": "./src/animation-frames.ts", "./argument-out-of-range-error": "./src/argument-out-of-range-error.ts", @@ -100,7 +100,10 @@ "./combine": "./src/combine.ts", "./combine-latest": "./src/combine-latest.ts", "./combine-latest-all": "./src/combine-latest-all.ts", + "./combine-latest-with": "./src/pipeable/combine-latest-with.ts", + "./combine-with": "./src/pipeable/combine-with.ts", "./concat": "./src/concat.ts", + "./concat-with": "./src/pipeable/concat-with.ts", "./connect": "./src/connect.ts", "./connectable": "./src/connectable.ts", "./count": "./src/count.ts", @@ -142,6 +145,7 @@ "./merge": "./src/merge.ts", "./merge-map": "./src/merge-map.ts", "./merge-scan": "./src/merge-scan.ts", + "./merge-with": "./src/pipeable/merge-with.ts", "./min": "./src/min.ts", "./multicast": "./src/multicast.ts", "./never": "./src/never.ts", @@ -150,21 +154,113 @@ "./notification": "./src/notification.ts", "./observe-on": "./src/observe-on.ts", "./on-error-resume-next": "./src/on-error-resume-next.ts", + "./on-error-resume-next-with": "./src/pipeable/on-error-resume-next-with.ts", + "./package.json": "./package.json", "./pairwise": "./src/pairwise.ts", "./partition": "./src/partition.ts", "./per-subscription-subject-base": "./src/per-subscription-subject-base.ts", "./pipe": "./src/pipe.ts", + "./pipeable": "./src/pipeable/index.ts", + "./pipeable/buffer": "./src/pipeable/buffer.ts", + "./pipeable/buffer-time": "./src/pipeable/buffer-time.ts", + "./pipeable/buffer-toggle": "./src/pipeable/buffer-toggle.ts", + "./pipeable/catch-error": "./src/pipeable/catch-error.ts", + "./pipeable/combine-latest-all": "./src/pipeable/combine-latest-all.ts", + "./pipeable/combine-latest-with": "./src/pipeable/combine-latest-with.ts", + "./pipeable/combine-with": "./src/pipeable/combine-with.ts", + "./pipeable/concat-with": "./src/pipeable/concat-with.ts", + "./pipeable/connect": "./src/pipeable/connect.ts", + "./pipeable/count": "./src/pipeable/count.ts", + "./pipeable/debounce": "./src/pipeable/debounce.ts", + "./pipeable/default-if-empty": "./src/pipeable/default-if-empty.ts", + "./pipeable/delay": "./src/pipeable/delay.ts", + "./pipeable/delay-when": "./src/pipeable/delay-when.ts", + "./pipeable/dematerialize": "./src/pipeable/dematerialize.ts", + "./pipeable/distinct": "./src/pipeable/distinct.ts", + "./pipeable/distinct-until-changed": "./src/pipeable/distinct-until-changed.ts", + "./pipeable/distinct-until-key-changed": "./src/pipeable/distinct-until-key-changed.ts", + "./pipeable/element-at": "./src/pipeable/element-at.ts", + "./pipeable/every": "./src/pipeable/every.ts", + "./pipeable/exhaust-map": "./src/pipeable/exhaust-map.ts", + "./pipeable/expand": "./src/pipeable/expand.ts", "./pipeable/filter": "./src/pipeable/filter.ts", + "./pipeable/finalize": "./src/pipeable/finalize.ts", + "./pipeable/find": "./src/pipeable/find.ts", + "./pipeable/find-index": "./src/pipeable/find-index.ts", + "./pipeable/first": "./src/pipeable/first.ts", + "./pipeable/group-by": "./src/pipeable/group-by.ts", + "./pipeable/is-empty": "./src/pipeable/is-empty.ts", + "./pipeable/iterate-buffered-values": "./src/pipeable/iterate-buffered-values.ts", + "./pipeable/iterate-each-value": "./src/pipeable/iterate-each-value.ts", + "./pipeable/iterate-latest-value": "./src/pipeable/iterate-latest-value.ts", + "./pipeable/iterate-next-value": "./src/pipeable/iterate-next-value.ts", + "./pipeable/last": "./src/pipeable/last.ts", "./pipeable/map": "./src/pipeable/map.ts", + "./pipeable/materialize": "./src/pipeable/materialize.ts", + "./pipeable/max": "./src/pipeable/max.ts", + "./pipeable/merge-map": "./src/pipeable/merge-map.ts", + "./pipeable/merge-scan": "./src/pipeable/merge-scan.ts", + "./pipeable/merge-with": "./src/pipeable/merge-with.ts", + "./pipeable/min": "./src/pipeable/min.ts", + "./pipeable/multicast": "./src/pipeable/multicast.ts", + "./pipeable/observe-on": "./src/pipeable/observe-on.ts", + "./pipeable/on-error-resume-next-with": "./src/pipeable/on-error-resume-next-with.ts", + "./pipeable/pairwise": "./src/pipeable/pairwise.ts", + "./pipeable/pipe": "./src/pipeable/pipe.ts", + "./pipeable/pluck": "./src/pipeable/pluck.ts", + "./pipeable/publish": "./src/pipeable/publish.ts", + "./pipeable/publish-behavior": "./src/pipeable/publish-behavior.ts", + "./pipeable/publish-last": "./src/pipeable/publish-last.ts", + "./pipeable/publish-replay": "./src/pipeable/publish-replay.ts", + "./pipeable/race-with": "./src/pipeable/race-with.ts", + "./pipeable/reduce": "./src/pipeable/reduce.ts", + "./pipeable/ref-count": "./src/pipeable/ref-count.ts", + "./pipeable/repeat": "./src/pipeable/repeat.ts", + "./pipeable/repeat-when": "./src/pipeable/repeat-when.ts", + "./pipeable/retry": "./src/pipeable/retry.ts", + "./pipeable/retry-when": "./src/pipeable/retry-when.ts", + "./pipeable/sample": "./src/pipeable/sample.ts", + "./pipeable/sample-time": "./src/pipeable/sample-time.ts", + "./pipeable/scan": "./src/pipeable/scan.ts", + "./pipeable/sequence-equal": "./src/pipeable/sequence-equal.ts", + "./pipeable/share": "./src/pipeable/share.ts", + "./pipeable/share-replay": "./src/pipeable/share-replay.ts", + "./pipeable/single": "./src/pipeable/single.ts", + "./pipeable/skip": "./src/pipeable/skip.ts", + "./pipeable/skip-last": "./src/pipeable/skip-last.ts", + "./pipeable/skip-until": "./src/pipeable/skip-until.ts", + "./pipeable/skip-while": "./src/pipeable/skip-while.ts", + "./pipeable/start-with": "./src/pipeable/start-with.ts", "./pipeable/subscribe": "./src/pipeable/subscribe.ts", + "./pipeable/subscribe-on": "./src/pipeable/subscribe-on.ts", + "./pipeable/switch-map": "./src/pipeable/switch-map.ts", + "./pipeable/switch-scan": "./src/pipeable/switch-scan.ts", "./pipeable/take": "./src/pipeable/take.ts", + "./pipeable/take-last": "./src/pipeable/take-last.ts", + "./pipeable/take-until": "./src/pipeable/take-until.ts", + "./pipeable/take-while": "./src/pipeable/take-while.ts", + "./pipeable/tap": "./src/pipeable/tap.ts", + "./pipeable/throttle": "./src/pipeable/throttle.ts", + "./pipeable/throw-if-empty": "./src/pipeable/throw-if-empty.ts", + "./pipeable/time-interval": "./src/pipeable/time-interval.ts", + "./pipeable/timeout": "./src/pipeable/timeout.ts", + "./pipeable/timestamp": "./src/pipeable/timestamp.ts", "./pipeable/to-array": "./src/pipeable/to-array.ts", + "./pipeable/window": "./src/pipeable/window.ts", + "./pipeable/window-count": "./src/pipeable/window-count.ts", + "./pipeable/window-time": "./src/pipeable/window-time.ts", + "./pipeable/window-toggle": "./src/pipeable/window-toggle.ts", + "./pipeable/window-when": "./src/pipeable/window-when.ts", + "./pipeable/with-latest-from": "./src/pipeable/with-latest-from.ts", + "./pipeable/zip-all": "./src/pipeable/zip-all.ts", + "./pipeable/zip-with": "./src/pipeable/zip-with.ts", "./pluck": "./src/pluck.ts", "./publish": "./src/publish.ts", "./publish-behavior": "./src/publish-behavior.ts", "./publish-last": "./src/publish-last.ts", "./publish-replay": "./src/publish-replay.ts", "./race": "./src/race.ts", + "./race-with": "./src/pipeable/race-with.ts", "./reduce": "./src/reduce.ts", "./ref-count": "./src/ref-count.ts", "./repeat": "./src/repeat.ts", @@ -186,14 +282,123 @@ "./skip-until": "./src/skip-until.ts", "./skip-while": "./src/skip-while.ts", "./start-with": "./src/start-with.ts", + "./static": "./src/static/index.ts", + "./static/animation-frames": "./src/static/animation-frames.ts", + "./static/combine": "./src/static/combine.ts", + "./static/combine-latest": "./src/static/combine-latest.ts", + "./static/concat": "./src/static/concat.ts", + "./static/fork-join": "./src/static/fork-join.ts", + "./static/generate": "./src/static/generate.ts", + "./static/interval": "./src/static/interval.ts", + "./static/merge": "./src/static/merge.ts", + "./static/on-error-resume-next": "./src/static/on-error-resume-next.ts", + "./static/partition": "./src/static/partition.ts", + "./static/race": "./src/static/race.ts", + "./static/timer": "./src/static/timer.ts", "./subject": "./src/subject.ts", "./subscribe": "./src/pipeable/subscribe.ts", "./subscribe-on": "./src/subscribe-on.ts", - "./symbol/filter": "./src/filter.ts", - "./symbol/map": "./src/map.ts", - "./symbol/take": "./src/take.ts", "./switch-map": "./src/switch-map.ts", "./switch-scan": "./src/switch-scan.ts", + "./symbol": "./src/symbol/index.ts", + "./symbol/animation-frames": "./src/symbol/animation-frames.ts", + "./symbol/buffer": "./src/symbol/buffer.ts", + "./symbol/buffer-time": "./src/symbol/buffer-time.ts", + "./symbol/buffer-toggle": "./src/symbol/buffer-toggle.ts", + "./symbol/catch-error": "./src/symbol/catch-error.ts", + "./symbol/combine": "./src/symbol/combine.ts", + "./symbol/combine-latest": "./src/symbol/combine-latest.ts", + "./symbol/combine-latest-all": "./src/symbol/combine-latest-all.ts", + "./symbol/concat": "./src/symbol/concat.ts", + "./symbol/connect": "./src/symbol/connect.ts", + "./symbol/count": "./src/symbol/count.ts", + "./symbol/create": "./src/symbol/create.ts", + "./symbol/debounce": "./src/symbol/debounce.ts", + "./symbol/default-if-empty": "./src/symbol/default-if-empty.ts", + "./symbol/delay": "./src/symbol/delay.ts", + "./symbol/delay-when": "./src/symbol/delay-when.ts", + "./symbol/dematerialize": "./src/symbol/dematerialize.ts", + "./symbol/distinct": "./src/symbol/distinct.ts", + "./symbol/distinct-until-changed": "./src/symbol/distinct-until-changed.ts", + "./symbol/distinct-until-key-changed": "./src/symbol/distinct-until-key-changed.ts", + "./symbol/element-at": "./src/symbol/element-at.ts", + "./symbol/every": "./src/symbol/every.ts", + "./symbol/exhaust-map": "./src/symbol/exhaust-map.ts", + "./symbol/expand": "./src/symbol/expand.ts", + "./symbol/filter": "./src/symbol/filter.ts", + "./symbol/finalize": "./src/symbol/finalize.ts", + "./symbol/find": "./src/symbol/find.ts", + "./symbol/find-index": "./src/symbol/find-index.ts", + "./symbol/first": "./src/symbol/first.ts", + "./symbol/fork-join": "./src/symbol/fork-join.ts", + "./symbol/generate": "./src/symbol/generate.ts", + "./symbol/group-by": "./src/symbol/group-by.ts", + "./symbol/interval": "./src/symbol/interval.ts", + "./symbol/is-empty": "./src/symbol/is-empty.ts", + "./symbol/iterate-buffered-values": "./src/symbol/iterate-buffered-values.ts", + "./symbol/iterate-each-value": "./src/symbol/iterate-each-value.ts", + "./symbol/iterate-latest-value": "./src/symbol/iterate-latest-value.ts", + "./symbol/iterate-next-value": "./src/symbol/iterate-next-value.ts", + "./symbol/last": "./src/symbol/last.ts", + "./symbol/map": "./src/symbol/map.ts", + "./symbol/materialize": "./src/symbol/materialize.ts", + "./symbol/max": "./src/symbol/max.ts", + "./symbol/merge": "./src/symbol/merge.ts", + "./symbol/merge-map": "./src/symbol/merge-map.ts", + "./symbol/merge-scan": "./src/symbol/merge-scan.ts", + "./symbol/min": "./src/symbol/min.ts", + "./symbol/multicast": "./src/symbol/multicast.ts", + "./symbol/observe-on": "./src/symbol/observe-on.ts", + "./symbol/on-error-resume-next": "./src/symbol/on-error-resume-next.ts", + "./symbol/pairwise": "./src/symbol/pairwise.ts", + "./symbol/partition": "./src/symbol/partition.ts", + "./symbol/pipe": "./src/symbol/pipe.ts", + "./symbol/pluck": "./src/symbol/pluck.ts", + "./symbol/publish": "./src/symbol/publish.ts", + "./symbol/publish-behavior": "./src/symbol/publish-behavior.ts", + "./symbol/publish-last": "./src/symbol/publish-last.ts", + "./symbol/publish-replay": "./src/symbol/publish-replay.ts", + "./symbol/race": "./src/symbol/race.ts", + "./symbol/reduce": "./src/symbol/reduce.ts", + "./symbol/ref-count": "./src/symbol/ref-count.ts", + "./symbol/repeat": "./src/symbol/repeat.ts", + "./symbol/repeat-when": "./src/symbol/repeat-when.ts", + "./symbol/retry": "./src/symbol/retry.ts", + "./symbol/retry-when": "./src/symbol/retry-when.ts", + "./symbol/sample": "./src/symbol/sample.ts", + "./symbol/sample-time": "./src/symbol/sample-time.ts", + "./symbol/scan": "./src/symbol/scan.ts", + "./symbol/sequence-equal": "./src/symbol/sequence-equal.ts", + "./symbol/share": "./src/symbol/share.ts", + "./symbol/share-replay": "./src/symbol/share-replay.ts", + "./symbol/single": "./src/symbol/single.ts", + "./symbol/skip": "./src/symbol/skip.ts", + "./symbol/skip-last": "./src/symbol/skip-last.ts", + "./symbol/skip-until": "./src/symbol/skip-until.ts", + "./symbol/skip-while": "./src/symbol/skip-while.ts", + "./symbol/start-with": "./src/symbol/start-with.ts", + "./symbol/subscribe-on": "./src/symbol/subscribe-on.ts", + "./symbol/switch-map": "./src/symbol/switch-map.ts", + "./symbol/switch-scan": "./src/symbol/switch-scan.ts", + "./symbol/take": "./src/symbol/take.ts", + "./symbol/take-last": "./src/symbol/take-last.ts", + "./symbol/take-until": "./src/symbol/take-until.ts", + "./symbol/take-while": "./src/symbol/take-while.ts", + "./symbol/tap": "./src/symbol/tap.ts", + "./symbol/throttle": "./src/symbol/throttle.ts", + "./symbol/throw-if-empty": "./src/symbol/throw-if-empty.ts", + "./symbol/time-interval": "./src/symbol/time-interval.ts", + "./symbol/timeout": "./src/symbol/timeout.ts", + "./symbol/timer": "./src/symbol/timer.ts", + "./symbol/timestamp": "./src/symbol/timestamp.ts", + "./symbol/window": "./src/symbol/window.ts", + "./symbol/window-count": "./src/symbol/window-count.ts", + "./symbol/window-time": "./src/symbol/window-time.ts", + "./symbol/window-toggle": "./src/symbol/window-toggle.ts", + "./symbol/window-when": "./src/symbol/window-when.ts", + "./symbol/with-latest-from": "./src/symbol/with-latest-from.ts", + "./symbol/zip-all": "./src/symbol/zip-all.ts", + "./symbol/zip-with": "./src/symbol/zip-with.ts", "./take": "./src/take.ts", "./take-last": "./src/take-last.ts", "./take-until": "./src/take-until.ts", @@ -219,7 +424,6 @@ } }, "exports": { - "./package.json": "./package.json", ".": { "browser": { "types": "./dist/esm/index.d.ts", @@ -454,6 +658,42 @@ "default": "./dist/esm/combine-latest-all.js" } }, + "./combine-latest-with": { + "browser": { + "types": "./dist/esm/pipeable/combine-latest-with.d.ts", + "default": "./dist/esm/pipeable/combine-latest-with.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/combine-latest-with.d.ts", + "default": "./dist/esm/pipeable/combine-latest-with.js" + }, + "import": { + "types": "./dist/esm/pipeable/combine-latest-with.d.ts", + "default": "./dist/esm/pipeable/combine-latest-with.js" + }, + "require": { + "types": "./dist/esm/pipeable/combine-latest-with.d.ts", + "default": "./dist/esm/pipeable/combine-latest-with.js" + } + }, + "./combine-with": { + "browser": { + "types": "./dist/esm/pipeable/combine-with.d.ts", + "default": "./dist/esm/pipeable/combine-with.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/combine-with.d.ts", + "default": "./dist/esm/pipeable/combine-with.js" + }, + "import": { + "types": "./dist/esm/pipeable/combine-with.d.ts", + "default": "./dist/esm/pipeable/combine-with.js" + }, + "require": { + "types": "./dist/esm/pipeable/combine-with.d.ts", + "default": "./dist/esm/pipeable/combine-with.js" + } + }, "./concat": { "browser": { "types": "./dist/esm/concat.d.ts", @@ -472,6 +712,24 @@ "default": "./dist/esm/concat.js" } }, + "./concat-with": { + "browser": { + "types": "./dist/esm/pipeable/concat-with.d.ts", + "default": "./dist/esm/pipeable/concat-with.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/concat-with.d.ts", + "default": "./dist/esm/pipeable/concat-with.js" + }, + "import": { + "types": "./dist/esm/pipeable/concat-with.d.ts", + "default": "./dist/esm/pipeable/concat-with.js" + }, + "require": { + "types": "./dist/esm/pipeable/concat-with.d.ts", + "default": "./dist/esm/pipeable/concat-with.js" + } + }, "./connect": { "browser": { "types": "./dist/esm/connect.d.ts", @@ -1210,6 +1468,24 @@ "default": "./dist/esm/merge-scan.js" } }, + "./merge-with": { + "browser": { + "types": "./dist/esm/pipeable/merge-with.d.ts", + "default": "./dist/esm/pipeable/merge-with.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/merge-with.d.ts", + "default": "./dist/esm/pipeable/merge-with.js" + }, + "import": { + "types": "./dist/esm/pipeable/merge-with.d.ts", + "default": "./dist/esm/pipeable/merge-with.js" + }, + "require": { + "types": "./dist/esm/pipeable/merge-with.d.ts", + "default": "./dist/esm/pipeable/merge-with.js" + } + }, "./min": { "browser": { "types": "./dist/esm/min.d.ts", @@ -1354,6 +1630,25 @@ "default": "./dist/esm/on-error-resume-next.js" } }, + "./on-error-resume-next-with": { + "browser": { + "types": "./dist/esm/pipeable/on-error-resume-next-with.d.ts", + "default": "./dist/esm/pipeable/on-error-resume-next-with.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/on-error-resume-next-with.d.ts", + "default": "./dist/esm/pipeable/on-error-resume-next-with.js" + }, + "import": { + "types": "./dist/esm/pipeable/on-error-resume-next-with.d.ts", + "default": "./dist/esm/pipeable/on-error-resume-next-with.js" + }, + "require": { + "types": "./dist/esm/pipeable/on-error-resume-next-with.d.ts", + "default": "./dist/esm/pipeable/on-error-resume-next-with.js" + } + }, + "./package.json": "./package.json", "./pairwise": { "browser": { "types": "./dist/esm/pairwise.d.ts", @@ -1426,724 +1721,4306 @@ "default": "./dist/esm/pipe.js" } }, - "./pipeable/filter": { + "./pipeable": { "browser": { - "types": "./dist/esm/pipeable/filter.d.ts", - "default": "./dist/esm/pipeable/filter.js" + "types": "./dist/esm/pipeable/index.d.ts", + "default": "./dist/esm/pipeable/index.js" }, "webpack": { - "types": "./dist/esm/pipeable/filter.d.ts", - "default": "./dist/esm/pipeable/filter.js" + "types": "./dist/esm/pipeable/index.d.ts", + "default": "./dist/esm/pipeable/index.js" }, "import": { - "types": "./dist/esm/pipeable/filter.d.ts", - "default": "./dist/esm/pipeable/filter.js" + "types": "./dist/esm/pipeable/index.d.ts", + "default": "./dist/esm/pipeable/index.js" }, "require": { - "types": "./dist/esm/pipeable/filter.d.ts", - "default": "./dist/esm/pipeable/filter.js" + "types": "./dist/esm/pipeable/index.d.ts", + "default": "./dist/esm/pipeable/index.js" } }, - "./pipeable/map": { + "./pipeable/buffer": { "browser": { - "types": "./dist/esm/pipeable/map.d.ts", - "default": "./dist/esm/pipeable/map.js" + "types": "./dist/esm/pipeable/buffer.d.ts", + "default": "./dist/esm/pipeable/buffer.js" }, "webpack": { - "types": "./dist/esm/pipeable/map.d.ts", - "default": "./dist/esm/pipeable/map.js" + "types": "./dist/esm/pipeable/buffer.d.ts", + "default": "./dist/esm/pipeable/buffer.js" }, "import": { - "types": "./dist/esm/pipeable/map.d.ts", - "default": "./dist/esm/pipeable/map.js" + "types": "./dist/esm/pipeable/buffer.d.ts", + "default": "./dist/esm/pipeable/buffer.js" }, "require": { - "types": "./dist/esm/pipeable/map.d.ts", - "default": "./dist/esm/pipeable/map.js" + "types": "./dist/esm/pipeable/buffer.d.ts", + "default": "./dist/esm/pipeable/buffer.js" } }, - "./pipeable/subscribe": { + "./pipeable/buffer-time": { "browser": { - "types": "./dist/esm/pipeable/subscribe.d.ts", - "default": "./dist/esm/pipeable/subscribe.js" + "types": "./dist/esm/pipeable/buffer-time.d.ts", + "default": "./dist/esm/pipeable/buffer-time.js" }, "webpack": { - "types": "./dist/esm/pipeable/subscribe.d.ts", - "default": "./dist/esm/pipeable/subscribe.js" + "types": "./dist/esm/pipeable/buffer-time.d.ts", + "default": "./dist/esm/pipeable/buffer-time.js" }, "import": { - "types": "./dist/esm/pipeable/subscribe.d.ts", - "default": "./dist/esm/pipeable/subscribe.js" + "types": "./dist/esm/pipeable/buffer-time.d.ts", + "default": "./dist/esm/pipeable/buffer-time.js" }, "require": { - "types": "./dist/esm/pipeable/subscribe.d.ts", - "default": "./dist/esm/pipeable/subscribe.js" + "types": "./dist/esm/pipeable/buffer-time.d.ts", + "default": "./dist/esm/pipeable/buffer-time.js" } }, - "./pipeable/take": { + "./pipeable/buffer-toggle": { "browser": { - "types": "./dist/esm/pipeable/take.d.ts", - "default": "./dist/esm/pipeable/take.js" + "types": "./dist/esm/pipeable/buffer-toggle.d.ts", + "default": "./dist/esm/pipeable/buffer-toggle.js" }, "webpack": { - "types": "./dist/esm/pipeable/take.d.ts", - "default": "./dist/esm/pipeable/take.js" + "types": "./dist/esm/pipeable/buffer-toggle.d.ts", + "default": "./dist/esm/pipeable/buffer-toggle.js" }, "import": { - "types": "./dist/esm/pipeable/take.d.ts", - "default": "./dist/esm/pipeable/take.js" + "types": "./dist/esm/pipeable/buffer-toggle.d.ts", + "default": "./dist/esm/pipeable/buffer-toggle.js" }, "require": { - "types": "./dist/esm/pipeable/take.d.ts", - "default": "./dist/esm/pipeable/take.js" + "types": "./dist/esm/pipeable/buffer-toggle.d.ts", + "default": "./dist/esm/pipeable/buffer-toggle.js" } }, - "./pipeable/to-array": { + "./pipeable/catch-error": { "browser": { - "types": "./dist/esm/pipeable/to-array.d.ts", - "default": "./dist/esm/pipeable/to-array.js" + "types": "./dist/esm/pipeable/catch-error.d.ts", + "default": "./dist/esm/pipeable/catch-error.js" }, "webpack": { - "types": "./dist/esm/pipeable/to-array.d.ts", - "default": "./dist/esm/pipeable/to-array.js" + "types": "./dist/esm/pipeable/catch-error.d.ts", + "default": "./dist/esm/pipeable/catch-error.js" }, "import": { - "types": "./dist/esm/pipeable/to-array.d.ts", - "default": "./dist/esm/pipeable/to-array.js" + "types": "./dist/esm/pipeable/catch-error.d.ts", + "default": "./dist/esm/pipeable/catch-error.js" }, "require": { - "types": "./dist/esm/pipeable/to-array.d.ts", - "default": "./dist/esm/pipeable/to-array.js" + "types": "./dist/esm/pipeable/catch-error.d.ts", + "default": "./dist/esm/pipeable/catch-error.js" } }, - "./pluck": { + "./pipeable/combine-latest-all": { "browser": { - "types": "./dist/esm/pluck.d.ts", - "default": "./dist/esm/pluck.js" + "types": "./dist/esm/pipeable/combine-latest-all.d.ts", + "default": "./dist/esm/pipeable/combine-latest-all.js" }, "webpack": { - "types": "./dist/esm/pluck.d.ts", - "default": "./dist/esm/pluck.js" + "types": "./dist/esm/pipeable/combine-latest-all.d.ts", + "default": "./dist/esm/pipeable/combine-latest-all.js" }, "import": { - "types": "./dist/esm/pluck.d.ts", - "default": "./dist/esm/pluck.js" + "types": "./dist/esm/pipeable/combine-latest-all.d.ts", + "default": "./dist/esm/pipeable/combine-latest-all.js" }, "require": { - "types": "./dist/esm/pluck.d.ts", - "default": "./dist/esm/pluck.js" + "types": "./dist/esm/pipeable/combine-latest-all.d.ts", + "default": "./dist/esm/pipeable/combine-latest-all.js" } }, - "./publish": { + "./pipeable/combine-latest-with": { "browser": { - "types": "./dist/esm/publish.d.ts", - "default": "./dist/esm/publish.js" + "types": "./dist/esm/pipeable/combine-latest-with.d.ts", + "default": "./dist/esm/pipeable/combine-latest-with.js" }, "webpack": { - "types": "./dist/esm/publish.d.ts", - "default": "./dist/esm/publish.js" + "types": "./dist/esm/pipeable/combine-latest-with.d.ts", + "default": "./dist/esm/pipeable/combine-latest-with.js" }, "import": { - "types": "./dist/esm/publish.d.ts", - "default": "./dist/esm/publish.js" + "types": "./dist/esm/pipeable/combine-latest-with.d.ts", + "default": "./dist/esm/pipeable/combine-latest-with.js" }, "require": { - "types": "./dist/esm/publish.d.ts", - "default": "./dist/esm/publish.js" + "types": "./dist/esm/pipeable/combine-latest-with.d.ts", + "default": "./dist/esm/pipeable/combine-latest-with.js" } }, - "./publish-behavior": { + "./pipeable/combine-with": { "browser": { - "types": "./dist/esm/publish-behavior.d.ts", - "default": "./dist/esm/publish-behavior.js" + "types": "./dist/esm/pipeable/combine-with.d.ts", + "default": "./dist/esm/pipeable/combine-with.js" }, "webpack": { - "types": "./dist/esm/publish-behavior.d.ts", - "default": "./dist/esm/publish-behavior.js" + "types": "./dist/esm/pipeable/combine-with.d.ts", + "default": "./dist/esm/pipeable/combine-with.js" }, "import": { - "types": "./dist/esm/publish-behavior.d.ts", - "default": "./dist/esm/publish-behavior.js" + "types": "./dist/esm/pipeable/combine-with.d.ts", + "default": "./dist/esm/pipeable/combine-with.js" }, "require": { - "types": "./dist/esm/publish-behavior.d.ts", - "default": "./dist/esm/publish-behavior.js" + "types": "./dist/esm/pipeable/combine-with.d.ts", + "default": "./dist/esm/pipeable/combine-with.js" } }, - "./publish-last": { + "./pipeable/concat-with": { "browser": { - "types": "./dist/esm/publish-last.d.ts", - "default": "./dist/esm/publish-last.js" + "types": "./dist/esm/pipeable/concat-with.d.ts", + "default": "./dist/esm/pipeable/concat-with.js" }, "webpack": { - "types": "./dist/esm/publish-last.d.ts", - "default": "./dist/esm/publish-last.js" + "types": "./dist/esm/pipeable/concat-with.d.ts", + "default": "./dist/esm/pipeable/concat-with.js" }, "import": { - "types": "./dist/esm/publish-last.d.ts", - "default": "./dist/esm/publish-last.js" + "types": "./dist/esm/pipeable/concat-with.d.ts", + "default": "./dist/esm/pipeable/concat-with.js" }, "require": { - "types": "./dist/esm/publish-last.d.ts", - "default": "./dist/esm/publish-last.js" + "types": "./dist/esm/pipeable/concat-with.d.ts", + "default": "./dist/esm/pipeable/concat-with.js" } }, - "./publish-replay": { + "./pipeable/connect": { "browser": { - "types": "./dist/esm/publish-replay.d.ts", - "default": "./dist/esm/publish-replay.js" + "types": "./dist/esm/pipeable/connect.d.ts", + "default": "./dist/esm/pipeable/connect.js" }, "webpack": { - "types": "./dist/esm/publish-replay.d.ts", - "default": "./dist/esm/publish-replay.js" + "types": "./dist/esm/pipeable/connect.d.ts", + "default": "./dist/esm/pipeable/connect.js" }, "import": { - "types": "./dist/esm/publish-replay.d.ts", - "default": "./dist/esm/publish-replay.js" + "types": "./dist/esm/pipeable/connect.d.ts", + "default": "./dist/esm/pipeable/connect.js" }, "require": { - "types": "./dist/esm/publish-replay.d.ts", - "default": "./dist/esm/publish-replay.js" + "types": "./dist/esm/pipeable/connect.d.ts", + "default": "./dist/esm/pipeable/connect.js" } }, - "./race": { + "./pipeable/count": { "browser": { - "types": "./dist/esm/race.d.ts", - "default": "./dist/esm/race.js" + "types": "./dist/esm/pipeable/count.d.ts", + "default": "./dist/esm/pipeable/count.js" }, "webpack": { - "types": "./dist/esm/race.d.ts", - "default": "./dist/esm/race.js" + "types": "./dist/esm/pipeable/count.d.ts", + "default": "./dist/esm/pipeable/count.js" }, "import": { - "types": "./dist/esm/race.d.ts", - "default": "./dist/esm/race.js" + "types": "./dist/esm/pipeable/count.d.ts", + "default": "./dist/esm/pipeable/count.js" }, "require": { - "types": "./dist/esm/race.d.ts", - "default": "./dist/esm/race.js" + "types": "./dist/esm/pipeable/count.d.ts", + "default": "./dist/esm/pipeable/count.js" } }, - "./reduce": { + "./pipeable/debounce": { "browser": { - "types": "./dist/esm/reduce.d.ts", - "default": "./dist/esm/reduce.js" + "types": "./dist/esm/pipeable/debounce.d.ts", + "default": "./dist/esm/pipeable/debounce.js" }, "webpack": { - "types": "./dist/esm/reduce.d.ts", - "default": "./dist/esm/reduce.js" + "types": "./dist/esm/pipeable/debounce.d.ts", + "default": "./dist/esm/pipeable/debounce.js" }, "import": { - "types": "./dist/esm/reduce.d.ts", - "default": "./dist/esm/reduce.js" + "types": "./dist/esm/pipeable/debounce.d.ts", + "default": "./dist/esm/pipeable/debounce.js" }, "require": { - "types": "./dist/esm/reduce.d.ts", - "default": "./dist/esm/reduce.js" + "types": "./dist/esm/pipeable/debounce.d.ts", + "default": "./dist/esm/pipeable/debounce.js" } }, - "./ref-count": { + "./pipeable/default-if-empty": { "browser": { - "types": "./dist/esm/ref-count.d.ts", - "default": "./dist/esm/ref-count.js" + "types": "./dist/esm/pipeable/default-if-empty.d.ts", + "default": "./dist/esm/pipeable/default-if-empty.js" }, "webpack": { - "types": "./dist/esm/ref-count.d.ts", - "default": "./dist/esm/ref-count.js" + "types": "./dist/esm/pipeable/default-if-empty.d.ts", + "default": "./dist/esm/pipeable/default-if-empty.js" }, "import": { - "types": "./dist/esm/ref-count.d.ts", - "default": "./dist/esm/ref-count.js" + "types": "./dist/esm/pipeable/default-if-empty.d.ts", + "default": "./dist/esm/pipeable/default-if-empty.js" }, "require": { - "types": "./dist/esm/ref-count.d.ts", - "default": "./dist/esm/ref-count.js" + "types": "./dist/esm/pipeable/default-if-empty.d.ts", + "default": "./dist/esm/pipeable/default-if-empty.js" } }, - "./repeat": { + "./pipeable/delay": { "browser": { - "types": "./dist/esm/repeat.d.ts", - "default": "./dist/esm/repeat.js" + "types": "./dist/esm/pipeable/delay.d.ts", + "default": "./dist/esm/pipeable/delay.js" }, "webpack": { - "types": "./dist/esm/repeat.d.ts", - "default": "./dist/esm/repeat.js" + "types": "./dist/esm/pipeable/delay.d.ts", + "default": "./dist/esm/pipeable/delay.js" }, "import": { - "types": "./dist/esm/repeat.d.ts", - "default": "./dist/esm/repeat.js" + "types": "./dist/esm/pipeable/delay.d.ts", + "default": "./dist/esm/pipeable/delay.js" }, "require": { - "types": "./dist/esm/repeat.d.ts", - "default": "./dist/esm/repeat.js" + "types": "./dist/esm/pipeable/delay.d.ts", + "default": "./dist/esm/pipeable/delay.js" } }, - "./repeat-when": { + "./pipeable/delay-when": { "browser": { - "types": "./dist/esm/repeat-when.d.ts", - "default": "./dist/esm/repeat-when.js" + "types": "./dist/esm/pipeable/delay-when.d.ts", + "default": "./dist/esm/pipeable/delay-when.js" }, "webpack": { - "types": "./dist/esm/repeat-when.d.ts", - "default": "./dist/esm/repeat-when.js" + "types": "./dist/esm/pipeable/delay-when.d.ts", + "default": "./dist/esm/pipeable/delay-when.js" }, "import": { - "types": "./dist/esm/repeat-when.d.ts", - "default": "./dist/esm/repeat-when.js" + "types": "./dist/esm/pipeable/delay-when.d.ts", + "default": "./dist/esm/pipeable/delay-when.js" }, "require": { - "types": "./dist/esm/repeat-when.d.ts", - "default": "./dist/esm/repeat-when.js" + "types": "./dist/esm/pipeable/delay-when.d.ts", + "default": "./dist/esm/pipeable/delay-when.js" } }, - "./replay-subject": { + "./pipeable/dematerialize": { "browser": { - "types": "./dist/esm/replay-subject.d.ts", - "default": "./dist/esm/replay-subject.js" + "types": "./dist/esm/pipeable/dematerialize.d.ts", + "default": "./dist/esm/pipeable/dematerialize.js" }, "webpack": { - "types": "./dist/esm/replay-subject.d.ts", - "default": "./dist/esm/replay-subject.js" + "types": "./dist/esm/pipeable/dematerialize.d.ts", + "default": "./dist/esm/pipeable/dematerialize.js" }, "import": { - "types": "./dist/esm/replay-subject.d.ts", - "default": "./dist/esm/replay-subject.js" + "types": "./dist/esm/pipeable/dematerialize.d.ts", + "default": "./dist/esm/pipeable/dematerialize.js" }, "require": { - "types": "./dist/esm/replay-subject.d.ts", - "default": "./dist/esm/replay-subject.js" + "types": "./dist/esm/pipeable/dematerialize.d.ts", + "default": "./dist/esm/pipeable/dematerialize.js" } }, - "./retry": { + "./pipeable/distinct": { "browser": { - "types": "./dist/esm/retry.d.ts", - "default": "./dist/esm/retry.js" + "types": "./dist/esm/pipeable/distinct.d.ts", + "default": "./dist/esm/pipeable/distinct.js" }, "webpack": { - "types": "./dist/esm/retry.d.ts", - "default": "./dist/esm/retry.js" + "types": "./dist/esm/pipeable/distinct.d.ts", + "default": "./dist/esm/pipeable/distinct.js" }, "import": { - "types": "./dist/esm/retry.d.ts", - "default": "./dist/esm/retry.js" + "types": "./dist/esm/pipeable/distinct.d.ts", + "default": "./dist/esm/pipeable/distinct.js" }, "require": { - "types": "./dist/esm/retry.d.ts", - "default": "./dist/esm/retry.js" + "types": "./dist/esm/pipeable/distinct.d.ts", + "default": "./dist/esm/pipeable/distinct.js" } }, - "./retry-when": { + "./pipeable/distinct-until-changed": { "browser": { - "types": "./dist/esm/retry-when.d.ts", - "default": "./dist/esm/retry-when.js" + "types": "./dist/esm/pipeable/distinct-until-changed.d.ts", + "default": "./dist/esm/pipeable/distinct-until-changed.js" }, "webpack": { - "types": "./dist/esm/retry-when.d.ts", - "default": "./dist/esm/retry-when.js" + "types": "./dist/esm/pipeable/distinct-until-changed.d.ts", + "default": "./dist/esm/pipeable/distinct-until-changed.js" }, "import": { - "types": "./dist/esm/retry-when.d.ts", - "default": "./dist/esm/retry-when.js" + "types": "./dist/esm/pipeable/distinct-until-changed.d.ts", + "default": "./dist/esm/pipeable/distinct-until-changed.js" }, "require": { - "types": "./dist/esm/retry-when.d.ts", - "default": "./dist/esm/retry-when.js" + "types": "./dist/esm/pipeable/distinct-until-changed.d.ts", + "default": "./dist/esm/pipeable/distinct-until-changed.js" } }, - "./rx": { + "./pipeable/distinct-until-key-changed": { "browser": { - "types": "./dist/esm/rx.d.ts", - "default": "./dist/esm/rx.js" + "types": "./dist/esm/pipeable/distinct-until-key-changed.d.ts", + "default": "./dist/esm/pipeable/distinct-until-key-changed.js" }, "webpack": { - "types": "./dist/esm/rx.d.ts", - "default": "./dist/esm/rx.js" + "types": "./dist/esm/pipeable/distinct-until-key-changed.d.ts", + "default": "./dist/esm/pipeable/distinct-until-key-changed.js" }, "import": { - "types": "./dist/esm/rx.d.ts", - "default": "./dist/esm/rx.js" + "types": "./dist/esm/pipeable/distinct-until-key-changed.d.ts", + "default": "./dist/esm/pipeable/distinct-until-key-changed.js" }, "require": { - "types": "./dist/esm/rx.d.ts", - "default": "./dist/esm/rx.js" + "types": "./dist/esm/pipeable/distinct-until-key-changed.d.ts", + "default": "./dist/esm/pipeable/distinct-until-key-changed.js" } }, - "./sample": { + "./pipeable/element-at": { "browser": { - "types": "./dist/esm/sample.d.ts", - "default": "./dist/esm/sample.js" + "types": "./dist/esm/pipeable/element-at.d.ts", + "default": "./dist/esm/pipeable/element-at.js" }, "webpack": { - "types": "./dist/esm/sample.d.ts", - "default": "./dist/esm/sample.js" + "types": "./dist/esm/pipeable/element-at.d.ts", + "default": "./dist/esm/pipeable/element-at.js" }, "import": { - "types": "./dist/esm/sample.d.ts", - "default": "./dist/esm/sample.js" + "types": "./dist/esm/pipeable/element-at.d.ts", + "default": "./dist/esm/pipeable/element-at.js" }, "require": { - "types": "./dist/esm/sample.d.ts", - "default": "./dist/esm/sample.js" + "types": "./dist/esm/pipeable/element-at.d.ts", + "default": "./dist/esm/pipeable/element-at.js" } }, - "./sample-time": { + "./pipeable/every": { "browser": { - "types": "./dist/esm/sample-time.d.ts", - "default": "./dist/esm/sample-time.js" + "types": "./dist/esm/pipeable/every.d.ts", + "default": "./dist/esm/pipeable/every.js" }, "webpack": { - "types": "./dist/esm/sample-time.d.ts", - "default": "./dist/esm/sample-time.js" + "types": "./dist/esm/pipeable/every.d.ts", + "default": "./dist/esm/pipeable/every.js" }, "import": { - "types": "./dist/esm/sample-time.d.ts", - "default": "./dist/esm/sample-time.js" + "types": "./dist/esm/pipeable/every.d.ts", + "default": "./dist/esm/pipeable/every.js" }, "require": { - "types": "./dist/esm/sample-time.d.ts", - "default": "./dist/esm/sample-time.js" + "types": "./dist/esm/pipeable/every.d.ts", + "default": "./dist/esm/pipeable/every.js" } }, - "./scan": { + "./pipeable/exhaust-map": { "browser": { - "types": "./dist/esm/scan.d.ts", - "default": "./dist/esm/scan.js" + "types": "./dist/esm/pipeable/exhaust-map.d.ts", + "default": "./dist/esm/pipeable/exhaust-map.js" }, "webpack": { - "types": "./dist/esm/scan.d.ts", - "default": "./dist/esm/scan.js" + "types": "./dist/esm/pipeable/exhaust-map.d.ts", + "default": "./dist/esm/pipeable/exhaust-map.js" }, "import": { - "types": "./dist/esm/scan.d.ts", - "default": "./dist/esm/scan.js" + "types": "./dist/esm/pipeable/exhaust-map.d.ts", + "default": "./dist/esm/pipeable/exhaust-map.js" }, "require": { - "types": "./dist/esm/scan.d.ts", - "default": "./dist/esm/scan.js" + "types": "./dist/esm/pipeable/exhaust-map.d.ts", + "default": "./dist/esm/pipeable/exhaust-map.js" } }, - "./sequence-equal": { + "./pipeable/expand": { "browser": { - "types": "./dist/esm/sequence-equal.d.ts", - "default": "./dist/esm/sequence-equal.js" + "types": "./dist/esm/pipeable/expand.d.ts", + "default": "./dist/esm/pipeable/expand.js" }, "webpack": { - "types": "./dist/esm/sequence-equal.d.ts", - "default": "./dist/esm/sequence-equal.js" + "types": "./dist/esm/pipeable/expand.d.ts", + "default": "./dist/esm/pipeable/expand.js" }, "import": { - "types": "./dist/esm/sequence-equal.d.ts", - "default": "./dist/esm/sequence-equal.js" + "types": "./dist/esm/pipeable/expand.d.ts", + "default": "./dist/esm/pipeable/expand.js" }, "require": { - "types": "./dist/esm/sequence-equal.d.ts", - "default": "./dist/esm/sequence-equal.js" + "types": "./dist/esm/pipeable/expand.d.ts", + "default": "./dist/esm/pipeable/expand.js" + } + }, + "./pipeable/filter": { + "browser": { + "types": "./dist/esm/pipeable/filter.d.ts", + "default": "./dist/esm/pipeable/filter.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/filter.d.ts", + "default": "./dist/esm/pipeable/filter.js" + }, + "import": { + "types": "./dist/esm/pipeable/filter.d.ts", + "default": "./dist/esm/pipeable/filter.js" + }, + "require": { + "types": "./dist/esm/pipeable/filter.d.ts", + "default": "./dist/esm/pipeable/filter.js" + } + }, + "./pipeable/finalize": { + "browser": { + "types": "./dist/esm/pipeable/finalize.d.ts", + "default": "./dist/esm/pipeable/finalize.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/finalize.d.ts", + "default": "./dist/esm/pipeable/finalize.js" + }, + "import": { + "types": "./dist/esm/pipeable/finalize.d.ts", + "default": "./dist/esm/pipeable/finalize.js" + }, + "require": { + "types": "./dist/esm/pipeable/finalize.d.ts", + "default": "./dist/esm/pipeable/finalize.js" + } + }, + "./pipeable/find": { + "browser": { + "types": "./dist/esm/pipeable/find.d.ts", + "default": "./dist/esm/pipeable/find.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/find.d.ts", + "default": "./dist/esm/pipeable/find.js" + }, + "import": { + "types": "./dist/esm/pipeable/find.d.ts", + "default": "./dist/esm/pipeable/find.js" + }, + "require": { + "types": "./dist/esm/pipeable/find.d.ts", + "default": "./dist/esm/pipeable/find.js" + } + }, + "./pipeable/find-index": { + "browser": { + "types": "./dist/esm/pipeable/find-index.d.ts", + "default": "./dist/esm/pipeable/find-index.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/find-index.d.ts", + "default": "./dist/esm/pipeable/find-index.js" + }, + "import": { + "types": "./dist/esm/pipeable/find-index.d.ts", + "default": "./dist/esm/pipeable/find-index.js" + }, + "require": { + "types": "./dist/esm/pipeable/find-index.d.ts", + "default": "./dist/esm/pipeable/find-index.js" + } + }, + "./pipeable/first": { + "browser": { + "types": "./dist/esm/pipeable/first.d.ts", + "default": "./dist/esm/pipeable/first.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/first.d.ts", + "default": "./dist/esm/pipeable/first.js" + }, + "import": { + "types": "./dist/esm/pipeable/first.d.ts", + "default": "./dist/esm/pipeable/first.js" + }, + "require": { + "types": "./dist/esm/pipeable/first.d.ts", + "default": "./dist/esm/pipeable/first.js" + } + }, + "./pipeable/group-by": { + "browser": { + "types": "./dist/esm/pipeable/group-by.d.ts", + "default": "./dist/esm/pipeable/group-by.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/group-by.d.ts", + "default": "./dist/esm/pipeable/group-by.js" + }, + "import": { + "types": "./dist/esm/pipeable/group-by.d.ts", + "default": "./dist/esm/pipeable/group-by.js" + }, + "require": { + "types": "./dist/esm/pipeable/group-by.d.ts", + "default": "./dist/esm/pipeable/group-by.js" + } + }, + "./pipeable/is-empty": { + "browser": { + "types": "./dist/esm/pipeable/is-empty.d.ts", + "default": "./dist/esm/pipeable/is-empty.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/is-empty.d.ts", + "default": "./dist/esm/pipeable/is-empty.js" + }, + "import": { + "types": "./dist/esm/pipeable/is-empty.d.ts", + "default": "./dist/esm/pipeable/is-empty.js" + }, + "require": { + "types": "./dist/esm/pipeable/is-empty.d.ts", + "default": "./dist/esm/pipeable/is-empty.js" + } + }, + "./pipeable/iterate-buffered-values": { + "browser": { + "types": "./dist/esm/pipeable/iterate-buffered-values.d.ts", + "default": "./dist/esm/pipeable/iterate-buffered-values.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/iterate-buffered-values.d.ts", + "default": "./dist/esm/pipeable/iterate-buffered-values.js" + }, + "import": { + "types": "./dist/esm/pipeable/iterate-buffered-values.d.ts", + "default": "./dist/esm/pipeable/iterate-buffered-values.js" + }, + "require": { + "types": "./dist/esm/pipeable/iterate-buffered-values.d.ts", + "default": "./dist/esm/pipeable/iterate-buffered-values.js" + } + }, + "./pipeable/iterate-each-value": { + "browser": { + "types": "./dist/esm/pipeable/iterate-each-value.d.ts", + "default": "./dist/esm/pipeable/iterate-each-value.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/iterate-each-value.d.ts", + "default": "./dist/esm/pipeable/iterate-each-value.js" + }, + "import": { + "types": "./dist/esm/pipeable/iterate-each-value.d.ts", + "default": "./dist/esm/pipeable/iterate-each-value.js" + }, + "require": { + "types": "./dist/esm/pipeable/iterate-each-value.d.ts", + "default": "./dist/esm/pipeable/iterate-each-value.js" + } + }, + "./pipeable/iterate-latest-value": { + "browser": { + "types": "./dist/esm/pipeable/iterate-latest-value.d.ts", + "default": "./dist/esm/pipeable/iterate-latest-value.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/iterate-latest-value.d.ts", + "default": "./dist/esm/pipeable/iterate-latest-value.js" + }, + "import": { + "types": "./dist/esm/pipeable/iterate-latest-value.d.ts", + "default": "./dist/esm/pipeable/iterate-latest-value.js" + }, + "require": { + "types": "./dist/esm/pipeable/iterate-latest-value.d.ts", + "default": "./dist/esm/pipeable/iterate-latest-value.js" + } + }, + "./pipeable/iterate-next-value": { + "browser": { + "types": "./dist/esm/pipeable/iterate-next-value.d.ts", + "default": "./dist/esm/pipeable/iterate-next-value.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/iterate-next-value.d.ts", + "default": "./dist/esm/pipeable/iterate-next-value.js" + }, + "import": { + "types": "./dist/esm/pipeable/iterate-next-value.d.ts", + "default": "./dist/esm/pipeable/iterate-next-value.js" + }, + "require": { + "types": "./dist/esm/pipeable/iterate-next-value.d.ts", + "default": "./dist/esm/pipeable/iterate-next-value.js" + } + }, + "./pipeable/last": { + "browser": { + "types": "./dist/esm/pipeable/last.d.ts", + "default": "./dist/esm/pipeable/last.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/last.d.ts", + "default": "./dist/esm/pipeable/last.js" + }, + "import": { + "types": "./dist/esm/pipeable/last.d.ts", + "default": "./dist/esm/pipeable/last.js" + }, + "require": { + "types": "./dist/esm/pipeable/last.d.ts", + "default": "./dist/esm/pipeable/last.js" + } + }, + "./pipeable/map": { + "browser": { + "types": "./dist/esm/pipeable/map.d.ts", + "default": "./dist/esm/pipeable/map.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/map.d.ts", + "default": "./dist/esm/pipeable/map.js" + }, + "import": { + "types": "./dist/esm/pipeable/map.d.ts", + "default": "./dist/esm/pipeable/map.js" + }, + "require": { + "types": "./dist/esm/pipeable/map.d.ts", + "default": "./dist/esm/pipeable/map.js" + } + }, + "./pipeable/materialize": { + "browser": { + "types": "./dist/esm/pipeable/materialize.d.ts", + "default": "./dist/esm/pipeable/materialize.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/materialize.d.ts", + "default": "./dist/esm/pipeable/materialize.js" + }, + "import": { + "types": "./dist/esm/pipeable/materialize.d.ts", + "default": "./dist/esm/pipeable/materialize.js" + }, + "require": { + "types": "./dist/esm/pipeable/materialize.d.ts", + "default": "./dist/esm/pipeable/materialize.js" + } + }, + "./pipeable/max": { + "browser": { + "types": "./dist/esm/pipeable/max.d.ts", + "default": "./dist/esm/pipeable/max.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/max.d.ts", + "default": "./dist/esm/pipeable/max.js" + }, + "import": { + "types": "./dist/esm/pipeable/max.d.ts", + "default": "./dist/esm/pipeable/max.js" + }, + "require": { + "types": "./dist/esm/pipeable/max.d.ts", + "default": "./dist/esm/pipeable/max.js" + } + }, + "./pipeable/merge-map": { + "browser": { + "types": "./dist/esm/pipeable/merge-map.d.ts", + "default": "./dist/esm/pipeable/merge-map.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/merge-map.d.ts", + "default": "./dist/esm/pipeable/merge-map.js" + }, + "import": { + "types": "./dist/esm/pipeable/merge-map.d.ts", + "default": "./dist/esm/pipeable/merge-map.js" + }, + "require": { + "types": "./dist/esm/pipeable/merge-map.d.ts", + "default": "./dist/esm/pipeable/merge-map.js" + } + }, + "./pipeable/merge-scan": { + "browser": { + "types": "./dist/esm/pipeable/merge-scan.d.ts", + "default": "./dist/esm/pipeable/merge-scan.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/merge-scan.d.ts", + "default": "./dist/esm/pipeable/merge-scan.js" + }, + "import": { + "types": "./dist/esm/pipeable/merge-scan.d.ts", + "default": "./dist/esm/pipeable/merge-scan.js" + }, + "require": { + "types": "./dist/esm/pipeable/merge-scan.d.ts", + "default": "./dist/esm/pipeable/merge-scan.js" + } + }, + "./pipeable/merge-with": { + "browser": { + "types": "./dist/esm/pipeable/merge-with.d.ts", + "default": "./dist/esm/pipeable/merge-with.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/merge-with.d.ts", + "default": "./dist/esm/pipeable/merge-with.js" + }, + "import": { + "types": "./dist/esm/pipeable/merge-with.d.ts", + "default": "./dist/esm/pipeable/merge-with.js" + }, + "require": { + "types": "./dist/esm/pipeable/merge-with.d.ts", + "default": "./dist/esm/pipeable/merge-with.js" + } + }, + "./pipeable/min": { + "browser": { + "types": "./dist/esm/pipeable/min.d.ts", + "default": "./dist/esm/pipeable/min.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/min.d.ts", + "default": "./dist/esm/pipeable/min.js" + }, + "import": { + "types": "./dist/esm/pipeable/min.d.ts", + "default": "./dist/esm/pipeable/min.js" + }, + "require": { + "types": "./dist/esm/pipeable/min.d.ts", + "default": "./dist/esm/pipeable/min.js" + } + }, + "./pipeable/multicast": { + "browser": { + "types": "./dist/esm/pipeable/multicast.d.ts", + "default": "./dist/esm/pipeable/multicast.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/multicast.d.ts", + "default": "./dist/esm/pipeable/multicast.js" + }, + "import": { + "types": "./dist/esm/pipeable/multicast.d.ts", + "default": "./dist/esm/pipeable/multicast.js" + }, + "require": { + "types": "./dist/esm/pipeable/multicast.d.ts", + "default": "./dist/esm/pipeable/multicast.js" + } + }, + "./pipeable/observe-on": { + "browser": { + "types": "./dist/esm/pipeable/observe-on.d.ts", + "default": "./dist/esm/pipeable/observe-on.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/observe-on.d.ts", + "default": "./dist/esm/pipeable/observe-on.js" + }, + "import": { + "types": "./dist/esm/pipeable/observe-on.d.ts", + "default": "./dist/esm/pipeable/observe-on.js" + }, + "require": { + "types": "./dist/esm/pipeable/observe-on.d.ts", + "default": "./dist/esm/pipeable/observe-on.js" + } + }, + "./pipeable/on-error-resume-next-with": { + "browser": { + "types": "./dist/esm/pipeable/on-error-resume-next-with.d.ts", + "default": "./dist/esm/pipeable/on-error-resume-next-with.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/on-error-resume-next-with.d.ts", + "default": "./dist/esm/pipeable/on-error-resume-next-with.js" + }, + "import": { + "types": "./dist/esm/pipeable/on-error-resume-next-with.d.ts", + "default": "./dist/esm/pipeable/on-error-resume-next-with.js" + }, + "require": { + "types": "./dist/esm/pipeable/on-error-resume-next-with.d.ts", + "default": "./dist/esm/pipeable/on-error-resume-next-with.js" + } + }, + "./pipeable/pairwise": { + "browser": { + "types": "./dist/esm/pipeable/pairwise.d.ts", + "default": "./dist/esm/pipeable/pairwise.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/pairwise.d.ts", + "default": "./dist/esm/pipeable/pairwise.js" + }, + "import": { + "types": "./dist/esm/pipeable/pairwise.d.ts", + "default": "./dist/esm/pipeable/pairwise.js" + }, + "require": { + "types": "./dist/esm/pipeable/pairwise.d.ts", + "default": "./dist/esm/pipeable/pairwise.js" + } + }, + "./pipeable/pipe": { + "browser": { + "types": "./dist/esm/pipeable/pipe.d.ts", + "default": "./dist/esm/pipeable/pipe.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/pipe.d.ts", + "default": "./dist/esm/pipeable/pipe.js" + }, + "import": { + "types": "./dist/esm/pipeable/pipe.d.ts", + "default": "./dist/esm/pipeable/pipe.js" + }, + "require": { + "types": "./dist/esm/pipeable/pipe.d.ts", + "default": "./dist/esm/pipeable/pipe.js" + } + }, + "./pipeable/pluck": { + "browser": { + "types": "./dist/esm/pipeable/pluck.d.ts", + "default": "./dist/esm/pipeable/pluck.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/pluck.d.ts", + "default": "./dist/esm/pipeable/pluck.js" + }, + "import": { + "types": "./dist/esm/pipeable/pluck.d.ts", + "default": "./dist/esm/pipeable/pluck.js" + }, + "require": { + "types": "./dist/esm/pipeable/pluck.d.ts", + "default": "./dist/esm/pipeable/pluck.js" + } + }, + "./pipeable/publish": { + "browser": { + "types": "./dist/esm/pipeable/publish.d.ts", + "default": "./dist/esm/pipeable/publish.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/publish.d.ts", + "default": "./dist/esm/pipeable/publish.js" + }, + "import": { + "types": "./dist/esm/pipeable/publish.d.ts", + "default": "./dist/esm/pipeable/publish.js" + }, + "require": { + "types": "./dist/esm/pipeable/publish.d.ts", + "default": "./dist/esm/pipeable/publish.js" + } + }, + "./pipeable/publish-behavior": { + "browser": { + "types": "./dist/esm/pipeable/publish-behavior.d.ts", + "default": "./dist/esm/pipeable/publish-behavior.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/publish-behavior.d.ts", + "default": "./dist/esm/pipeable/publish-behavior.js" + }, + "import": { + "types": "./dist/esm/pipeable/publish-behavior.d.ts", + "default": "./dist/esm/pipeable/publish-behavior.js" + }, + "require": { + "types": "./dist/esm/pipeable/publish-behavior.d.ts", + "default": "./dist/esm/pipeable/publish-behavior.js" + } + }, + "./pipeable/publish-last": { + "browser": { + "types": "./dist/esm/pipeable/publish-last.d.ts", + "default": "./dist/esm/pipeable/publish-last.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/publish-last.d.ts", + "default": "./dist/esm/pipeable/publish-last.js" + }, + "import": { + "types": "./dist/esm/pipeable/publish-last.d.ts", + "default": "./dist/esm/pipeable/publish-last.js" + }, + "require": { + "types": "./dist/esm/pipeable/publish-last.d.ts", + "default": "./dist/esm/pipeable/publish-last.js" + } + }, + "./pipeable/publish-replay": { + "browser": { + "types": "./dist/esm/pipeable/publish-replay.d.ts", + "default": "./dist/esm/pipeable/publish-replay.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/publish-replay.d.ts", + "default": "./dist/esm/pipeable/publish-replay.js" + }, + "import": { + "types": "./dist/esm/pipeable/publish-replay.d.ts", + "default": "./dist/esm/pipeable/publish-replay.js" + }, + "require": { + "types": "./dist/esm/pipeable/publish-replay.d.ts", + "default": "./dist/esm/pipeable/publish-replay.js" + } + }, + "./pipeable/race-with": { + "browser": { + "types": "./dist/esm/pipeable/race-with.d.ts", + "default": "./dist/esm/pipeable/race-with.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/race-with.d.ts", + "default": "./dist/esm/pipeable/race-with.js" + }, + "import": { + "types": "./dist/esm/pipeable/race-with.d.ts", + "default": "./dist/esm/pipeable/race-with.js" + }, + "require": { + "types": "./dist/esm/pipeable/race-with.d.ts", + "default": "./dist/esm/pipeable/race-with.js" + } + }, + "./pipeable/reduce": { + "browser": { + "types": "./dist/esm/pipeable/reduce.d.ts", + "default": "./dist/esm/pipeable/reduce.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/reduce.d.ts", + "default": "./dist/esm/pipeable/reduce.js" + }, + "import": { + "types": "./dist/esm/pipeable/reduce.d.ts", + "default": "./dist/esm/pipeable/reduce.js" + }, + "require": { + "types": "./dist/esm/pipeable/reduce.d.ts", + "default": "./dist/esm/pipeable/reduce.js" + } + }, + "./pipeable/ref-count": { + "browser": { + "types": "./dist/esm/pipeable/ref-count.d.ts", + "default": "./dist/esm/pipeable/ref-count.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/ref-count.d.ts", + "default": "./dist/esm/pipeable/ref-count.js" + }, + "import": { + "types": "./dist/esm/pipeable/ref-count.d.ts", + "default": "./dist/esm/pipeable/ref-count.js" + }, + "require": { + "types": "./dist/esm/pipeable/ref-count.d.ts", + "default": "./dist/esm/pipeable/ref-count.js" + } + }, + "./pipeable/repeat": { + "browser": { + "types": "./dist/esm/pipeable/repeat.d.ts", + "default": "./dist/esm/pipeable/repeat.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/repeat.d.ts", + "default": "./dist/esm/pipeable/repeat.js" + }, + "import": { + "types": "./dist/esm/pipeable/repeat.d.ts", + "default": "./dist/esm/pipeable/repeat.js" + }, + "require": { + "types": "./dist/esm/pipeable/repeat.d.ts", + "default": "./dist/esm/pipeable/repeat.js" + } + }, + "./pipeable/repeat-when": { + "browser": { + "types": "./dist/esm/pipeable/repeat-when.d.ts", + "default": "./dist/esm/pipeable/repeat-when.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/repeat-when.d.ts", + "default": "./dist/esm/pipeable/repeat-when.js" + }, + "import": { + "types": "./dist/esm/pipeable/repeat-when.d.ts", + "default": "./dist/esm/pipeable/repeat-when.js" + }, + "require": { + "types": "./dist/esm/pipeable/repeat-when.d.ts", + "default": "./dist/esm/pipeable/repeat-when.js" + } + }, + "./pipeable/retry": { + "browser": { + "types": "./dist/esm/pipeable/retry.d.ts", + "default": "./dist/esm/pipeable/retry.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/retry.d.ts", + "default": "./dist/esm/pipeable/retry.js" + }, + "import": { + "types": "./dist/esm/pipeable/retry.d.ts", + "default": "./dist/esm/pipeable/retry.js" + }, + "require": { + "types": "./dist/esm/pipeable/retry.d.ts", + "default": "./dist/esm/pipeable/retry.js" + } + }, + "./pipeable/retry-when": { + "browser": { + "types": "./dist/esm/pipeable/retry-when.d.ts", + "default": "./dist/esm/pipeable/retry-when.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/retry-when.d.ts", + "default": "./dist/esm/pipeable/retry-when.js" + }, + "import": { + "types": "./dist/esm/pipeable/retry-when.d.ts", + "default": "./dist/esm/pipeable/retry-when.js" + }, + "require": { + "types": "./dist/esm/pipeable/retry-when.d.ts", + "default": "./dist/esm/pipeable/retry-when.js" + } + }, + "./pipeable/sample": { + "browser": { + "types": "./dist/esm/pipeable/sample.d.ts", + "default": "./dist/esm/pipeable/sample.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/sample.d.ts", + "default": "./dist/esm/pipeable/sample.js" + }, + "import": { + "types": "./dist/esm/pipeable/sample.d.ts", + "default": "./dist/esm/pipeable/sample.js" + }, + "require": { + "types": "./dist/esm/pipeable/sample.d.ts", + "default": "./dist/esm/pipeable/sample.js" + } + }, + "./pipeable/sample-time": { + "browser": { + "types": "./dist/esm/pipeable/sample-time.d.ts", + "default": "./dist/esm/pipeable/sample-time.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/sample-time.d.ts", + "default": "./dist/esm/pipeable/sample-time.js" + }, + "import": { + "types": "./dist/esm/pipeable/sample-time.d.ts", + "default": "./dist/esm/pipeable/sample-time.js" + }, + "require": { + "types": "./dist/esm/pipeable/sample-time.d.ts", + "default": "./dist/esm/pipeable/sample-time.js" + } + }, + "./pipeable/scan": { + "browser": { + "types": "./dist/esm/pipeable/scan.d.ts", + "default": "./dist/esm/pipeable/scan.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/scan.d.ts", + "default": "./dist/esm/pipeable/scan.js" + }, + "import": { + "types": "./dist/esm/pipeable/scan.d.ts", + "default": "./dist/esm/pipeable/scan.js" + }, + "require": { + "types": "./dist/esm/pipeable/scan.d.ts", + "default": "./dist/esm/pipeable/scan.js" + } + }, + "./pipeable/sequence-equal": { + "browser": { + "types": "./dist/esm/pipeable/sequence-equal.d.ts", + "default": "./dist/esm/pipeable/sequence-equal.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/sequence-equal.d.ts", + "default": "./dist/esm/pipeable/sequence-equal.js" + }, + "import": { + "types": "./dist/esm/pipeable/sequence-equal.d.ts", + "default": "./dist/esm/pipeable/sequence-equal.js" + }, + "require": { + "types": "./dist/esm/pipeable/sequence-equal.d.ts", + "default": "./dist/esm/pipeable/sequence-equal.js" + } + }, + "./pipeable/share": { + "browser": { + "types": "./dist/esm/pipeable/share.d.ts", + "default": "./dist/esm/pipeable/share.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/share.d.ts", + "default": "./dist/esm/pipeable/share.js" + }, + "import": { + "types": "./dist/esm/pipeable/share.d.ts", + "default": "./dist/esm/pipeable/share.js" + }, + "require": { + "types": "./dist/esm/pipeable/share.d.ts", + "default": "./dist/esm/pipeable/share.js" + } + }, + "./pipeable/share-replay": { + "browser": { + "types": "./dist/esm/pipeable/share-replay.d.ts", + "default": "./dist/esm/pipeable/share-replay.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/share-replay.d.ts", + "default": "./dist/esm/pipeable/share-replay.js" + }, + "import": { + "types": "./dist/esm/pipeable/share-replay.d.ts", + "default": "./dist/esm/pipeable/share-replay.js" + }, + "require": { + "types": "./dist/esm/pipeable/share-replay.d.ts", + "default": "./dist/esm/pipeable/share-replay.js" + } + }, + "./pipeable/single": { + "browser": { + "types": "./dist/esm/pipeable/single.d.ts", + "default": "./dist/esm/pipeable/single.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/single.d.ts", + "default": "./dist/esm/pipeable/single.js" + }, + "import": { + "types": "./dist/esm/pipeable/single.d.ts", + "default": "./dist/esm/pipeable/single.js" + }, + "require": { + "types": "./dist/esm/pipeable/single.d.ts", + "default": "./dist/esm/pipeable/single.js" + } + }, + "./pipeable/skip": { + "browser": { + "types": "./dist/esm/pipeable/skip.d.ts", + "default": "./dist/esm/pipeable/skip.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/skip.d.ts", + "default": "./dist/esm/pipeable/skip.js" + }, + "import": { + "types": "./dist/esm/pipeable/skip.d.ts", + "default": "./dist/esm/pipeable/skip.js" + }, + "require": { + "types": "./dist/esm/pipeable/skip.d.ts", + "default": "./dist/esm/pipeable/skip.js" + } + }, + "./pipeable/skip-last": { + "browser": { + "types": "./dist/esm/pipeable/skip-last.d.ts", + "default": "./dist/esm/pipeable/skip-last.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/skip-last.d.ts", + "default": "./dist/esm/pipeable/skip-last.js" + }, + "import": { + "types": "./dist/esm/pipeable/skip-last.d.ts", + "default": "./dist/esm/pipeable/skip-last.js" + }, + "require": { + "types": "./dist/esm/pipeable/skip-last.d.ts", + "default": "./dist/esm/pipeable/skip-last.js" + } + }, + "./pipeable/skip-until": { + "browser": { + "types": "./dist/esm/pipeable/skip-until.d.ts", + "default": "./dist/esm/pipeable/skip-until.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/skip-until.d.ts", + "default": "./dist/esm/pipeable/skip-until.js" + }, + "import": { + "types": "./dist/esm/pipeable/skip-until.d.ts", + "default": "./dist/esm/pipeable/skip-until.js" + }, + "require": { + "types": "./dist/esm/pipeable/skip-until.d.ts", + "default": "./dist/esm/pipeable/skip-until.js" + } + }, + "./pipeable/skip-while": { + "browser": { + "types": "./dist/esm/pipeable/skip-while.d.ts", + "default": "./dist/esm/pipeable/skip-while.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/skip-while.d.ts", + "default": "./dist/esm/pipeable/skip-while.js" + }, + "import": { + "types": "./dist/esm/pipeable/skip-while.d.ts", + "default": "./dist/esm/pipeable/skip-while.js" + }, + "require": { + "types": "./dist/esm/pipeable/skip-while.d.ts", + "default": "./dist/esm/pipeable/skip-while.js" + } + }, + "./pipeable/start-with": { + "browser": { + "types": "./dist/esm/pipeable/start-with.d.ts", + "default": "./dist/esm/pipeable/start-with.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/start-with.d.ts", + "default": "./dist/esm/pipeable/start-with.js" + }, + "import": { + "types": "./dist/esm/pipeable/start-with.d.ts", + "default": "./dist/esm/pipeable/start-with.js" + }, + "require": { + "types": "./dist/esm/pipeable/start-with.d.ts", + "default": "./dist/esm/pipeable/start-with.js" + } + }, + "./pipeable/subscribe": { + "browser": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + }, + "import": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + }, + "require": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + } + }, + "./pipeable/subscribe-on": { + "browser": { + "types": "./dist/esm/pipeable/subscribe-on.d.ts", + "default": "./dist/esm/pipeable/subscribe-on.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/subscribe-on.d.ts", + "default": "./dist/esm/pipeable/subscribe-on.js" + }, + "import": { + "types": "./dist/esm/pipeable/subscribe-on.d.ts", + "default": "./dist/esm/pipeable/subscribe-on.js" + }, + "require": { + "types": "./dist/esm/pipeable/subscribe-on.d.ts", + "default": "./dist/esm/pipeable/subscribe-on.js" + } + }, + "./pipeable/switch-map": { + "browser": { + "types": "./dist/esm/pipeable/switch-map.d.ts", + "default": "./dist/esm/pipeable/switch-map.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/switch-map.d.ts", + "default": "./dist/esm/pipeable/switch-map.js" + }, + "import": { + "types": "./dist/esm/pipeable/switch-map.d.ts", + "default": "./dist/esm/pipeable/switch-map.js" + }, + "require": { + "types": "./dist/esm/pipeable/switch-map.d.ts", + "default": "./dist/esm/pipeable/switch-map.js" + } + }, + "./pipeable/switch-scan": { + "browser": { + "types": "./dist/esm/pipeable/switch-scan.d.ts", + "default": "./dist/esm/pipeable/switch-scan.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/switch-scan.d.ts", + "default": "./dist/esm/pipeable/switch-scan.js" + }, + "import": { + "types": "./dist/esm/pipeable/switch-scan.d.ts", + "default": "./dist/esm/pipeable/switch-scan.js" + }, + "require": { + "types": "./dist/esm/pipeable/switch-scan.d.ts", + "default": "./dist/esm/pipeable/switch-scan.js" + } + }, + "./pipeable/take": { + "browser": { + "types": "./dist/esm/pipeable/take.d.ts", + "default": "./dist/esm/pipeable/take.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/take.d.ts", + "default": "./dist/esm/pipeable/take.js" + }, + "import": { + "types": "./dist/esm/pipeable/take.d.ts", + "default": "./dist/esm/pipeable/take.js" + }, + "require": { + "types": "./dist/esm/pipeable/take.d.ts", + "default": "./dist/esm/pipeable/take.js" + } + }, + "./pipeable/take-last": { + "browser": { + "types": "./dist/esm/pipeable/take-last.d.ts", + "default": "./dist/esm/pipeable/take-last.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/take-last.d.ts", + "default": "./dist/esm/pipeable/take-last.js" + }, + "import": { + "types": "./dist/esm/pipeable/take-last.d.ts", + "default": "./dist/esm/pipeable/take-last.js" + }, + "require": { + "types": "./dist/esm/pipeable/take-last.d.ts", + "default": "./dist/esm/pipeable/take-last.js" + } + }, + "./pipeable/take-until": { + "browser": { + "types": "./dist/esm/pipeable/take-until.d.ts", + "default": "./dist/esm/pipeable/take-until.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/take-until.d.ts", + "default": "./dist/esm/pipeable/take-until.js" + }, + "import": { + "types": "./dist/esm/pipeable/take-until.d.ts", + "default": "./dist/esm/pipeable/take-until.js" + }, + "require": { + "types": "./dist/esm/pipeable/take-until.d.ts", + "default": "./dist/esm/pipeable/take-until.js" + } + }, + "./pipeable/take-while": { + "browser": { + "types": "./dist/esm/pipeable/take-while.d.ts", + "default": "./dist/esm/pipeable/take-while.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/take-while.d.ts", + "default": "./dist/esm/pipeable/take-while.js" + }, + "import": { + "types": "./dist/esm/pipeable/take-while.d.ts", + "default": "./dist/esm/pipeable/take-while.js" + }, + "require": { + "types": "./dist/esm/pipeable/take-while.d.ts", + "default": "./dist/esm/pipeable/take-while.js" + } + }, + "./pipeable/tap": { + "browser": { + "types": "./dist/esm/pipeable/tap.d.ts", + "default": "./dist/esm/pipeable/tap.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/tap.d.ts", + "default": "./dist/esm/pipeable/tap.js" + }, + "import": { + "types": "./dist/esm/pipeable/tap.d.ts", + "default": "./dist/esm/pipeable/tap.js" + }, + "require": { + "types": "./dist/esm/pipeable/tap.d.ts", + "default": "./dist/esm/pipeable/tap.js" + } + }, + "./pipeable/throttle": { + "browser": { + "types": "./dist/esm/pipeable/throttle.d.ts", + "default": "./dist/esm/pipeable/throttle.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/throttle.d.ts", + "default": "./dist/esm/pipeable/throttle.js" + }, + "import": { + "types": "./dist/esm/pipeable/throttle.d.ts", + "default": "./dist/esm/pipeable/throttle.js" + }, + "require": { + "types": "./dist/esm/pipeable/throttle.d.ts", + "default": "./dist/esm/pipeable/throttle.js" + } + }, + "./pipeable/throw-if-empty": { + "browser": { + "types": "./dist/esm/pipeable/throw-if-empty.d.ts", + "default": "./dist/esm/pipeable/throw-if-empty.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/throw-if-empty.d.ts", + "default": "./dist/esm/pipeable/throw-if-empty.js" + }, + "import": { + "types": "./dist/esm/pipeable/throw-if-empty.d.ts", + "default": "./dist/esm/pipeable/throw-if-empty.js" + }, + "require": { + "types": "./dist/esm/pipeable/throw-if-empty.d.ts", + "default": "./dist/esm/pipeable/throw-if-empty.js" + } + }, + "./pipeable/time-interval": { + "browser": { + "types": "./dist/esm/pipeable/time-interval.d.ts", + "default": "./dist/esm/pipeable/time-interval.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/time-interval.d.ts", + "default": "./dist/esm/pipeable/time-interval.js" + }, + "import": { + "types": "./dist/esm/pipeable/time-interval.d.ts", + "default": "./dist/esm/pipeable/time-interval.js" + }, + "require": { + "types": "./dist/esm/pipeable/time-interval.d.ts", + "default": "./dist/esm/pipeable/time-interval.js" + } + }, + "./pipeable/timeout": { + "browser": { + "types": "./dist/esm/pipeable/timeout.d.ts", + "default": "./dist/esm/pipeable/timeout.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/timeout.d.ts", + "default": "./dist/esm/pipeable/timeout.js" + }, + "import": { + "types": "./dist/esm/pipeable/timeout.d.ts", + "default": "./dist/esm/pipeable/timeout.js" + }, + "require": { + "types": "./dist/esm/pipeable/timeout.d.ts", + "default": "./dist/esm/pipeable/timeout.js" + } + }, + "./pipeable/timestamp": { + "browser": { + "types": "./dist/esm/pipeable/timestamp.d.ts", + "default": "./dist/esm/pipeable/timestamp.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/timestamp.d.ts", + "default": "./dist/esm/pipeable/timestamp.js" + }, + "import": { + "types": "./dist/esm/pipeable/timestamp.d.ts", + "default": "./dist/esm/pipeable/timestamp.js" + }, + "require": { + "types": "./dist/esm/pipeable/timestamp.d.ts", + "default": "./dist/esm/pipeable/timestamp.js" + } + }, + "./pipeable/to-array": { + "browser": { + "types": "./dist/esm/pipeable/to-array.d.ts", + "default": "./dist/esm/pipeable/to-array.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/to-array.d.ts", + "default": "./dist/esm/pipeable/to-array.js" + }, + "import": { + "types": "./dist/esm/pipeable/to-array.d.ts", + "default": "./dist/esm/pipeable/to-array.js" + }, + "require": { + "types": "./dist/esm/pipeable/to-array.d.ts", + "default": "./dist/esm/pipeable/to-array.js" + } + }, + "./pipeable/window": { + "browser": { + "types": "./dist/esm/pipeable/window.d.ts", + "default": "./dist/esm/pipeable/window.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/window.d.ts", + "default": "./dist/esm/pipeable/window.js" + }, + "import": { + "types": "./dist/esm/pipeable/window.d.ts", + "default": "./dist/esm/pipeable/window.js" + }, + "require": { + "types": "./dist/esm/pipeable/window.d.ts", + "default": "./dist/esm/pipeable/window.js" + } + }, + "./pipeable/window-count": { + "browser": { + "types": "./dist/esm/pipeable/window-count.d.ts", + "default": "./dist/esm/pipeable/window-count.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/window-count.d.ts", + "default": "./dist/esm/pipeable/window-count.js" + }, + "import": { + "types": "./dist/esm/pipeable/window-count.d.ts", + "default": "./dist/esm/pipeable/window-count.js" + }, + "require": { + "types": "./dist/esm/pipeable/window-count.d.ts", + "default": "./dist/esm/pipeable/window-count.js" + } + }, + "./pipeable/window-time": { + "browser": { + "types": "./dist/esm/pipeable/window-time.d.ts", + "default": "./dist/esm/pipeable/window-time.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/window-time.d.ts", + "default": "./dist/esm/pipeable/window-time.js" + }, + "import": { + "types": "./dist/esm/pipeable/window-time.d.ts", + "default": "./dist/esm/pipeable/window-time.js" + }, + "require": { + "types": "./dist/esm/pipeable/window-time.d.ts", + "default": "./dist/esm/pipeable/window-time.js" + } + }, + "./pipeable/window-toggle": { + "browser": { + "types": "./dist/esm/pipeable/window-toggle.d.ts", + "default": "./dist/esm/pipeable/window-toggle.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/window-toggle.d.ts", + "default": "./dist/esm/pipeable/window-toggle.js" + }, + "import": { + "types": "./dist/esm/pipeable/window-toggle.d.ts", + "default": "./dist/esm/pipeable/window-toggle.js" + }, + "require": { + "types": "./dist/esm/pipeable/window-toggle.d.ts", + "default": "./dist/esm/pipeable/window-toggle.js" + } + }, + "./pipeable/window-when": { + "browser": { + "types": "./dist/esm/pipeable/window-when.d.ts", + "default": "./dist/esm/pipeable/window-when.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/window-when.d.ts", + "default": "./dist/esm/pipeable/window-when.js" + }, + "import": { + "types": "./dist/esm/pipeable/window-when.d.ts", + "default": "./dist/esm/pipeable/window-when.js" + }, + "require": { + "types": "./dist/esm/pipeable/window-when.d.ts", + "default": "./dist/esm/pipeable/window-when.js" + } + }, + "./pipeable/with-latest-from": { + "browser": { + "types": "./dist/esm/pipeable/with-latest-from.d.ts", + "default": "./dist/esm/pipeable/with-latest-from.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/with-latest-from.d.ts", + "default": "./dist/esm/pipeable/with-latest-from.js" + }, + "import": { + "types": "./dist/esm/pipeable/with-latest-from.d.ts", + "default": "./dist/esm/pipeable/with-latest-from.js" + }, + "require": { + "types": "./dist/esm/pipeable/with-latest-from.d.ts", + "default": "./dist/esm/pipeable/with-latest-from.js" + } + }, + "./pipeable/zip-all": { + "browser": { + "types": "./dist/esm/pipeable/zip-all.d.ts", + "default": "./dist/esm/pipeable/zip-all.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/zip-all.d.ts", + "default": "./dist/esm/pipeable/zip-all.js" + }, + "import": { + "types": "./dist/esm/pipeable/zip-all.d.ts", + "default": "./dist/esm/pipeable/zip-all.js" + }, + "require": { + "types": "./dist/esm/pipeable/zip-all.d.ts", + "default": "./dist/esm/pipeable/zip-all.js" + } + }, + "./pipeable/zip-with": { + "browser": { + "types": "./dist/esm/pipeable/zip-with.d.ts", + "default": "./dist/esm/pipeable/zip-with.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/zip-with.d.ts", + "default": "./dist/esm/pipeable/zip-with.js" + }, + "import": { + "types": "./dist/esm/pipeable/zip-with.d.ts", + "default": "./dist/esm/pipeable/zip-with.js" + }, + "require": { + "types": "./dist/esm/pipeable/zip-with.d.ts", + "default": "./dist/esm/pipeable/zip-with.js" + } + }, + "./pluck": { + "browser": { + "types": "./dist/esm/pluck.d.ts", + "default": "./dist/esm/pluck.js" + }, + "webpack": { + "types": "./dist/esm/pluck.d.ts", + "default": "./dist/esm/pluck.js" + }, + "import": { + "types": "./dist/esm/pluck.d.ts", + "default": "./dist/esm/pluck.js" + }, + "require": { + "types": "./dist/esm/pluck.d.ts", + "default": "./dist/esm/pluck.js" + } + }, + "./publish": { + "browser": { + "types": "./dist/esm/publish.d.ts", + "default": "./dist/esm/publish.js" + }, + "webpack": { + "types": "./dist/esm/publish.d.ts", + "default": "./dist/esm/publish.js" + }, + "import": { + "types": "./dist/esm/publish.d.ts", + "default": "./dist/esm/publish.js" + }, + "require": { + "types": "./dist/esm/publish.d.ts", + "default": "./dist/esm/publish.js" + } + }, + "./publish-behavior": { + "browser": { + "types": "./dist/esm/publish-behavior.d.ts", + "default": "./dist/esm/publish-behavior.js" + }, + "webpack": { + "types": "./dist/esm/publish-behavior.d.ts", + "default": "./dist/esm/publish-behavior.js" + }, + "import": { + "types": "./dist/esm/publish-behavior.d.ts", + "default": "./dist/esm/publish-behavior.js" + }, + "require": { + "types": "./dist/esm/publish-behavior.d.ts", + "default": "./dist/esm/publish-behavior.js" + } + }, + "./publish-last": { + "browser": { + "types": "./dist/esm/publish-last.d.ts", + "default": "./dist/esm/publish-last.js" + }, + "webpack": { + "types": "./dist/esm/publish-last.d.ts", + "default": "./dist/esm/publish-last.js" + }, + "import": { + "types": "./dist/esm/publish-last.d.ts", + "default": "./dist/esm/publish-last.js" + }, + "require": { + "types": "./dist/esm/publish-last.d.ts", + "default": "./dist/esm/publish-last.js" + } + }, + "./publish-replay": { + "browser": { + "types": "./dist/esm/publish-replay.d.ts", + "default": "./dist/esm/publish-replay.js" + }, + "webpack": { + "types": "./dist/esm/publish-replay.d.ts", + "default": "./dist/esm/publish-replay.js" + }, + "import": { + "types": "./dist/esm/publish-replay.d.ts", + "default": "./dist/esm/publish-replay.js" + }, + "require": { + "types": "./dist/esm/publish-replay.d.ts", + "default": "./dist/esm/publish-replay.js" + } + }, + "./race": { + "browser": { + "types": "./dist/esm/race.d.ts", + "default": "./dist/esm/race.js" + }, + "webpack": { + "types": "./dist/esm/race.d.ts", + "default": "./dist/esm/race.js" + }, + "import": { + "types": "./dist/esm/race.d.ts", + "default": "./dist/esm/race.js" + }, + "require": { + "types": "./dist/esm/race.d.ts", + "default": "./dist/esm/race.js" + } + }, + "./race-with": { + "browser": { + "types": "./dist/esm/pipeable/race-with.d.ts", + "default": "./dist/esm/pipeable/race-with.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/race-with.d.ts", + "default": "./dist/esm/pipeable/race-with.js" + }, + "import": { + "types": "./dist/esm/pipeable/race-with.d.ts", + "default": "./dist/esm/pipeable/race-with.js" + }, + "require": { + "types": "./dist/esm/pipeable/race-with.d.ts", + "default": "./dist/esm/pipeable/race-with.js" + } + }, + "./reduce": { + "browser": { + "types": "./dist/esm/reduce.d.ts", + "default": "./dist/esm/reduce.js" + }, + "webpack": { + "types": "./dist/esm/reduce.d.ts", + "default": "./dist/esm/reduce.js" + }, + "import": { + "types": "./dist/esm/reduce.d.ts", + "default": "./dist/esm/reduce.js" + }, + "require": { + "types": "./dist/esm/reduce.d.ts", + "default": "./dist/esm/reduce.js" + } + }, + "./ref-count": { + "browser": { + "types": "./dist/esm/ref-count.d.ts", + "default": "./dist/esm/ref-count.js" + }, + "webpack": { + "types": "./dist/esm/ref-count.d.ts", + "default": "./dist/esm/ref-count.js" + }, + "import": { + "types": "./dist/esm/ref-count.d.ts", + "default": "./dist/esm/ref-count.js" + }, + "require": { + "types": "./dist/esm/ref-count.d.ts", + "default": "./dist/esm/ref-count.js" + } + }, + "./repeat": { + "browser": { + "types": "./dist/esm/repeat.d.ts", + "default": "./dist/esm/repeat.js" + }, + "webpack": { + "types": "./dist/esm/repeat.d.ts", + "default": "./dist/esm/repeat.js" + }, + "import": { + "types": "./dist/esm/repeat.d.ts", + "default": "./dist/esm/repeat.js" + }, + "require": { + "types": "./dist/esm/repeat.d.ts", + "default": "./dist/esm/repeat.js" + } + }, + "./repeat-when": { + "browser": { + "types": "./dist/esm/repeat-when.d.ts", + "default": "./dist/esm/repeat-when.js" + }, + "webpack": { + "types": "./dist/esm/repeat-when.d.ts", + "default": "./dist/esm/repeat-when.js" + }, + "import": { + "types": "./dist/esm/repeat-when.d.ts", + "default": "./dist/esm/repeat-when.js" + }, + "require": { + "types": "./dist/esm/repeat-when.d.ts", + "default": "./dist/esm/repeat-when.js" + } + }, + "./replay-subject": { + "browser": { + "types": "./dist/esm/replay-subject.d.ts", + "default": "./dist/esm/replay-subject.js" + }, + "webpack": { + "types": "./dist/esm/replay-subject.d.ts", + "default": "./dist/esm/replay-subject.js" + }, + "import": { + "types": "./dist/esm/replay-subject.d.ts", + "default": "./dist/esm/replay-subject.js" + }, + "require": { + "types": "./dist/esm/replay-subject.d.ts", + "default": "./dist/esm/replay-subject.js" + } + }, + "./retry": { + "browser": { + "types": "./dist/esm/retry.d.ts", + "default": "./dist/esm/retry.js" + }, + "webpack": { + "types": "./dist/esm/retry.d.ts", + "default": "./dist/esm/retry.js" + }, + "import": { + "types": "./dist/esm/retry.d.ts", + "default": "./dist/esm/retry.js" + }, + "require": { + "types": "./dist/esm/retry.d.ts", + "default": "./dist/esm/retry.js" + } + }, + "./retry-when": { + "browser": { + "types": "./dist/esm/retry-when.d.ts", + "default": "./dist/esm/retry-when.js" + }, + "webpack": { + "types": "./dist/esm/retry-when.d.ts", + "default": "./dist/esm/retry-when.js" + }, + "import": { + "types": "./dist/esm/retry-when.d.ts", + "default": "./dist/esm/retry-when.js" + }, + "require": { + "types": "./dist/esm/retry-when.d.ts", + "default": "./dist/esm/retry-when.js" + } + }, + "./rx": { + "browser": { + "types": "./dist/esm/rx.d.ts", + "default": "./dist/esm/rx.js" + }, + "webpack": { + "types": "./dist/esm/rx.d.ts", + "default": "./dist/esm/rx.js" + }, + "import": { + "types": "./dist/esm/rx.d.ts", + "default": "./dist/esm/rx.js" + }, + "require": { + "types": "./dist/esm/rx.d.ts", + "default": "./dist/esm/rx.js" + } + }, + "./sample": { + "browser": { + "types": "./dist/esm/sample.d.ts", + "default": "./dist/esm/sample.js" + }, + "webpack": { + "types": "./dist/esm/sample.d.ts", + "default": "./dist/esm/sample.js" + }, + "import": { + "types": "./dist/esm/sample.d.ts", + "default": "./dist/esm/sample.js" + }, + "require": { + "types": "./dist/esm/sample.d.ts", + "default": "./dist/esm/sample.js" + } + }, + "./sample-time": { + "browser": { + "types": "./dist/esm/sample-time.d.ts", + "default": "./dist/esm/sample-time.js" + }, + "webpack": { + "types": "./dist/esm/sample-time.d.ts", + "default": "./dist/esm/sample-time.js" + }, + "import": { + "types": "./dist/esm/sample-time.d.ts", + "default": "./dist/esm/sample-time.js" + }, + "require": { + "types": "./dist/esm/sample-time.d.ts", + "default": "./dist/esm/sample-time.js" + } + }, + "./scan": { + "browser": { + "types": "./dist/esm/scan.d.ts", + "default": "./dist/esm/scan.js" + }, + "webpack": { + "types": "./dist/esm/scan.d.ts", + "default": "./dist/esm/scan.js" + }, + "import": { + "types": "./dist/esm/scan.d.ts", + "default": "./dist/esm/scan.js" + }, + "require": { + "types": "./dist/esm/scan.d.ts", + "default": "./dist/esm/scan.js" + } + }, + "./sequence-equal": { + "browser": { + "types": "./dist/esm/sequence-equal.d.ts", + "default": "./dist/esm/sequence-equal.js" + }, + "webpack": { + "types": "./dist/esm/sequence-equal.d.ts", + "default": "./dist/esm/sequence-equal.js" + }, + "import": { + "types": "./dist/esm/sequence-equal.d.ts", + "default": "./dist/esm/sequence-equal.js" + }, + "require": { + "types": "./dist/esm/sequence-equal.d.ts", + "default": "./dist/esm/sequence-equal.js" } }, "./sequence-error": { "browser": { - "types": "./dist/esm/sequence-error.d.ts", - "default": "./dist/esm/sequence-error.js" + "types": "./dist/esm/sequence-error.d.ts", + "default": "./dist/esm/sequence-error.js" + }, + "webpack": { + "types": "./dist/esm/sequence-error.d.ts", + "default": "./dist/esm/sequence-error.js" + }, + "import": { + "types": "./dist/esm/sequence-error.d.ts", + "default": "./dist/esm/sequence-error.js" + }, + "require": { + "types": "./dist/esm/sequence-error.d.ts", + "default": "./dist/esm/sequence-error.js" + } + }, + "./share": { + "browser": { + "types": "./dist/esm/share.d.ts", + "default": "./dist/esm/share.js" + }, + "webpack": { + "types": "./dist/esm/share.d.ts", + "default": "./dist/esm/share.js" + }, + "import": { + "types": "./dist/esm/share.d.ts", + "default": "./dist/esm/share.js" + }, + "require": { + "types": "./dist/esm/share.d.ts", + "default": "./dist/esm/share.js" + } + }, + "./share-replay": { + "browser": { + "types": "./dist/esm/share-replay.d.ts", + "default": "./dist/esm/share-replay.js" + }, + "webpack": { + "types": "./dist/esm/share-replay.d.ts", + "default": "./dist/esm/share-replay.js" + }, + "import": { + "types": "./dist/esm/share-replay.d.ts", + "default": "./dist/esm/share-replay.js" + }, + "require": { + "types": "./dist/esm/share-replay.d.ts", + "default": "./dist/esm/share-replay.js" + } + }, + "./single": { + "browser": { + "types": "./dist/esm/single.d.ts", + "default": "./dist/esm/single.js" + }, + "webpack": { + "types": "./dist/esm/single.d.ts", + "default": "./dist/esm/single.js" + }, + "import": { + "types": "./dist/esm/single.d.ts", + "default": "./dist/esm/single.js" + }, + "require": { + "types": "./dist/esm/single.d.ts", + "default": "./dist/esm/single.js" + } + }, + "./skip": { + "browser": { + "types": "./dist/esm/skip.d.ts", + "default": "./dist/esm/skip.js" + }, + "webpack": { + "types": "./dist/esm/skip.d.ts", + "default": "./dist/esm/skip.js" + }, + "import": { + "types": "./dist/esm/skip.d.ts", + "default": "./dist/esm/skip.js" + }, + "require": { + "types": "./dist/esm/skip.d.ts", + "default": "./dist/esm/skip.js" + } + }, + "./skip-last": { + "browser": { + "types": "./dist/esm/skip-last.d.ts", + "default": "./dist/esm/skip-last.js" + }, + "webpack": { + "types": "./dist/esm/skip-last.d.ts", + "default": "./dist/esm/skip-last.js" + }, + "import": { + "types": "./dist/esm/skip-last.d.ts", + "default": "./dist/esm/skip-last.js" + }, + "require": { + "types": "./dist/esm/skip-last.d.ts", + "default": "./dist/esm/skip-last.js" + } + }, + "./skip-until": { + "browser": { + "types": "./dist/esm/skip-until.d.ts", + "default": "./dist/esm/skip-until.js" + }, + "webpack": { + "types": "./dist/esm/skip-until.d.ts", + "default": "./dist/esm/skip-until.js" + }, + "import": { + "types": "./dist/esm/skip-until.d.ts", + "default": "./dist/esm/skip-until.js" + }, + "require": { + "types": "./dist/esm/skip-until.d.ts", + "default": "./dist/esm/skip-until.js" + } + }, + "./skip-while": { + "browser": { + "types": "./dist/esm/skip-while.d.ts", + "default": "./dist/esm/skip-while.js" + }, + "webpack": { + "types": "./dist/esm/skip-while.d.ts", + "default": "./dist/esm/skip-while.js" + }, + "import": { + "types": "./dist/esm/skip-while.d.ts", + "default": "./dist/esm/skip-while.js" + }, + "require": { + "types": "./dist/esm/skip-while.d.ts", + "default": "./dist/esm/skip-while.js" + } + }, + "./start-with": { + "browser": { + "types": "./dist/esm/start-with.d.ts", + "default": "./dist/esm/start-with.js" + }, + "webpack": { + "types": "./dist/esm/start-with.d.ts", + "default": "./dist/esm/start-with.js" + }, + "import": { + "types": "./dist/esm/start-with.d.ts", + "default": "./dist/esm/start-with.js" + }, + "require": { + "types": "./dist/esm/start-with.d.ts", + "default": "./dist/esm/start-with.js" + } + }, + "./static": { + "browser": { + "types": "./dist/esm/static/index.d.ts", + "default": "./dist/esm/static/index.js" + }, + "webpack": { + "types": "./dist/esm/static/index.d.ts", + "default": "./dist/esm/static/index.js" + }, + "import": { + "types": "./dist/esm/static/index.d.ts", + "default": "./dist/esm/static/index.js" + }, + "require": { + "types": "./dist/esm/static/index.d.ts", + "default": "./dist/esm/static/index.js" + } + }, + "./static/animation-frames": { + "browser": { + "types": "./dist/esm/static/animation-frames.d.ts", + "default": "./dist/esm/static/animation-frames.js" + }, + "webpack": { + "types": "./dist/esm/static/animation-frames.d.ts", + "default": "./dist/esm/static/animation-frames.js" + }, + "import": { + "types": "./dist/esm/static/animation-frames.d.ts", + "default": "./dist/esm/static/animation-frames.js" + }, + "require": { + "types": "./dist/esm/static/animation-frames.d.ts", + "default": "./dist/esm/static/animation-frames.js" + } + }, + "./static/combine": { + "browser": { + "types": "./dist/esm/static/combine.d.ts", + "default": "./dist/esm/static/combine.js" + }, + "webpack": { + "types": "./dist/esm/static/combine.d.ts", + "default": "./dist/esm/static/combine.js" + }, + "import": { + "types": "./dist/esm/static/combine.d.ts", + "default": "./dist/esm/static/combine.js" + }, + "require": { + "types": "./dist/esm/static/combine.d.ts", + "default": "./dist/esm/static/combine.js" + } + }, + "./static/combine-latest": { + "browser": { + "types": "./dist/esm/static/combine-latest.d.ts", + "default": "./dist/esm/static/combine-latest.js" + }, + "webpack": { + "types": "./dist/esm/static/combine-latest.d.ts", + "default": "./dist/esm/static/combine-latest.js" + }, + "import": { + "types": "./dist/esm/static/combine-latest.d.ts", + "default": "./dist/esm/static/combine-latest.js" + }, + "require": { + "types": "./dist/esm/static/combine-latest.d.ts", + "default": "./dist/esm/static/combine-latest.js" + } + }, + "./static/concat": { + "browser": { + "types": "./dist/esm/static/concat.d.ts", + "default": "./dist/esm/static/concat.js" + }, + "webpack": { + "types": "./dist/esm/static/concat.d.ts", + "default": "./dist/esm/static/concat.js" + }, + "import": { + "types": "./dist/esm/static/concat.d.ts", + "default": "./dist/esm/static/concat.js" + }, + "require": { + "types": "./dist/esm/static/concat.d.ts", + "default": "./dist/esm/static/concat.js" + } + }, + "./static/fork-join": { + "browser": { + "types": "./dist/esm/static/fork-join.d.ts", + "default": "./dist/esm/static/fork-join.js" + }, + "webpack": { + "types": "./dist/esm/static/fork-join.d.ts", + "default": "./dist/esm/static/fork-join.js" + }, + "import": { + "types": "./dist/esm/static/fork-join.d.ts", + "default": "./dist/esm/static/fork-join.js" + }, + "require": { + "types": "./dist/esm/static/fork-join.d.ts", + "default": "./dist/esm/static/fork-join.js" + } + }, + "./static/generate": { + "browser": { + "types": "./dist/esm/static/generate.d.ts", + "default": "./dist/esm/static/generate.js" + }, + "webpack": { + "types": "./dist/esm/static/generate.d.ts", + "default": "./dist/esm/static/generate.js" + }, + "import": { + "types": "./dist/esm/static/generate.d.ts", + "default": "./dist/esm/static/generate.js" + }, + "require": { + "types": "./dist/esm/static/generate.d.ts", + "default": "./dist/esm/static/generate.js" + } + }, + "./static/interval": { + "browser": { + "types": "./dist/esm/static/interval.d.ts", + "default": "./dist/esm/static/interval.js" + }, + "webpack": { + "types": "./dist/esm/static/interval.d.ts", + "default": "./dist/esm/static/interval.js" + }, + "import": { + "types": "./dist/esm/static/interval.d.ts", + "default": "./dist/esm/static/interval.js" + }, + "require": { + "types": "./dist/esm/static/interval.d.ts", + "default": "./dist/esm/static/interval.js" + } + }, + "./static/merge": { + "browser": { + "types": "./dist/esm/static/merge.d.ts", + "default": "./dist/esm/static/merge.js" + }, + "webpack": { + "types": "./dist/esm/static/merge.d.ts", + "default": "./dist/esm/static/merge.js" + }, + "import": { + "types": "./dist/esm/static/merge.d.ts", + "default": "./dist/esm/static/merge.js" + }, + "require": { + "types": "./dist/esm/static/merge.d.ts", + "default": "./dist/esm/static/merge.js" + } + }, + "./static/on-error-resume-next": { + "browser": { + "types": "./dist/esm/static/on-error-resume-next.d.ts", + "default": "./dist/esm/static/on-error-resume-next.js" + }, + "webpack": { + "types": "./dist/esm/static/on-error-resume-next.d.ts", + "default": "./dist/esm/static/on-error-resume-next.js" + }, + "import": { + "types": "./dist/esm/static/on-error-resume-next.d.ts", + "default": "./dist/esm/static/on-error-resume-next.js" + }, + "require": { + "types": "./dist/esm/static/on-error-resume-next.d.ts", + "default": "./dist/esm/static/on-error-resume-next.js" + } + }, + "./static/partition": { + "browser": { + "types": "./dist/esm/static/partition.d.ts", + "default": "./dist/esm/static/partition.js" + }, + "webpack": { + "types": "./dist/esm/static/partition.d.ts", + "default": "./dist/esm/static/partition.js" + }, + "import": { + "types": "./dist/esm/static/partition.d.ts", + "default": "./dist/esm/static/partition.js" + }, + "require": { + "types": "./dist/esm/static/partition.d.ts", + "default": "./dist/esm/static/partition.js" + } + }, + "./static/race": { + "browser": { + "types": "./dist/esm/static/race.d.ts", + "default": "./dist/esm/static/race.js" + }, + "webpack": { + "types": "./dist/esm/static/race.d.ts", + "default": "./dist/esm/static/race.js" + }, + "import": { + "types": "./dist/esm/static/race.d.ts", + "default": "./dist/esm/static/race.js" + }, + "require": { + "types": "./dist/esm/static/race.d.ts", + "default": "./dist/esm/static/race.js" + } + }, + "./static/timer": { + "browser": { + "types": "./dist/esm/static/timer.d.ts", + "default": "./dist/esm/static/timer.js" + }, + "webpack": { + "types": "./dist/esm/static/timer.d.ts", + "default": "./dist/esm/static/timer.js" + }, + "import": { + "types": "./dist/esm/static/timer.d.ts", + "default": "./dist/esm/static/timer.js" + }, + "require": { + "types": "./dist/esm/static/timer.d.ts", + "default": "./dist/esm/static/timer.js" + } + }, + "./subject": { + "browser": { + "types": "./dist/esm/subject.d.ts", + "default": "./dist/esm/subject.js" + }, + "webpack": { + "types": "./dist/esm/subject.d.ts", + "default": "./dist/esm/subject.js" + }, + "import": { + "types": "./dist/esm/subject.d.ts", + "default": "./dist/esm/subject.js" + }, + "require": { + "types": "./dist/esm/subject.d.ts", + "default": "./dist/esm/subject.js" + } + }, + "./subscribe": { + "browser": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + }, + "webpack": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + }, + "import": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + }, + "require": { + "types": "./dist/esm/pipeable/subscribe.d.ts", + "default": "./dist/esm/pipeable/subscribe.js" + } + }, + "./subscribe-on": { + "browser": { + "types": "./dist/esm/subscribe-on.d.ts", + "default": "./dist/esm/subscribe-on.js" + }, + "webpack": { + "types": "./dist/esm/subscribe-on.d.ts", + "default": "./dist/esm/subscribe-on.js" + }, + "import": { + "types": "./dist/esm/subscribe-on.d.ts", + "default": "./dist/esm/subscribe-on.js" + }, + "require": { + "types": "./dist/esm/subscribe-on.d.ts", + "default": "./dist/esm/subscribe-on.js" + } + }, + "./switch-map": { + "browser": { + "types": "./dist/esm/switch-map.d.ts", + "default": "./dist/esm/switch-map.js" + }, + "webpack": { + "types": "./dist/esm/switch-map.d.ts", + "default": "./dist/esm/switch-map.js" + }, + "import": { + "types": "./dist/esm/switch-map.d.ts", + "default": "./dist/esm/switch-map.js" + }, + "require": { + "types": "./dist/esm/switch-map.d.ts", + "default": "./dist/esm/switch-map.js" + } + }, + "./switch-scan": { + "browser": { + "types": "./dist/esm/switch-scan.d.ts", + "default": "./dist/esm/switch-scan.js" + }, + "webpack": { + "types": "./dist/esm/switch-scan.d.ts", + "default": "./dist/esm/switch-scan.js" + }, + "import": { + "types": "./dist/esm/switch-scan.d.ts", + "default": "./dist/esm/switch-scan.js" + }, + "require": { + "types": "./dist/esm/switch-scan.d.ts", + "default": "./dist/esm/switch-scan.js" + } + }, + "./symbol": { + "browser": { + "types": "./dist/esm/symbol/index.d.ts", + "default": "./dist/esm/symbol/index.js" + }, + "webpack": { + "types": "./dist/esm/symbol/index.d.ts", + "default": "./dist/esm/symbol/index.js" + }, + "import": { + "types": "./dist/esm/symbol/index.d.ts", + "default": "./dist/esm/symbol/index.js" + }, + "require": { + "types": "./dist/esm/symbol/index.d.ts", + "default": "./dist/esm/symbol/index.js" + } + }, + "./symbol/animation-frames": { + "browser": { + "types": "./dist/esm/symbol/animation-frames.d.ts", + "default": "./dist/esm/symbol/animation-frames.js" + }, + "webpack": { + "types": "./dist/esm/symbol/animation-frames.d.ts", + "default": "./dist/esm/symbol/animation-frames.js" + }, + "import": { + "types": "./dist/esm/symbol/animation-frames.d.ts", + "default": "./dist/esm/symbol/animation-frames.js" + }, + "require": { + "types": "./dist/esm/symbol/animation-frames.d.ts", + "default": "./dist/esm/symbol/animation-frames.js" + } + }, + "./symbol/buffer": { + "browser": { + "types": "./dist/esm/symbol/buffer.d.ts", + "default": "./dist/esm/symbol/buffer.js" + }, + "webpack": { + "types": "./dist/esm/symbol/buffer.d.ts", + "default": "./dist/esm/symbol/buffer.js" + }, + "import": { + "types": "./dist/esm/symbol/buffer.d.ts", + "default": "./dist/esm/symbol/buffer.js" + }, + "require": { + "types": "./dist/esm/symbol/buffer.d.ts", + "default": "./dist/esm/symbol/buffer.js" + } + }, + "./symbol/buffer-time": { + "browser": { + "types": "./dist/esm/symbol/buffer-time.d.ts", + "default": "./dist/esm/symbol/buffer-time.js" + }, + "webpack": { + "types": "./dist/esm/symbol/buffer-time.d.ts", + "default": "./dist/esm/symbol/buffer-time.js" + }, + "import": { + "types": "./dist/esm/symbol/buffer-time.d.ts", + "default": "./dist/esm/symbol/buffer-time.js" + }, + "require": { + "types": "./dist/esm/symbol/buffer-time.d.ts", + "default": "./dist/esm/symbol/buffer-time.js" + } + }, + "./symbol/buffer-toggle": { + "browser": { + "types": "./dist/esm/symbol/buffer-toggle.d.ts", + "default": "./dist/esm/symbol/buffer-toggle.js" + }, + "webpack": { + "types": "./dist/esm/symbol/buffer-toggle.d.ts", + "default": "./dist/esm/symbol/buffer-toggle.js" + }, + "import": { + "types": "./dist/esm/symbol/buffer-toggle.d.ts", + "default": "./dist/esm/symbol/buffer-toggle.js" + }, + "require": { + "types": "./dist/esm/symbol/buffer-toggle.d.ts", + "default": "./dist/esm/symbol/buffer-toggle.js" + } + }, + "./symbol/catch-error": { + "browser": { + "types": "./dist/esm/symbol/catch-error.d.ts", + "default": "./dist/esm/symbol/catch-error.js" + }, + "webpack": { + "types": "./dist/esm/symbol/catch-error.d.ts", + "default": "./dist/esm/symbol/catch-error.js" + }, + "import": { + "types": "./dist/esm/symbol/catch-error.d.ts", + "default": "./dist/esm/symbol/catch-error.js" + }, + "require": { + "types": "./dist/esm/symbol/catch-error.d.ts", + "default": "./dist/esm/symbol/catch-error.js" + } + }, + "./symbol/combine": { + "browser": { + "types": "./dist/esm/symbol/combine.d.ts", + "default": "./dist/esm/symbol/combine.js" + }, + "webpack": { + "types": "./dist/esm/symbol/combine.d.ts", + "default": "./dist/esm/symbol/combine.js" + }, + "import": { + "types": "./dist/esm/symbol/combine.d.ts", + "default": "./dist/esm/symbol/combine.js" + }, + "require": { + "types": "./dist/esm/symbol/combine.d.ts", + "default": "./dist/esm/symbol/combine.js" + } + }, + "./symbol/combine-latest": { + "browser": { + "types": "./dist/esm/symbol/combine-latest.d.ts", + "default": "./dist/esm/symbol/combine-latest.js" + }, + "webpack": { + "types": "./dist/esm/symbol/combine-latest.d.ts", + "default": "./dist/esm/symbol/combine-latest.js" + }, + "import": { + "types": "./dist/esm/symbol/combine-latest.d.ts", + "default": "./dist/esm/symbol/combine-latest.js" + }, + "require": { + "types": "./dist/esm/symbol/combine-latest.d.ts", + "default": "./dist/esm/symbol/combine-latest.js" + } + }, + "./symbol/combine-latest-all": { + "browser": { + "types": "./dist/esm/symbol/combine-latest-all.d.ts", + "default": "./dist/esm/symbol/combine-latest-all.js" + }, + "webpack": { + "types": "./dist/esm/symbol/combine-latest-all.d.ts", + "default": "./dist/esm/symbol/combine-latest-all.js" + }, + "import": { + "types": "./dist/esm/symbol/combine-latest-all.d.ts", + "default": "./dist/esm/symbol/combine-latest-all.js" + }, + "require": { + "types": "./dist/esm/symbol/combine-latest-all.d.ts", + "default": "./dist/esm/symbol/combine-latest-all.js" + } + }, + "./symbol/concat": { + "browser": { + "types": "./dist/esm/symbol/concat.d.ts", + "default": "./dist/esm/symbol/concat.js" + }, + "webpack": { + "types": "./dist/esm/symbol/concat.d.ts", + "default": "./dist/esm/symbol/concat.js" + }, + "import": { + "types": "./dist/esm/symbol/concat.d.ts", + "default": "./dist/esm/symbol/concat.js" + }, + "require": { + "types": "./dist/esm/symbol/concat.d.ts", + "default": "./dist/esm/symbol/concat.js" + } + }, + "./symbol/connect": { + "browser": { + "types": "./dist/esm/symbol/connect.d.ts", + "default": "./dist/esm/symbol/connect.js" + }, + "webpack": { + "types": "./dist/esm/symbol/connect.d.ts", + "default": "./dist/esm/symbol/connect.js" + }, + "import": { + "types": "./dist/esm/symbol/connect.d.ts", + "default": "./dist/esm/symbol/connect.js" + }, + "require": { + "types": "./dist/esm/symbol/connect.d.ts", + "default": "./dist/esm/symbol/connect.js" + } + }, + "./symbol/count": { + "browser": { + "types": "./dist/esm/symbol/count.d.ts", + "default": "./dist/esm/symbol/count.js" + }, + "webpack": { + "types": "./dist/esm/symbol/count.d.ts", + "default": "./dist/esm/symbol/count.js" + }, + "import": { + "types": "./dist/esm/symbol/count.d.ts", + "default": "./dist/esm/symbol/count.js" + }, + "require": { + "types": "./dist/esm/symbol/count.d.ts", + "default": "./dist/esm/symbol/count.js" + } + }, + "./symbol/create": { + "browser": { + "types": "./dist/esm/symbol/create.d.ts", + "default": "./dist/esm/symbol/create.js" + }, + "webpack": { + "types": "./dist/esm/symbol/create.d.ts", + "default": "./dist/esm/symbol/create.js" + }, + "import": { + "types": "./dist/esm/symbol/create.d.ts", + "default": "./dist/esm/symbol/create.js" + }, + "require": { + "types": "./dist/esm/symbol/create.d.ts", + "default": "./dist/esm/symbol/create.js" + } + }, + "./symbol/debounce": { + "browser": { + "types": "./dist/esm/symbol/debounce.d.ts", + "default": "./dist/esm/symbol/debounce.js" + }, + "webpack": { + "types": "./dist/esm/symbol/debounce.d.ts", + "default": "./dist/esm/symbol/debounce.js" + }, + "import": { + "types": "./dist/esm/symbol/debounce.d.ts", + "default": "./dist/esm/symbol/debounce.js" + }, + "require": { + "types": "./dist/esm/symbol/debounce.d.ts", + "default": "./dist/esm/symbol/debounce.js" + } + }, + "./symbol/default-if-empty": { + "browser": { + "types": "./dist/esm/symbol/default-if-empty.d.ts", + "default": "./dist/esm/symbol/default-if-empty.js" + }, + "webpack": { + "types": "./dist/esm/symbol/default-if-empty.d.ts", + "default": "./dist/esm/symbol/default-if-empty.js" + }, + "import": { + "types": "./dist/esm/symbol/default-if-empty.d.ts", + "default": "./dist/esm/symbol/default-if-empty.js" + }, + "require": { + "types": "./dist/esm/symbol/default-if-empty.d.ts", + "default": "./dist/esm/symbol/default-if-empty.js" + } + }, + "./symbol/delay": { + "browser": { + "types": "./dist/esm/symbol/delay.d.ts", + "default": "./dist/esm/symbol/delay.js" + }, + "webpack": { + "types": "./dist/esm/symbol/delay.d.ts", + "default": "./dist/esm/symbol/delay.js" + }, + "import": { + "types": "./dist/esm/symbol/delay.d.ts", + "default": "./dist/esm/symbol/delay.js" + }, + "require": { + "types": "./dist/esm/symbol/delay.d.ts", + "default": "./dist/esm/symbol/delay.js" + } + }, + "./symbol/delay-when": { + "browser": { + "types": "./dist/esm/symbol/delay-when.d.ts", + "default": "./dist/esm/symbol/delay-when.js" + }, + "webpack": { + "types": "./dist/esm/symbol/delay-when.d.ts", + "default": "./dist/esm/symbol/delay-when.js" + }, + "import": { + "types": "./dist/esm/symbol/delay-when.d.ts", + "default": "./dist/esm/symbol/delay-when.js" + }, + "require": { + "types": "./dist/esm/symbol/delay-when.d.ts", + "default": "./dist/esm/symbol/delay-when.js" + } + }, + "./symbol/dematerialize": { + "browser": { + "types": "./dist/esm/symbol/dematerialize.d.ts", + "default": "./dist/esm/symbol/dematerialize.js" + }, + "webpack": { + "types": "./dist/esm/symbol/dematerialize.d.ts", + "default": "./dist/esm/symbol/dematerialize.js" + }, + "import": { + "types": "./dist/esm/symbol/dematerialize.d.ts", + "default": "./dist/esm/symbol/dematerialize.js" + }, + "require": { + "types": "./dist/esm/symbol/dematerialize.d.ts", + "default": "./dist/esm/symbol/dematerialize.js" + } + }, + "./symbol/distinct": { + "browser": { + "types": "./dist/esm/symbol/distinct.d.ts", + "default": "./dist/esm/symbol/distinct.js" + }, + "webpack": { + "types": "./dist/esm/symbol/distinct.d.ts", + "default": "./dist/esm/symbol/distinct.js" + }, + "import": { + "types": "./dist/esm/symbol/distinct.d.ts", + "default": "./dist/esm/symbol/distinct.js" + }, + "require": { + "types": "./dist/esm/symbol/distinct.d.ts", + "default": "./dist/esm/symbol/distinct.js" + } + }, + "./symbol/distinct-until-changed": { + "browser": { + "types": "./dist/esm/symbol/distinct-until-changed.d.ts", + "default": "./dist/esm/symbol/distinct-until-changed.js" + }, + "webpack": { + "types": "./dist/esm/symbol/distinct-until-changed.d.ts", + "default": "./dist/esm/symbol/distinct-until-changed.js" + }, + "import": { + "types": "./dist/esm/symbol/distinct-until-changed.d.ts", + "default": "./dist/esm/symbol/distinct-until-changed.js" + }, + "require": { + "types": "./dist/esm/symbol/distinct-until-changed.d.ts", + "default": "./dist/esm/symbol/distinct-until-changed.js" + } + }, + "./symbol/distinct-until-key-changed": { + "browser": { + "types": "./dist/esm/symbol/distinct-until-key-changed.d.ts", + "default": "./dist/esm/symbol/distinct-until-key-changed.js" + }, + "webpack": { + "types": "./dist/esm/symbol/distinct-until-key-changed.d.ts", + "default": "./dist/esm/symbol/distinct-until-key-changed.js" + }, + "import": { + "types": "./dist/esm/symbol/distinct-until-key-changed.d.ts", + "default": "./dist/esm/symbol/distinct-until-key-changed.js" + }, + "require": { + "types": "./dist/esm/symbol/distinct-until-key-changed.d.ts", + "default": "./dist/esm/symbol/distinct-until-key-changed.js" + } + }, + "./symbol/element-at": { + "browser": { + "types": "./dist/esm/symbol/element-at.d.ts", + "default": "./dist/esm/symbol/element-at.js" + }, + "webpack": { + "types": "./dist/esm/symbol/element-at.d.ts", + "default": "./dist/esm/symbol/element-at.js" + }, + "import": { + "types": "./dist/esm/symbol/element-at.d.ts", + "default": "./dist/esm/symbol/element-at.js" + }, + "require": { + "types": "./dist/esm/symbol/element-at.d.ts", + "default": "./dist/esm/symbol/element-at.js" + } + }, + "./symbol/every": { + "browser": { + "types": "./dist/esm/symbol/every.d.ts", + "default": "./dist/esm/symbol/every.js" + }, + "webpack": { + "types": "./dist/esm/symbol/every.d.ts", + "default": "./dist/esm/symbol/every.js" + }, + "import": { + "types": "./dist/esm/symbol/every.d.ts", + "default": "./dist/esm/symbol/every.js" + }, + "require": { + "types": "./dist/esm/symbol/every.d.ts", + "default": "./dist/esm/symbol/every.js" + } + }, + "./symbol/exhaust-map": { + "browser": { + "types": "./dist/esm/symbol/exhaust-map.d.ts", + "default": "./dist/esm/symbol/exhaust-map.js" + }, + "webpack": { + "types": "./dist/esm/symbol/exhaust-map.d.ts", + "default": "./dist/esm/symbol/exhaust-map.js" + }, + "import": { + "types": "./dist/esm/symbol/exhaust-map.d.ts", + "default": "./dist/esm/symbol/exhaust-map.js" + }, + "require": { + "types": "./dist/esm/symbol/exhaust-map.d.ts", + "default": "./dist/esm/symbol/exhaust-map.js" + } + }, + "./symbol/expand": { + "browser": { + "types": "./dist/esm/symbol/expand.d.ts", + "default": "./dist/esm/symbol/expand.js" + }, + "webpack": { + "types": "./dist/esm/symbol/expand.d.ts", + "default": "./dist/esm/symbol/expand.js" + }, + "import": { + "types": "./dist/esm/symbol/expand.d.ts", + "default": "./dist/esm/symbol/expand.js" + }, + "require": { + "types": "./dist/esm/symbol/expand.d.ts", + "default": "./dist/esm/symbol/expand.js" + } + }, + "./symbol/filter": { + "browser": { + "types": "./dist/esm/symbol/filter.d.ts", + "default": "./dist/esm/symbol/filter.js" + }, + "webpack": { + "types": "./dist/esm/symbol/filter.d.ts", + "default": "./dist/esm/symbol/filter.js" + }, + "import": { + "types": "./dist/esm/symbol/filter.d.ts", + "default": "./dist/esm/symbol/filter.js" + }, + "require": { + "types": "./dist/esm/symbol/filter.d.ts", + "default": "./dist/esm/symbol/filter.js" + } + }, + "./symbol/finalize": { + "browser": { + "types": "./dist/esm/symbol/finalize.d.ts", + "default": "./dist/esm/symbol/finalize.js" + }, + "webpack": { + "types": "./dist/esm/symbol/finalize.d.ts", + "default": "./dist/esm/symbol/finalize.js" + }, + "import": { + "types": "./dist/esm/symbol/finalize.d.ts", + "default": "./dist/esm/symbol/finalize.js" + }, + "require": { + "types": "./dist/esm/symbol/finalize.d.ts", + "default": "./dist/esm/symbol/finalize.js" + } + }, + "./symbol/find": { + "browser": { + "types": "./dist/esm/symbol/find.d.ts", + "default": "./dist/esm/symbol/find.js" + }, + "webpack": { + "types": "./dist/esm/symbol/find.d.ts", + "default": "./dist/esm/symbol/find.js" + }, + "import": { + "types": "./dist/esm/symbol/find.d.ts", + "default": "./dist/esm/symbol/find.js" + }, + "require": { + "types": "./dist/esm/symbol/find.d.ts", + "default": "./dist/esm/symbol/find.js" + } + }, + "./symbol/find-index": { + "browser": { + "types": "./dist/esm/symbol/find-index.d.ts", + "default": "./dist/esm/symbol/find-index.js" + }, + "webpack": { + "types": "./dist/esm/symbol/find-index.d.ts", + "default": "./dist/esm/symbol/find-index.js" + }, + "import": { + "types": "./dist/esm/symbol/find-index.d.ts", + "default": "./dist/esm/symbol/find-index.js" + }, + "require": { + "types": "./dist/esm/symbol/find-index.d.ts", + "default": "./dist/esm/symbol/find-index.js" + } + }, + "./symbol/first": { + "browser": { + "types": "./dist/esm/symbol/first.d.ts", + "default": "./dist/esm/symbol/first.js" + }, + "webpack": { + "types": "./dist/esm/symbol/first.d.ts", + "default": "./dist/esm/symbol/first.js" + }, + "import": { + "types": "./dist/esm/symbol/first.d.ts", + "default": "./dist/esm/symbol/first.js" + }, + "require": { + "types": "./dist/esm/symbol/first.d.ts", + "default": "./dist/esm/symbol/first.js" + } + }, + "./symbol/fork-join": { + "browser": { + "types": "./dist/esm/symbol/fork-join.d.ts", + "default": "./dist/esm/symbol/fork-join.js" + }, + "webpack": { + "types": "./dist/esm/symbol/fork-join.d.ts", + "default": "./dist/esm/symbol/fork-join.js" + }, + "import": { + "types": "./dist/esm/symbol/fork-join.d.ts", + "default": "./dist/esm/symbol/fork-join.js" + }, + "require": { + "types": "./dist/esm/symbol/fork-join.d.ts", + "default": "./dist/esm/symbol/fork-join.js" + } + }, + "./symbol/generate": { + "browser": { + "types": "./dist/esm/symbol/generate.d.ts", + "default": "./dist/esm/symbol/generate.js" + }, + "webpack": { + "types": "./dist/esm/symbol/generate.d.ts", + "default": "./dist/esm/symbol/generate.js" + }, + "import": { + "types": "./dist/esm/symbol/generate.d.ts", + "default": "./dist/esm/symbol/generate.js" + }, + "require": { + "types": "./dist/esm/symbol/generate.d.ts", + "default": "./dist/esm/symbol/generate.js" + } + }, + "./symbol/group-by": { + "browser": { + "types": "./dist/esm/symbol/group-by.d.ts", + "default": "./dist/esm/symbol/group-by.js" + }, + "webpack": { + "types": "./dist/esm/symbol/group-by.d.ts", + "default": "./dist/esm/symbol/group-by.js" + }, + "import": { + "types": "./dist/esm/symbol/group-by.d.ts", + "default": "./dist/esm/symbol/group-by.js" + }, + "require": { + "types": "./dist/esm/symbol/group-by.d.ts", + "default": "./dist/esm/symbol/group-by.js" + } + }, + "./symbol/interval": { + "browser": { + "types": "./dist/esm/symbol/interval.d.ts", + "default": "./dist/esm/symbol/interval.js" + }, + "webpack": { + "types": "./dist/esm/symbol/interval.d.ts", + "default": "./dist/esm/symbol/interval.js" + }, + "import": { + "types": "./dist/esm/symbol/interval.d.ts", + "default": "./dist/esm/symbol/interval.js" + }, + "require": { + "types": "./dist/esm/symbol/interval.d.ts", + "default": "./dist/esm/symbol/interval.js" + } + }, + "./symbol/is-empty": { + "browser": { + "types": "./dist/esm/symbol/is-empty.d.ts", + "default": "./dist/esm/symbol/is-empty.js" + }, + "webpack": { + "types": "./dist/esm/symbol/is-empty.d.ts", + "default": "./dist/esm/symbol/is-empty.js" + }, + "import": { + "types": "./dist/esm/symbol/is-empty.d.ts", + "default": "./dist/esm/symbol/is-empty.js" + }, + "require": { + "types": "./dist/esm/symbol/is-empty.d.ts", + "default": "./dist/esm/symbol/is-empty.js" + } + }, + "./symbol/iterate-buffered-values": { + "browser": { + "types": "./dist/esm/symbol/iterate-buffered-values.d.ts", + "default": "./dist/esm/symbol/iterate-buffered-values.js" + }, + "webpack": { + "types": "./dist/esm/symbol/iterate-buffered-values.d.ts", + "default": "./dist/esm/symbol/iterate-buffered-values.js" + }, + "import": { + "types": "./dist/esm/symbol/iterate-buffered-values.d.ts", + "default": "./dist/esm/symbol/iterate-buffered-values.js" + }, + "require": { + "types": "./dist/esm/symbol/iterate-buffered-values.d.ts", + "default": "./dist/esm/symbol/iterate-buffered-values.js" + } + }, + "./symbol/iterate-each-value": { + "browser": { + "types": "./dist/esm/symbol/iterate-each-value.d.ts", + "default": "./dist/esm/symbol/iterate-each-value.js" + }, + "webpack": { + "types": "./dist/esm/symbol/iterate-each-value.d.ts", + "default": "./dist/esm/symbol/iterate-each-value.js" + }, + "import": { + "types": "./dist/esm/symbol/iterate-each-value.d.ts", + "default": "./dist/esm/symbol/iterate-each-value.js" + }, + "require": { + "types": "./dist/esm/symbol/iterate-each-value.d.ts", + "default": "./dist/esm/symbol/iterate-each-value.js" + } + }, + "./symbol/iterate-latest-value": { + "browser": { + "types": "./dist/esm/symbol/iterate-latest-value.d.ts", + "default": "./dist/esm/symbol/iterate-latest-value.js" + }, + "webpack": { + "types": "./dist/esm/symbol/iterate-latest-value.d.ts", + "default": "./dist/esm/symbol/iterate-latest-value.js" + }, + "import": { + "types": "./dist/esm/symbol/iterate-latest-value.d.ts", + "default": "./dist/esm/symbol/iterate-latest-value.js" + }, + "require": { + "types": "./dist/esm/symbol/iterate-latest-value.d.ts", + "default": "./dist/esm/symbol/iterate-latest-value.js" + } + }, + "./symbol/iterate-next-value": { + "browser": { + "types": "./dist/esm/symbol/iterate-next-value.d.ts", + "default": "./dist/esm/symbol/iterate-next-value.js" + }, + "webpack": { + "types": "./dist/esm/symbol/iterate-next-value.d.ts", + "default": "./dist/esm/symbol/iterate-next-value.js" + }, + "import": { + "types": "./dist/esm/symbol/iterate-next-value.d.ts", + "default": "./dist/esm/symbol/iterate-next-value.js" + }, + "require": { + "types": "./dist/esm/symbol/iterate-next-value.d.ts", + "default": "./dist/esm/symbol/iterate-next-value.js" + } + }, + "./symbol/last": { + "browser": { + "types": "./dist/esm/symbol/last.d.ts", + "default": "./dist/esm/symbol/last.js" + }, + "webpack": { + "types": "./dist/esm/symbol/last.d.ts", + "default": "./dist/esm/symbol/last.js" + }, + "import": { + "types": "./dist/esm/symbol/last.d.ts", + "default": "./dist/esm/symbol/last.js" + }, + "require": { + "types": "./dist/esm/symbol/last.d.ts", + "default": "./dist/esm/symbol/last.js" + } + }, + "./symbol/map": { + "browser": { + "types": "./dist/esm/symbol/map.d.ts", + "default": "./dist/esm/symbol/map.js" + }, + "webpack": { + "types": "./dist/esm/symbol/map.d.ts", + "default": "./dist/esm/symbol/map.js" + }, + "import": { + "types": "./dist/esm/symbol/map.d.ts", + "default": "./dist/esm/symbol/map.js" + }, + "require": { + "types": "./dist/esm/symbol/map.d.ts", + "default": "./dist/esm/symbol/map.js" + } + }, + "./symbol/materialize": { + "browser": { + "types": "./dist/esm/symbol/materialize.d.ts", + "default": "./dist/esm/symbol/materialize.js" + }, + "webpack": { + "types": "./dist/esm/symbol/materialize.d.ts", + "default": "./dist/esm/symbol/materialize.js" + }, + "import": { + "types": "./dist/esm/symbol/materialize.d.ts", + "default": "./dist/esm/symbol/materialize.js" + }, + "require": { + "types": "./dist/esm/symbol/materialize.d.ts", + "default": "./dist/esm/symbol/materialize.js" + } + }, + "./symbol/max": { + "browser": { + "types": "./dist/esm/symbol/max.d.ts", + "default": "./dist/esm/symbol/max.js" + }, + "webpack": { + "types": "./dist/esm/symbol/max.d.ts", + "default": "./dist/esm/symbol/max.js" + }, + "import": { + "types": "./dist/esm/symbol/max.d.ts", + "default": "./dist/esm/symbol/max.js" + }, + "require": { + "types": "./dist/esm/symbol/max.d.ts", + "default": "./dist/esm/symbol/max.js" + } + }, + "./symbol/merge": { + "browser": { + "types": "./dist/esm/symbol/merge.d.ts", + "default": "./dist/esm/symbol/merge.js" + }, + "webpack": { + "types": "./dist/esm/symbol/merge.d.ts", + "default": "./dist/esm/symbol/merge.js" + }, + "import": { + "types": "./dist/esm/symbol/merge.d.ts", + "default": "./dist/esm/symbol/merge.js" + }, + "require": { + "types": "./dist/esm/symbol/merge.d.ts", + "default": "./dist/esm/symbol/merge.js" + } + }, + "./symbol/merge-map": { + "browser": { + "types": "./dist/esm/symbol/merge-map.d.ts", + "default": "./dist/esm/symbol/merge-map.js" + }, + "webpack": { + "types": "./dist/esm/symbol/merge-map.d.ts", + "default": "./dist/esm/symbol/merge-map.js" + }, + "import": { + "types": "./dist/esm/symbol/merge-map.d.ts", + "default": "./dist/esm/symbol/merge-map.js" + }, + "require": { + "types": "./dist/esm/symbol/merge-map.d.ts", + "default": "./dist/esm/symbol/merge-map.js" + } + }, + "./symbol/merge-scan": { + "browser": { + "types": "./dist/esm/symbol/merge-scan.d.ts", + "default": "./dist/esm/symbol/merge-scan.js" + }, + "webpack": { + "types": "./dist/esm/symbol/merge-scan.d.ts", + "default": "./dist/esm/symbol/merge-scan.js" + }, + "import": { + "types": "./dist/esm/symbol/merge-scan.d.ts", + "default": "./dist/esm/symbol/merge-scan.js" + }, + "require": { + "types": "./dist/esm/symbol/merge-scan.d.ts", + "default": "./dist/esm/symbol/merge-scan.js" + } + }, + "./symbol/min": { + "browser": { + "types": "./dist/esm/symbol/min.d.ts", + "default": "./dist/esm/symbol/min.js" + }, + "webpack": { + "types": "./dist/esm/symbol/min.d.ts", + "default": "./dist/esm/symbol/min.js" + }, + "import": { + "types": "./dist/esm/symbol/min.d.ts", + "default": "./dist/esm/symbol/min.js" + }, + "require": { + "types": "./dist/esm/symbol/min.d.ts", + "default": "./dist/esm/symbol/min.js" + } + }, + "./symbol/multicast": { + "browser": { + "types": "./dist/esm/symbol/multicast.d.ts", + "default": "./dist/esm/symbol/multicast.js" + }, + "webpack": { + "types": "./dist/esm/symbol/multicast.d.ts", + "default": "./dist/esm/symbol/multicast.js" + }, + "import": { + "types": "./dist/esm/symbol/multicast.d.ts", + "default": "./dist/esm/symbol/multicast.js" + }, + "require": { + "types": "./dist/esm/symbol/multicast.d.ts", + "default": "./dist/esm/symbol/multicast.js" + } + }, + "./symbol/observe-on": { + "browser": { + "types": "./dist/esm/symbol/observe-on.d.ts", + "default": "./dist/esm/symbol/observe-on.js" + }, + "webpack": { + "types": "./dist/esm/symbol/observe-on.d.ts", + "default": "./dist/esm/symbol/observe-on.js" + }, + "import": { + "types": "./dist/esm/symbol/observe-on.d.ts", + "default": "./dist/esm/symbol/observe-on.js" + }, + "require": { + "types": "./dist/esm/symbol/observe-on.d.ts", + "default": "./dist/esm/symbol/observe-on.js" + } + }, + "./symbol/on-error-resume-next": { + "browser": { + "types": "./dist/esm/symbol/on-error-resume-next.d.ts", + "default": "./dist/esm/symbol/on-error-resume-next.js" + }, + "webpack": { + "types": "./dist/esm/symbol/on-error-resume-next.d.ts", + "default": "./dist/esm/symbol/on-error-resume-next.js" + }, + "import": { + "types": "./dist/esm/symbol/on-error-resume-next.d.ts", + "default": "./dist/esm/symbol/on-error-resume-next.js" + }, + "require": { + "types": "./dist/esm/symbol/on-error-resume-next.d.ts", + "default": "./dist/esm/symbol/on-error-resume-next.js" + } + }, + "./symbol/pairwise": { + "browser": { + "types": "./dist/esm/symbol/pairwise.d.ts", + "default": "./dist/esm/symbol/pairwise.js" + }, + "webpack": { + "types": "./dist/esm/symbol/pairwise.d.ts", + "default": "./dist/esm/symbol/pairwise.js" + }, + "import": { + "types": "./dist/esm/symbol/pairwise.d.ts", + "default": "./dist/esm/symbol/pairwise.js" + }, + "require": { + "types": "./dist/esm/symbol/pairwise.d.ts", + "default": "./dist/esm/symbol/pairwise.js" + } + }, + "./symbol/partition": { + "browser": { + "types": "./dist/esm/symbol/partition.d.ts", + "default": "./dist/esm/symbol/partition.js" + }, + "webpack": { + "types": "./dist/esm/symbol/partition.d.ts", + "default": "./dist/esm/symbol/partition.js" + }, + "import": { + "types": "./dist/esm/symbol/partition.d.ts", + "default": "./dist/esm/symbol/partition.js" + }, + "require": { + "types": "./dist/esm/symbol/partition.d.ts", + "default": "./dist/esm/symbol/partition.js" + } + }, + "./symbol/pipe": { + "browser": { + "types": "./dist/esm/symbol/pipe.d.ts", + "default": "./dist/esm/symbol/pipe.js" + }, + "webpack": { + "types": "./dist/esm/symbol/pipe.d.ts", + "default": "./dist/esm/symbol/pipe.js" + }, + "import": { + "types": "./dist/esm/symbol/pipe.d.ts", + "default": "./dist/esm/symbol/pipe.js" + }, + "require": { + "types": "./dist/esm/symbol/pipe.d.ts", + "default": "./dist/esm/symbol/pipe.js" + } + }, + "./symbol/pluck": { + "browser": { + "types": "./dist/esm/symbol/pluck.d.ts", + "default": "./dist/esm/symbol/pluck.js" + }, + "webpack": { + "types": "./dist/esm/symbol/pluck.d.ts", + "default": "./dist/esm/symbol/pluck.js" + }, + "import": { + "types": "./dist/esm/symbol/pluck.d.ts", + "default": "./dist/esm/symbol/pluck.js" + }, + "require": { + "types": "./dist/esm/symbol/pluck.d.ts", + "default": "./dist/esm/symbol/pluck.js" + } + }, + "./symbol/publish": { + "browser": { + "types": "./dist/esm/symbol/publish.d.ts", + "default": "./dist/esm/symbol/publish.js" + }, + "webpack": { + "types": "./dist/esm/symbol/publish.d.ts", + "default": "./dist/esm/symbol/publish.js" + }, + "import": { + "types": "./dist/esm/symbol/publish.d.ts", + "default": "./dist/esm/symbol/publish.js" + }, + "require": { + "types": "./dist/esm/symbol/publish.d.ts", + "default": "./dist/esm/symbol/publish.js" + } + }, + "./symbol/publish-behavior": { + "browser": { + "types": "./dist/esm/symbol/publish-behavior.d.ts", + "default": "./dist/esm/symbol/publish-behavior.js" + }, + "webpack": { + "types": "./dist/esm/symbol/publish-behavior.d.ts", + "default": "./dist/esm/symbol/publish-behavior.js" + }, + "import": { + "types": "./dist/esm/symbol/publish-behavior.d.ts", + "default": "./dist/esm/symbol/publish-behavior.js" + }, + "require": { + "types": "./dist/esm/symbol/publish-behavior.d.ts", + "default": "./dist/esm/symbol/publish-behavior.js" + } + }, + "./symbol/publish-last": { + "browser": { + "types": "./dist/esm/symbol/publish-last.d.ts", + "default": "./dist/esm/symbol/publish-last.js" + }, + "webpack": { + "types": "./dist/esm/symbol/publish-last.d.ts", + "default": "./dist/esm/symbol/publish-last.js" + }, + "import": { + "types": "./dist/esm/symbol/publish-last.d.ts", + "default": "./dist/esm/symbol/publish-last.js" + }, + "require": { + "types": "./dist/esm/symbol/publish-last.d.ts", + "default": "./dist/esm/symbol/publish-last.js" + } + }, + "./symbol/publish-replay": { + "browser": { + "types": "./dist/esm/symbol/publish-replay.d.ts", + "default": "./dist/esm/symbol/publish-replay.js" + }, + "webpack": { + "types": "./dist/esm/symbol/publish-replay.d.ts", + "default": "./dist/esm/symbol/publish-replay.js" + }, + "import": { + "types": "./dist/esm/symbol/publish-replay.d.ts", + "default": "./dist/esm/symbol/publish-replay.js" + }, + "require": { + "types": "./dist/esm/symbol/publish-replay.d.ts", + "default": "./dist/esm/symbol/publish-replay.js" + } + }, + "./symbol/race": { + "browser": { + "types": "./dist/esm/symbol/race.d.ts", + "default": "./dist/esm/symbol/race.js" + }, + "webpack": { + "types": "./dist/esm/symbol/race.d.ts", + "default": "./dist/esm/symbol/race.js" + }, + "import": { + "types": "./dist/esm/symbol/race.d.ts", + "default": "./dist/esm/symbol/race.js" + }, + "require": { + "types": "./dist/esm/symbol/race.d.ts", + "default": "./dist/esm/symbol/race.js" + } + }, + "./symbol/reduce": { + "browser": { + "types": "./dist/esm/symbol/reduce.d.ts", + "default": "./dist/esm/symbol/reduce.js" + }, + "webpack": { + "types": "./dist/esm/symbol/reduce.d.ts", + "default": "./dist/esm/symbol/reduce.js" + }, + "import": { + "types": "./dist/esm/symbol/reduce.d.ts", + "default": "./dist/esm/symbol/reduce.js" + }, + "require": { + "types": "./dist/esm/symbol/reduce.d.ts", + "default": "./dist/esm/symbol/reduce.js" + } + }, + "./symbol/ref-count": { + "browser": { + "types": "./dist/esm/symbol/ref-count.d.ts", + "default": "./dist/esm/symbol/ref-count.js" + }, + "webpack": { + "types": "./dist/esm/symbol/ref-count.d.ts", + "default": "./dist/esm/symbol/ref-count.js" + }, + "import": { + "types": "./dist/esm/symbol/ref-count.d.ts", + "default": "./dist/esm/symbol/ref-count.js" + }, + "require": { + "types": "./dist/esm/symbol/ref-count.d.ts", + "default": "./dist/esm/symbol/ref-count.js" + } + }, + "./symbol/repeat": { + "browser": { + "types": "./dist/esm/symbol/repeat.d.ts", + "default": "./dist/esm/symbol/repeat.js" + }, + "webpack": { + "types": "./dist/esm/symbol/repeat.d.ts", + "default": "./dist/esm/symbol/repeat.js" + }, + "import": { + "types": "./dist/esm/symbol/repeat.d.ts", + "default": "./dist/esm/symbol/repeat.js" + }, + "require": { + "types": "./dist/esm/symbol/repeat.d.ts", + "default": "./dist/esm/symbol/repeat.js" + } + }, + "./symbol/repeat-when": { + "browser": { + "types": "./dist/esm/symbol/repeat-when.d.ts", + "default": "./dist/esm/symbol/repeat-when.js" + }, + "webpack": { + "types": "./dist/esm/symbol/repeat-when.d.ts", + "default": "./dist/esm/symbol/repeat-when.js" + }, + "import": { + "types": "./dist/esm/symbol/repeat-when.d.ts", + "default": "./dist/esm/symbol/repeat-when.js" + }, + "require": { + "types": "./dist/esm/symbol/repeat-when.d.ts", + "default": "./dist/esm/symbol/repeat-when.js" + } + }, + "./symbol/retry": { + "browser": { + "types": "./dist/esm/symbol/retry.d.ts", + "default": "./dist/esm/symbol/retry.js" + }, + "webpack": { + "types": "./dist/esm/symbol/retry.d.ts", + "default": "./dist/esm/symbol/retry.js" + }, + "import": { + "types": "./dist/esm/symbol/retry.d.ts", + "default": "./dist/esm/symbol/retry.js" + }, + "require": { + "types": "./dist/esm/symbol/retry.d.ts", + "default": "./dist/esm/symbol/retry.js" + } + }, + "./symbol/retry-when": { + "browser": { + "types": "./dist/esm/symbol/retry-when.d.ts", + "default": "./dist/esm/symbol/retry-when.js" + }, + "webpack": { + "types": "./dist/esm/symbol/retry-when.d.ts", + "default": "./dist/esm/symbol/retry-when.js" + }, + "import": { + "types": "./dist/esm/symbol/retry-when.d.ts", + "default": "./dist/esm/symbol/retry-when.js" + }, + "require": { + "types": "./dist/esm/symbol/retry-when.d.ts", + "default": "./dist/esm/symbol/retry-when.js" + } + }, + "./symbol/sample": { + "browser": { + "types": "./dist/esm/symbol/sample.d.ts", + "default": "./dist/esm/symbol/sample.js" + }, + "webpack": { + "types": "./dist/esm/symbol/sample.d.ts", + "default": "./dist/esm/symbol/sample.js" + }, + "import": { + "types": "./dist/esm/symbol/sample.d.ts", + "default": "./dist/esm/symbol/sample.js" + }, + "require": { + "types": "./dist/esm/symbol/sample.d.ts", + "default": "./dist/esm/symbol/sample.js" + } + }, + "./symbol/sample-time": { + "browser": { + "types": "./dist/esm/symbol/sample-time.d.ts", + "default": "./dist/esm/symbol/sample-time.js" + }, + "webpack": { + "types": "./dist/esm/symbol/sample-time.d.ts", + "default": "./dist/esm/symbol/sample-time.js" + }, + "import": { + "types": "./dist/esm/symbol/sample-time.d.ts", + "default": "./dist/esm/symbol/sample-time.js" + }, + "require": { + "types": "./dist/esm/symbol/sample-time.d.ts", + "default": "./dist/esm/symbol/sample-time.js" + } + }, + "./symbol/scan": { + "browser": { + "types": "./dist/esm/symbol/scan.d.ts", + "default": "./dist/esm/symbol/scan.js" + }, + "webpack": { + "types": "./dist/esm/symbol/scan.d.ts", + "default": "./dist/esm/symbol/scan.js" + }, + "import": { + "types": "./dist/esm/symbol/scan.d.ts", + "default": "./dist/esm/symbol/scan.js" + }, + "require": { + "types": "./dist/esm/symbol/scan.d.ts", + "default": "./dist/esm/symbol/scan.js" + } + }, + "./symbol/sequence-equal": { + "browser": { + "types": "./dist/esm/symbol/sequence-equal.d.ts", + "default": "./dist/esm/symbol/sequence-equal.js" + }, + "webpack": { + "types": "./dist/esm/symbol/sequence-equal.d.ts", + "default": "./dist/esm/symbol/sequence-equal.js" + }, + "import": { + "types": "./dist/esm/symbol/sequence-equal.d.ts", + "default": "./dist/esm/symbol/sequence-equal.js" + }, + "require": { + "types": "./dist/esm/symbol/sequence-equal.d.ts", + "default": "./dist/esm/symbol/sequence-equal.js" + } + }, + "./symbol/share": { + "browser": { + "types": "./dist/esm/symbol/share.d.ts", + "default": "./dist/esm/symbol/share.js" + }, + "webpack": { + "types": "./dist/esm/symbol/share.d.ts", + "default": "./dist/esm/symbol/share.js" + }, + "import": { + "types": "./dist/esm/symbol/share.d.ts", + "default": "./dist/esm/symbol/share.js" + }, + "require": { + "types": "./dist/esm/symbol/share.d.ts", + "default": "./dist/esm/symbol/share.js" + } + }, + "./symbol/share-replay": { + "browser": { + "types": "./dist/esm/symbol/share-replay.d.ts", + "default": "./dist/esm/symbol/share-replay.js" + }, + "webpack": { + "types": "./dist/esm/symbol/share-replay.d.ts", + "default": "./dist/esm/symbol/share-replay.js" + }, + "import": { + "types": "./dist/esm/symbol/share-replay.d.ts", + "default": "./dist/esm/symbol/share-replay.js" + }, + "require": { + "types": "./dist/esm/symbol/share-replay.d.ts", + "default": "./dist/esm/symbol/share-replay.js" + } + }, + "./symbol/single": { + "browser": { + "types": "./dist/esm/symbol/single.d.ts", + "default": "./dist/esm/symbol/single.js" }, "webpack": { - "types": "./dist/esm/sequence-error.d.ts", - "default": "./dist/esm/sequence-error.js" + "types": "./dist/esm/symbol/single.d.ts", + "default": "./dist/esm/symbol/single.js" }, "import": { - "types": "./dist/esm/sequence-error.d.ts", - "default": "./dist/esm/sequence-error.js" + "types": "./dist/esm/symbol/single.d.ts", + "default": "./dist/esm/symbol/single.js" }, "require": { - "types": "./dist/esm/sequence-error.d.ts", - "default": "./dist/esm/sequence-error.js" + "types": "./dist/esm/symbol/single.d.ts", + "default": "./dist/esm/symbol/single.js" } }, - "./share": { + "./symbol/skip": { "browser": { - "types": "./dist/esm/share.d.ts", - "default": "./dist/esm/share.js" + "types": "./dist/esm/symbol/skip.d.ts", + "default": "./dist/esm/symbol/skip.js" }, "webpack": { - "types": "./dist/esm/share.d.ts", - "default": "./dist/esm/share.js" + "types": "./dist/esm/symbol/skip.d.ts", + "default": "./dist/esm/symbol/skip.js" }, "import": { - "types": "./dist/esm/share.d.ts", - "default": "./dist/esm/share.js" + "types": "./dist/esm/symbol/skip.d.ts", + "default": "./dist/esm/symbol/skip.js" }, "require": { - "types": "./dist/esm/share.d.ts", - "default": "./dist/esm/share.js" + "types": "./dist/esm/symbol/skip.d.ts", + "default": "./dist/esm/symbol/skip.js" } }, - "./share-replay": { + "./symbol/skip-last": { "browser": { - "types": "./dist/esm/share-replay.d.ts", - "default": "./dist/esm/share-replay.js" + "types": "./dist/esm/symbol/skip-last.d.ts", + "default": "./dist/esm/symbol/skip-last.js" }, "webpack": { - "types": "./dist/esm/share-replay.d.ts", - "default": "./dist/esm/share-replay.js" + "types": "./dist/esm/symbol/skip-last.d.ts", + "default": "./dist/esm/symbol/skip-last.js" }, "import": { - "types": "./dist/esm/share-replay.d.ts", - "default": "./dist/esm/share-replay.js" + "types": "./dist/esm/symbol/skip-last.d.ts", + "default": "./dist/esm/symbol/skip-last.js" }, "require": { - "types": "./dist/esm/share-replay.d.ts", - "default": "./dist/esm/share-replay.js" + "types": "./dist/esm/symbol/skip-last.d.ts", + "default": "./dist/esm/symbol/skip-last.js" } }, - "./single": { + "./symbol/skip-until": { "browser": { - "types": "./dist/esm/single.d.ts", - "default": "./dist/esm/single.js" + "types": "./dist/esm/symbol/skip-until.d.ts", + "default": "./dist/esm/symbol/skip-until.js" }, "webpack": { - "types": "./dist/esm/single.d.ts", - "default": "./dist/esm/single.js" + "types": "./dist/esm/symbol/skip-until.d.ts", + "default": "./dist/esm/symbol/skip-until.js" }, "import": { - "types": "./dist/esm/single.d.ts", - "default": "./dist/esm/single.js" + "types": "./dist/esm/symbol/skip-until.d.ts", + "default": "./dist/esm/symbol/skip-until.js" }, "require": { - "types": "./dist/esm/single.d.ts", - "default": "./dist/esm/single.js" + "types": "./dist/esm/symbol/skip-until.d.ts", + "default": "./dist/esm/symbol/skip-until.js" } }, - "./skip": { + "./symbol/skip-while": { "browser": { - "types": "./dist/esm/skip.d.ts", - "default": "./dist/esm/skip.js" + "types": "./dist/esm/symbol/skip-while.d.ts", + "default": "./dist/esm/symbol/skip-while.js" }, "webpack": { - "types": "./dist/esm/skip.d.ts", - "default": "./dist/esm/skip.js" + "types": "./dist/esm/symbol/skip-while.d.ts", + "default": "./dist/esm/symbol/skip-while.js" }, "import": { - "types": "./dist/esm/skip.d.ts", - "default": "./dist/esm/skip.js" + "types": "./dist/esm/symbol/skip-while.d.ts", + "default": "./dist/esm/symbol/skip-while.js" }, "require": { - "types": "./dist/esm/skip.d.ts", - "default": "./dist/esm/skip.js" + "types": "./dist/esm/symbol/skip-while.d.ts", + "default": "./dist/esm/symbol/skip-while.js" } }, - "./skip-last": { + "./symbol/start-with": { "browser": { - "types": "./dist/esm/skip-last.d.ts", - "default": "./dist/esm/skip-last.js" + "types": "./dist/esm/symbol/start-with.d.ts", + "default": "./dist/esm/symbol/start-with.js" }, "webpack": { - "types": "./dist/esm/skip-last.d.ts", - "default": "./dist/esm/skip-last.js" + "types": "./dist/esm/symbol/start-with.d.ts", + "default": "./dist/esm/symbol/start-with.js" }, "import": { - "types": "./dist/esm/skip-last.d.ts", - "default": "./dist/esm/skip-last.js" + "types": "./dist/esm/symbol/start-with.d.ts", + "default": "./dist/esm/symbol/start-with.js" }, "require": { - "types": "./dist/esm/skip-last.d.ts", - "default": "./dist/esm/skip-last.js" + "types": "./dist/esm/symbol/start-with.d.ts", + "default": "./dist/esm/symbol/start-with.js" } }, - "./skip-until": { + "./symbol/subscribe-on": { "browser": { - "types": "./dist/esm/skip-until.d.ts", - "default": "./dist/esm/skip-until.js" + "types": "./dist/esm/symbol/subscribe-on.d.ts", + "default": "./dist/esm/symbol/subscribe-on.js" }, "webpack": { - "types": "./dist/esm/skip-until.d.ts", - "default": "./dist/esm/skip-until.js" + "types": "./dist/esm/symbol/subscribe-on.d.ts", + "default": "./dist/esm/symbol/subscribe-on.js" }, "import": { - "types": "./dist/esm/skip-until.d.ts", - "default": "./dist/esm/skip-until.js" + "types": "./dist/esm/symbol/subscribe-on.d.ts", + "default": "./dist/esm/symbol/subscribe-on.js" }, "require": { - "types": "./dist/esm/skip-until.d.ts", - "default": "./dist/esm/skip-until.js" + "types": "./dist/esm/symbol/subscribe-on.d.ts", + "default": "./dist/esm/symbol/subscribe-on.js" } }, - "./skip-while": { + "./symbol/switch-map": { "browser": { - "types": "./dist/esm/skip-while.d.ts", - "default": "./dist/esm/skip-while.js" + "types": "./dist/esm/symbol/switch-map.d.ts", + "default": "./dist/esm/symbol/switch-map.js" }, "webpack": { - "types": "./dist/esm/skip-while.d.ts", - "default": "./dist/esm/skip-while.js" + "types": "./dist/esm/symbol/switch-map.d.ts", + "default": "./dist/esm/symbol/switch-map.js" }, "import": { - "types": "./dist/esm/skip-while.d.ts", - "default": "./dist/esm/skip-while.js" + "types": "./dist/esm/symbol/switch-map.d.ts", + "default": "./dist/esm/symbol/switch-map.js" }, "require": { - "types": "./dist/esm/skip-while.d.ts", - "default": "./dist/esm/skip-while.js" + "types": "./dist/esm/symbol/switch-map.d.ts", + "default": "./dist/esm/symbol/switch-map.js" } }, - "./start-with": { + "./symbol/switch-scan": { "browser": { - "types": "./dist/esm/start-with.d.ts", - "default": "./dist/esm/start-with.js" + "types": "./dist/esm/symbol/switch-scan.d.ts", + "default": "./dist/esm/symbol/switch-scan.js" }, "webpack": { - "types": "./dist/esm/start-with.d.ts", - "default": "./dist/esm/start-with.js" + "types": "./dist/esm/symbol/switch-scan.d.ts", + "default": "./dist/esm/symbol/switch-scan.js" }, "import": { - "types": "./dist/esm/start-with.d.ts", - "default": "./dist/esm/start-with.js" + "types": "./dist/esm/symbol/switch-scan.d.ts", + "default": "./dist/esm/symbol/switch-scan.js" }, "require": { - "types": "./dist/esm/start-with.d.ts", - "default": "./dist/esm/start-with.js" + "types": "./dist/esm/symbol/switch-scan.d.ts", + "default": "./dist/esm/symbol/switch-scan.js" } }, - "./subject": { + "./symbol/take": { "browser": { - "types": "./dist/esm/subject.d.ts", - "default": "./dist/esm/subject.js" + "types": "./dist/esm/symbol/take.d.ts", + "default": "./dist/esm/symbol/take.js" }, "webpack": { - "types": "./dist/esm/subject.d.ts", - "default": "./dist/esm/subject.js" + "types": "./dist/esm/symbol/take.d.ts", + "default": "./dist/esm/symbol/take.js" }, "import": { - "types": "./dist/esm/subject.d.ts", - "default": "./dist/esm/subject.js" + "types": "./dist/esm/symbol/take.d.ts", + "default": "./dist/esm/symbol/take.js" }, "require": { - "types": "./dist/esm/subject.d.ts", - "default": "./dist/esm/subject.js" + "types": "./dist/esm/symbol/take.d.ts", + "default": "./dist/esm/symbol/take.js" } }, - "./subscribe": { + "./symbol/take-last": { "browser": { - "types": "./dist/esm/pipeable/subscribe.d.ts", - "default": "./dist/esm/pipeable/subscribe.js" + "types": "./dist/esm/symbol/take-last.d.ts", + "default": "./dist/esm/symbol/take-last.js" }, "webpack": { - "types": "./dist/esm/pipeable/subscribe.d.ts", - "default": "./dist/esm/pipeable/subscribe.js" + "types": "./dist/esm/symbol/take-last.d.ts", + "default": "./dist/esm/symbol/take-last.js" }, "import": { - "types": "./dist/esm/pipeable/subscribe.d.ts", - "default": "./dist/esm/pipeable/subscribe.js" + "types": "./dist/esm/symbol/take-last.d.ts", + "default": "./dist/esm/symbol/take-last.js" }, "require": { - "types": "./dist/esm/pipeable/subscribe.d.ts", - "default": "./dist/esm/pipeable/subscribe.js" + "types": "./dist/esm/symbol/take-last.d.ts", + "default": "./dist/esm/symbol/take-last.js" } }, - "./subscribe-on": { + "./symbol/take-until": { "browser": { - "types": "./dist/esm/subscribe-on.d.ts", - "default": "./dist/esm/subscribe-on.js" + "types": "./dist/esm/symbol/take-until.d.ts", + "default": "./dist/esm/symbol/take-until.js" }, "webpack": { - "types": "./dist/esm/subscribe-on.d.ts", - "default": "./dist/esm/subscribe-on.js" + "types": "./dist/esm/symbol/take-until.d.ts", + "default": "./dist/esm/symbol/take-until.js" }, "import": { - "types": "./dist/esm/subscribe-on.d.ts", - "default": "./dist/esm/subscribe-on.js" + "types": "./dist/esm/symbol/take-until.d.ts", + "default": "./dist/esm/symbol/take-until.js" }, "require": { - "types": "./dist/esm/subscribe-on.d.ts", - "default": "./dist/esm/subscribe-on.js" + "types": "./dist/esm/symbol/take-until.d.ts", + "default": "./dist/esm/symbol/take-until.js" } }, - "./symbol/filter": { + "./symbol/take-while": { "browser": { - "types": "./dist/esm/filter.d.ts", - "default": "./dist/esm/filter.js" + "types": "./dist/esm/symbol/take-while.d.ts", + "default": "./dist/esm/symbol/take-while.js" }, "webpack": { - "types": "./dist/esm/filter.d.ts", - "default": "./dist/esm/filter.js" + "types": "./dist/esm/symbol/take-while.d.ts", + "default": "./dist/esm/symbol/take-while.js" }, "import": { - "types": "./dist/esm/filter.d.ts", - "default": "./dist/esm/filter.js" + "types": "./dist/esm/symbol/take-while.d.ts", + "default": "./dist/esm/symbol/take-while.js" }, "require": { - "types": "./dist/esm/filter.d.ts", - "default": "./dist/esm/filter.js" + "types": "./dist/esm/symbol/take-while.d.ts", + "default": "./dist/esm/symbol/take-while.js" } }, - "./symbol/map": { + "./symbol/tap": { "browser": { - "types": "./dist/esm/map.d.ts", - "default": "./dist/esm/map.js" + "types": "./dist/esm/symbol/tap.d.ts", + "default": "./dist/esm/symbol/tap.js" }, "webpack": { - "types": "./dist/esm/map.d.ts", - "default": "./dist/esm/map.js" + "types": "./dist/esm/symbol/tap.d.ts", + "default": "./dist/esm/symbol/tap.js" }, "import": { - "types": "./dist/esm/map.d.ts", - "default": "./dist/esm/map.js" + "types": "./dist/esm/symbol/tap.d.ts", + "default": "./dist/esm/symbol/tap.js" }, "require": { - "types": "./dist/esm/map.d.ts", - "default": "./dist/esm/map.js" + "types": "./dist/esm/symbol/tap.d.ts", + "default": "./dist/esm/symbol/tap.js" } }, - "./symbol/take": { + "./symbol/throttle": { "browser": { - "types": "./dist/esm/take.d.ts", - "default": "./dist/esm/take.js" + "types": "./dist/esm/symbol/throttle.d.ts", + "default": "./dist/esm/symbol/throttle.js" }, "webpack": { - "types": "./dist/esm/take.d.ts", - "default": "./dist/esm/take.js" + "types": "./dist/esm/symbol/throttle.d.ts", + "default": "./dist/esm/symbol/throttle.js" }, "import": { - "types": "./dist/esm/take.d.ts", - "default": "./dist/esm/take.js" + "types": "./dist/esm/symbol/throttle.d.ts", + "default": "./dist/esm/symbol/throttle.js" }, "require": { - "types": "./dist/esm/take.d.ts", - "default": "./dist/esm/take.js" + "types": "./dist/esm/symbol/throttle.d.ts", + "default": "./dist/esm/symbol/throttle.js" } }, - "./switch-map": { + "./symbol/throw-if-empty": { "browser": { - "types": "./dist/esm/switch-map.d.ts", - "default": "./dist/esm/switch-map.js" + "types": "./dist/esm/symbol/throw-if-empty.d.ts", + "default": "./dist/esm/symbol/throw-if-empty.js" }, "webpack": { - "types": "./dist/esm/switch-map.d.ts", - "default": "./dist/esm/switch-map.js" + "types": "./dist/esm/symbol/throw-if-empty.d.ts", + "default": "./dist/esm/symbol/throw-if-empty.js" }, "import": { - "types": "./dist/esm/switch-map.d.ts", - "default": "./dist/esm/switch-map.js" + "types": "./dist/esm/symbol/throw-if-empty.d.ts", + "default": "./dist/esm/symbol/throw-if-empty.js" }, "require": { - "types": "./dist/esm/switch-map.d.ts", - "default": "./dist/esm/switch-map.js" + "types": "./dist/esm/symbol/throw-if-empty.d.ts", + "default": "./dist/esm/symbol/throw-if-empty.js" } }, - "./switch-scan": { + "./symbol/time-interval": { "browser": { - "types": "./dist/esm/switch-scan.d.ts", - "default": "./dist/esm/switch-scan.js" + "types": "./dist/esm/symbol/time-interval.d.ts", + "default": "./dist/esm/symbol/time-interval.js" }, "webpack": { - "types": "./dist/esm/switch-scan.d.ts", - "default": "./dist/esm/switch-scan.js" + "types": "./dist/esm/symbol/time-interval.d.ts", + "default": "./dist/esm/symbol/time-interval.js" }, "import": { - "types": "./dist/esm/switch-scan.d.ts", - "default": "./dist/esm/switch-scan.js" + "types": "./dist/esm/symbol/time-interval.d.ts", + "default": "./dist/esm/symbol/time-interval.js" }, "require": { - "types": "./dist/esm/switch-scan.d.ts", - "default": "./dist/esm/switch-scan.js" + "types": "./dist/esm/symbol/time-interval.d.ts", + "default": "./dist/esm/symbol/time-interval.js" + } + }, + "./symbol/timeout": { + "browser": { + "types": "./dist/esm/symbol/timeout.d.ts", + "default": "./dist/esm/symbol/timeout.js" + }, + "webpack": { + "types": "./dist/esm/symbol/timeout.d.ts", + "default": "./dist/esm/symbol/timeout.js" + }, + "import": { + "types": "./dist/esm/symbol/timeout.d.ts", + "default": "./dist/esm/symbol/timeout.js" + }, + "require": { + "types": "./dist/esm/symbol/timeout.d.ts", + "default": "./dist/esm/symbol/timeout.js" + } + }, + "./symbol/timer": { + "browser": { + "types": "./dist/esm/symbol/timer.d.ts", + "default": "./dist/esm/symbol/timer.js" + }, + "webpack": { + "types": "./dist/esm/symbol/timer.d.ts", + "default": "./dist/esm/symbol/timer.js" + }, + "import": { + "types": "./dist/esm/symbol/timer.d.ts", + "default": "./dist/esm/symbol/timer.js" + }, + "require": { + "types": "./dist/esm/symbol/timer.d.ts", + "default": "./dist/esm/symbol/timer.js" + } + }, + "./symbol/timestamp": { + "browser": { + "types": "./dist/esm/symbol/timestamp.d.ts", + "default": "./dist/esm/symbol/timestamp.js" + }, + "webpack": { + "types": "./dist/esm/symbol/timestamp.d.ts", + "default": "./dist/esm/symbol/timestamp.js" + }, + "import": { + "types": "./dist/esm/symbol/timestamp.d.ts", + "default": "./dist/esm/symbol/timestamp.js" + }, + "require": { + "types": "./dist/esm/symbol/timestamp.d.ts", + "default": "./dist/esm/symbol/timestamp.js" + } + }, + "./symbol/window": { + "browser": { + "types": "./dist/esm/symbol/window.d.ts", + "default": "./dist/esm/symbol/window.js" + }, + "webpack": { + "types": "./dist/esm/symbol/window.d.ts", + "default": "./dist/esm/symbol/window.js" + }, + "import": { + "types": "./dist/esm/symbol/window.d.ts", + "default": "./dist/esm/symbol/window.js" + }, + "require": { + "types": "./dist/esm/symbol/window.d.ts", + "default": "./dist/esm/symbol/window.js" + } + }, + "./symbol/window-count": { + "browser": { + "types": "./dist/esm/symbol/window-count.d.ts", + "default": "./dist/esm/symbol/window-count.js" + }, + "webpack": { + "types": "./dist/esm/symbol/window-count.d.ts", + "default": "./dist/esm/symbol/window-count.js" + }, + "import": { + "types": "./dist/esm/symbol/window-count.d.ts", + "default": "./dist/esm/symbol/window-count.js" + }, + "require": { + "types": "./dist/esm/symbol/window-count.d.ts", + "default": "./dist/esm/symbol/window-count.js" + } + }, + "./symbol/window-time": { + "browser": { + "types": "./dist/esm/symbol/window-time.d.ts", + "default": "./dist/esm/symbol/window-time.js" + }, + "webpack": { + "types": "./dist/esm/symbol/window-time.d.ts", + "default": "./dist/esm/symbol/window-time.js" + }, + "import": { + "types": "./dist/esm/symbol/window-time.d.ts", + "default": "./dist/esm/symbol/window-time.js" + }, + "require": { + "types": "./dist/esm/symbol/window-time.d.ts", + "default": "./dist/esm/symbol/window-time.js" + } + }, + "./symbol/window-toggle": { + "browser": { + "types": "./dist/esm/symbol/window-toggle.d.ts", + "default": "./dist/esm/symbol/window-toggle.js" + }, + "webpack": { + "types": "./dist/esm/symbol/window-toggle.d.ts", + "default": "./dist/esm/symbol/window-toggle.js" + }, + "import": { + "types": "./dist/esm/symbol/window-toggle.d.ts", + "default": "./dist/esm/symbol/window-toggle.js" + }, + "require": { + "types": "./dist/esm/symbol/window-toggle.d.ts", + "default": "./dist/esm/symbol/window-toggle.js" + } + }, + "./symbol/window-when": { + "browser": { + "types": "./dist/esm/symbol/window-when.d.ts", + "default": "./dist/esm/symbol/window-when.js" + }, + "webpack": { + "types": "./dist/esm/symbol/window-when.d.ts", + "default": "./dist/esm/symbol/window-when.js" + }, + "import": { + "types": "./dist/esm/symbol/window-when.d.ts", + "default": "./dist/esm/symbol/window-when.js" + }, + "require": { + "types": "./dist/esm/symbol/window-when.d.ts", + "default": "./dist/esm/symbol/window-when.js" + } + }, + "./symbol/with-latest-from": { + "browser": { + "types": "./dist/esm/symbol/with-latest-from.d.ts", + "default": "./dist/esm/symbol/with-latest-from.js" + }, + "webpack": { + "types": "./dist/esm/symbol/with-latest-from.d.ts", + "default": "./dist/esm/symbol/with-latest-from.js" + }, + "import": { + "types": "./dist/esm/symbol/with-latest-from.d.ts", + "default": "./dist/esm/symbol/with-latest-from.js" + }, + "require": { + "types": "./dist/esm/symbol/with-latest-from.d.ts", + "default": "./dist/esm/symbol/with-latest-from.js" + } + }, + "./symbol/zip-all": { + "browser": { + "types": "./dist/esm/symbol/zip-all.d.ts", + "default": "./dist/esm/symbol/zip-all.js" + }, + "webpack": { + "types": "./dist/esm/symbol/zip-all.d.ts", + "default": "./dist/esm/symbol/zip-all.js" + }, + "import": { + "types": "./dist/esm/symbol/zip-all.d.ts", + "default": "./dist/esm/symbol/zip-all.js" + }, + "require": { + "types": "./dist/esm/symbol/zip-all.d.ts", + "default": "./dist/esm/symbol/zip-all.js" + } + }, + "./symbol/zip-with": { + "browser": { + "types": "./dist/esm/symbol/zip-with.d.ts", + "default": "./dist/esm/symbol/zip-with.js" + }, + "webpack": { + "types": "./dist/esm/symbol/zip-with.d.ts", + "default": "./dist/esm/symbol/zip-with.js" + }, + "import": { + "types": "./dist/esm/symbol/zip-with.d.ts", + "default": "./dist/esm/symbol/zip-with.js" + }, + "require": { + "types": "./dist/esm/symbol/zip-with.d.ts", + "default": "./dist/esm/symbol/zip-with.js" } }, "./take": { diff --git a/packages/rxjs/src/animation-frames.ts b/packages/rxjs/src/animation-frames.ts index 9e3744a35e..95912edaac 100644 --- a/packages/rxjs/src/animation-frames.ts +++ b/packages/rxjs/src/animation-frames.ts @@ -60,3 +60,18 @@ function animationFramesImpl(this: ObservableCtor, timestampProvider?: Animation run(); }); } + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Calls the static exact-Symbol `Observable[animationFrames]` capability as an ordinary function. + * + * Construction, conversion, error forwarding, and cancellation remain owned + * by the installed Symbol implementation. + */ +export function staticAnimationFrames(timestampProvider?: AnimationFrameTimestampProvider): Observable; +export function staticAnimationFrames(...args: any[]): any { + return Reflect.apply(Observable[animationFrames] as (...values: any[]) => any, Observable, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/buffer-time.ts b/packages/rxjs/src/buffer-time.ts index 04e21bea27..2760924bf3 100644 --- a/packages/rxjs/src/buffer-time.ts +++ b/packages/rxjs/src/buffer-time.ts @@ -106,3 +106,20 @@ Observable.prototype[bufferTime] = function ( }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `bufferTime` form of the exact-Symbol `[bufferTime]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[bufferTime]` to its source. + */ +export function pipeableBufferTime(span: number, creationInterval?: number | null, maxBufferSize?: number): (source: Observable) => Observable; +export function pipeableBufferTime(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[bufferTime] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/buffer-toggle.ts b/packages/rxjs/src/buffer-toggle.ts index 764beca3bc..1d8432abfb 100644 --- a/packages/rxjs/src/buffer-toggle.ts +++ b/packages/rxjs/src/buffer-toggle.ts @@ -153,3 +153,20 @@ Observable.prototype[bufferToggle] = function ( } }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `bufferToggle` form of the exact-Symbol `[bufferToggle]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[bufferToggle]` to its source. + */ +export function pipeableBufferToggle(openings: ObservableInput, closingSelector: (opening: Opening) => ObservableInput): (source: Observable) => Observable; +export function pipeableBufferToggle(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[bufferToggle] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/buffer.ts b/packages/rxjs/src/buffer.ts index 42ee000b22..9af67901a0 100644 --- a/packages/rxjs/src/buffer.ts +++ b/packages/rxjs/src/buffer.ts @@ -182,3 +182,28 @@ Observable.prototype[buffer] = function ( }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `buffer` form of the exact-Symbol `[buffer]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[buffer]` to its source. + */ +export function pipeableBuffer(config: { + delay?: number | (() => ObservableInput); + maxSize?: number; + startEvery?: number; + emitEmpty?: boolean; + emitRemainingOnComplete?: boolean; + emitRemainingOnError?: boolean; + restartDelay?: boolean; + }): (source: Observable) => Observable; +export function pipeableBuffer(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[buffer] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/catch-error.ts b/packages/rxjs/src/catch-error.ts index 185ca24960..e784e85db3 100644 --- a/packages/rxjs/src/catch-error.ts +++ b/packages/rxjs/src/catch-error.ts @@ -82,3 +82,20 @@ Observable.prototype[catchError] = function ; return result; }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `catchError` form of the exact-Symbol `[catchError]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[catchError]` to its source. + */ +export function pipeableCatchError>(selector: (error: any, caught: Observable) => Replacement): (source: Observable) => Observable>; +export function pipeableCatchError(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[catchError] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/combine-latest-all.ts b/packages/rxjs/src/combine-latest-all.ts index e5f7f4d0d8..317b71c794 100644 --- a/packages/rxjs/src/combine-latest-all.ts +++ b/packages/rxjs/src/combine-latest-all.ts @@ -49,3 +49,21 @@ function combineLatestAllOperator(this: Observable>, pr } Observable.prototype[combineLatestAll] = combineLatestAllOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `combineLatestAll` form of the exact-Symbol `[combineLatestAll]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[combineLatestAll]` to its source. + */ +export function pipeableCombineLatestAll>(): (source: Observable) => Observable>>; +export function pipeableCombineLatestAll, Result>(project: (...values: ProjectValues) => Result): (source: Observable) => Observable; +export function pipeableCombineLatestAll(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[combineLatestAll] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/combine-latest.ts b/packages/rxjs/src/combine-latest.ts index d4d0a3ffbe..61733a21ce 100644 --- a/packages/rxjs/src/combine-latest.ts +++ b/packages/rxjs/src/combine-latest.ts @@ -94,3 +94,35 @@ function combineLatestImpl[] | { [ function isSourceArray(sources: any): sources is readonly ObservableInput[] { return Array.isArray(sources); } + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `combineLatestWith` form of the exact-Symbol `[combineLatest]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[combineLatest]` to its source. + */ +export function pipeableCombineLatest[]>(sources: Sources, config?: { requireAllValues?: boolean }): (source: Observable) => Observable< + [T, ...CombineLatestArrayValues] + >; +export function pipeableCombineLatest[], Result>(sources: Sources, project: (value: T, ...values: CombineLatestArrayValues) => Result): (source: Observable) => Observable; +export function pipeableCombineLatest(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[combineLatest] as (...values: any[]) => any, source, args); +} + +/** + * Calls the static exact-Symbol `Observable[combineLatest]` capability as an ordinary function. + * + * Construction, conversion, error forwarding, and cancellation remain owned + * by the installed Symbol implementation. + */ +export function staticCombineLatest[] | { [key: string]: ObservableInput }>(sources: Sources, config?: { requireAllValues?: boolean }): Observable>; +export function staticCombineLatest[], Result>(sources: Sources, project: (...values: CombineLatestArrayValues) => Result): Observable; +export function staticCombineLatest(...args: any[]): any { + return Reflect.apply(Observable[combineLatest] as (...values: any[]) => any, Observable, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/combine.ts b/packages/rxjs/src/combine.ts index c6dd28cd8b..e133dc3c99 100644 --- a/packages/rxjs/src/combine.ts +++ b/packages/rxjs/src/combine.ts @@ -78,3 +78,31 @@ function combineImpl[]>( } }); } + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `combineWith` form of the exact-Symbol `[combine]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[combine]` to its source. + */ +export function pipeableCombine[]>(config: Config): (source: Observable) => Observable<[T, ...CombineValues]>; +export function pipeableCombine(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[combine] as (...values: any[]) => any, source, args); +} + +/** + * Calls the static exact-Symbol `Observable[combine]` capability as an ordinary function. + * + * Construction, conversion, error forwarding, and cancellation remain owned + * by the installed Symbol implementation. + */ +export function staticCombine[]>(config: Config): Observable>; +export function staticCombine(...args: any[]): any { + return Reflect.apply(Observable[combine] as (...values: any[]) => any, Observable, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/concat.ts b/packages/rxjs/src/concat.ts index 7320e06e15..7417120bec 100644 --- a/packages/rxjs/src/concat.ts +++ b/packages/rxjs/src/concat.ts @@ -24,3 +24,31 @@ function concatImpl[]>( ): Observable> { return this[merge](sources, { concurrency: 1 }); } + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `concatWith` form of the exact-Symbol `[concat]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[concat]` to its source. + */ +export function pipeableConcat[]>(otherSources: Sources): (source: Observable) => Observable>; +export function pipeableConcat(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[concat] as (...values: any[]) => any, source, args); +} + +/** + * Calls the static exact-Symbol `Observable[concat]` capability as an ordinary function. + * + * Construction, conversion, error forwarding, and cancellation remain owned + * by the installed Symbol implementation. + */ +export function staticConcat[]>(otherSources: Sources): Observable>; +export function staticConcat(...args: any[]): any { + return Reflect.apply(Observable[concat] as (...values: any[]) => any, Observable, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/connect.ts b/packages/rxjs/src/connect.ts index 752c427f3e..bced0bbea1 100644 --- a/packages/rxjs/src/connect.ts +++ b/packages/rxjs/src/connect.ts @@ -111,3 +111,20 @@ Observable.prototype[connect] = function >(selector: (shared: Observable) => Selected, config?: ConnectConfig): (source: Observable) => Observable>; +export function pipeableConnect(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[connect] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/count.ts b/packages/rxjs/src/count.ts index 3d7f6945d9..267fceb3fb 100644 --- a/packages/rxjs/src/count.ts +++ b/packages/rxjs/src/count.ts @@ -32,3 +32,20 @@ Observable.prototype[count] = function (this: Observable, predicate?: (val }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `count` form of the exact-Symbol `[count]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[count]` to its source. + */ +export function pipeableCount(predicate?: (value: T, index: number) => boolean): (source: Observable) => Observable; +export function pipeableCount(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[count] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/debounce.ts b/packages/rxjs/src/debounce.ts index 620cc2afc1..32294df638 100644 --- a/packages/rxjs/src/debounce.ts +++ b/packages/rxjs/src/debounce.ts @@ -60,3 +60,20 @@ Observable.prototype[debounce] = function ( }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `debounce` form of the exact-Symbol `[debounce]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[debounce]` to its source. + */ +export function pipeableDebounce(delay: number | ((value: T, index: number) => ObservableInput)): (source: Observable) => Observable; +export function pipeableDebounce(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[debounce] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/default-if-empty.ts b/packages/rxjs/src/default-if-empty.ts index 684dd56700..316d40e845 100644 --- a/packages/rxjs/src/default-if-empty.ts +++ b/packages/rxjs/src/default-if-empty.ts @@ -26,3 +26,20 @@ Observable.prototype[defaultIfEmpty] = function (this: Observable, defa }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `defaultIfEmpty` form of the exact-Symbol `[defaultIfEmpty]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[defaultIfEmpty]` to its source. + */ +export function pipeableDefaultIfEmpty(defaultValue: R): (source: Observable) => Observable; +export function pipeableDefaultIfEmpty(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[defaultIfEmpty] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/delay-when.ts b/packages/rxjs/src/delay-when.ts index b05b191d95..a56421206e 100644 --- a/packages/rxjs/src/delay-when.ts +++ b/packages/rxjs/src/delay-when.ts @@ -131,3 +131,20 @@ Observable.prototype[delayWhen] = function ( ); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `delayWhen` form of the exact-Symbol `[delayWhen]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[delayWhen]` to its source. + */ +export function pipeableDelayWhen(durationSelector: (value: T, index: number) => ObservableInput, subscriptionDelay?: Observable): (source: Observable) => Observable; +export function pipeableDelayWhen(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[delayWhen] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/delay.ts b/packages/rxjs/src/delay.ts index 6d43bda477..c0a5de8ff9 100644 --- a/packages/rxjs/src/delay.ts +++ b/packages/rxjs/src/delay.ts @@ -46,3 +46,20 @@ Observable.prototype[delay] = function (this: Observable, due: number | Da }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `delay` form of the exact-Symbol `[delay]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[delay]` to its source. + */ +export function pipeableDelay(due: number | Date): (source: Observable) => Observable; +export function pipeableDelay(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[delay] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/dematerialize.ts b/packages/rxjs/src/dematerialize.ts index 1181b058c4..8a67e6f9df 100644 --- a/packages/rxjs/src/dematerialize.ts +++ b/packages/rxjs/src/dematerialize.ts @@ -17,3 +17,20 @@ Observable.prototype[dematerialize] = function observeNotification(notification, subscriber) }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `dematerialize` form of the exact-Symbol `[dematerialize]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[dematerialize]` to its source. + */ +export function pipeableDematerialize(): (source: Observable) => Observable>; +export function pipeableDematerialize(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[dematerialize] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/distinct-until-changed.ts b/packages/rxjs/src/distinct-until-changed.ts index 896bfeab30..1841bb7175 100644 --- a/packages/rxjs/src/distinct-until-changed.ts +++ b/packages/rxjs/src/distinct-until-changed.ts @@ -55,3 +55,21 @@ function identity(value: T): T { function defaultCompare(previous: T, current: T): boolean { return previous === current; } + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `distinctUntilChanged` form of the exact-Symbol `[distinctUntilChanged]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[distinctUntilChanged]` to its source. + */ +export function pipeableDistinctUntilChanged(comparator?: Comparator | null): (source: Observable) => Observable; +export function pipeableDistinctUntilChanged(comparator: Comparator | null | undefined, keySelector: KeySelector): (source: Observable) => Observable; +export function pipeableDistinctUntilChanged(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[distinctUntilChanged] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/distinct-until-key-changed.ts b/packages/rxjs/src/distinct-until-key-changed.ts index 4da6ce58e0..a74ba3d7c2 100644 --- a/packages/rxjs/src/distinct-until-key-changed.ts +++ b/packages/rxjs/src/distinct-until-key-changed.ts @@ -17,3 +17,20 @@ Observable.prototype[distinctUntilKeyChanged] = function ( ): Observable { return this[distinctUntilChanged](comparator, (value) => value[key]); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `distinctUntilKeyChanged` form of the exact-Symbol `[distinctUntilKeyChanged]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[distinctUntilKeyChanged]` to its source. + */ +export function pipeableDistinctUntilKeyChanged(key: K, comparator?: Comparator): (source: Observable) => Observable; +export function pipeableDistinctUntilKeyChanged(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[distinctUntilKeyChanged] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/distinct.ts b/packages/rxjs/src/distinct.ts index 48f64b120f..815dab6f88 100644 --- a/packages/rxjs/src/distinct.ts +++ b/packages/rxjs/src/distinct.ts @@ -42,3 +42,20 @@ Observable.prototype[distinct] = function ( subscribeToSource(flushSource, subscriber, { next: () => keys.clear(), complete: () => void 0 }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `distinct` form of the exact-Symbol `[distinct]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[distinct]` to its source. + */ +export function pipeableDistinct(keySelector?: (value: T) => K, flushes?: ObservableInput): (source: Observable) => Observable; +export function pipeableDistinct(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[distinct] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/element-at.ts b/packages/rxjs/src/element-at.ts index c69ce49b88..b2753a1181 100644 --- a/packages/rxjs/src/element-at.ts +++ b/packages/rxjs/src/element-at.ts @@ -40,3 +40,20 @@ Observable.prototype[elementAt] = function (this: Observable, index: nu }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `elementAt` form of the exact-Symbol `[elementAt]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[elementAt]` to its source. + */ +export function pipeableElementAt(index: number): (source: Observable) => Observable; +export function pipeableElementAt(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[elementAt] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/every.ts b/packages/rxjs/src/every.ts index a4ecaedd77..1da6b6f301 100644 --- a/packages/rxjs/src/every.ts +++ b/packages/rxjs/src/every.ts @@ -50,3 +50,21 @@ function everyOperator( } Observable.prototype[every] = everyOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `every` form of the exact-Symbol `[every]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[every]` to its source. + */ +export function pipeableEvery(predicate: BooleanConstructor): (source: Observable) => Observable extends never ? false : boolean>; +export function pipeableEvery(predicate: (value: T, index: number, source: Observable) => boolean): (source: Observable) => Observable; +export function pipeableEvery(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[every] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/exhaust-map.ts b/packages/rxjs/src/exhaust-map.ts index ad5f0df54d..1394a2f982 100644 --- a/packages/rxjs/src/exhaust-map.ts +++ b/packages/rxjs/src/exhaust-map.ts @@ -49,3 +49,22 @@ Observable.prototype[exhaustMap] = function ( }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `exhaustMap` form of the exact-Symbol `[exhaustMap]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[exhaustMap]` to its source. + */ +export function pipeableExhaustMap(mapper: (value: T, index: number) => ObservableInput, options?: { + concurrent?: number; + }): (source: Observable) => Observable; +export function pipeableExhaustMap(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[exhaustMap] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/expand.ts b/packages/rxjs/src/expand.ts index c3dc431c4c..e607ce7d8d 100644 --- a/packages/rxjs/src/expand.ts +++ b/packages/rxjs/src/expand.ts @@ -108,3 +108,20 @@ Observable.prototype[expand] = function ( }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `expand` form of the exact-Symbol `[expand]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[expand]` to its source. + */ +export function pipeableExpand(project: (value: T, index: number) => ObservableInput, options?: ExpandOptions): (source: Observable) => Observable; +export function pipeableExpand(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[expand] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/finalize.ts b/packages/rxjs/src/finalize.ts index 7af4a2c473..f2de6e4ed9 100644 --- a/packages/rxjs/src/finalize.ts +++ b/packages/rxjs/src/finalize.ts @@ -50,3 +50,20 @@ Observable.prototype[finalize] = function (this: Observable, callback: () ); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `finalize` form of the exact-Symbol `[finalize]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[finalize]` to its source. + */ +export function pipeableFinalize(callback: () => void): (source: Observable) => Observable; +export function pipeableFinalize(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[finalize] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/find-index.ts b/packages/rxjs/src/find-index.ts index 1cbadb8683..195dc11431 100644 --- a/packages/rxjs/src/find-index.ts +++ b/packages/rxjs/src/find-index.ts @@ -49,3 +49,20 @@ function findIndexOperator( } Observable.prototype[findIndex] = findIndexOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `findIndex` form of the exact-Symbol `[findIndex]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[findIndex]` to its source. + */ +export function pipeableFindIndex(predicate: (value: T, index: number, source: Observable) => boolean): (source: Observable) => Observable; +export function pipeableFindIndex(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[findIndex] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/find.ts b/packages/rxjs/src/find.ts index 6f69343ab7..d3fe0ac9fd 100644 --- a/packages/rxjs/src/find.ts +++ b/packages/rxjs/src/find.ts @@ -57,3 +57,21 @@ function findOperator( } Observable.prototype[find] = findOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `find` form of the exact-Symbol `[find]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[find]` to its source. + */ +export function pipeableFind(predicate: (value: T, index: number, source: Observable) => value is S): (source: Observable) => Observable; +export function pipeableFind(predicate: (value: T, index: number, source: Observable) => boolean): (source: Observable) => Observable; +export function pipeableFind(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[find] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/first.ts b/packages/rxjs/src/first.ts index bfff60e101..03520a8115 100644 --- a/packages/rxjs/src/first.ts +++ b/packages/rxjs/src/first.ts @@ -86,3 +86,25 @@ function firstOperator( } Observable.prototype[first] = firstOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `first` form of the exact-Symbol `[first]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[first]` to its source. + */ +export function pipeableFirst(predicate?: null, defaultValue?: D): (source: Observable) => Observable; +export function pipeableFirst(predicate: BooleanConstructor): (source: Observable) => Observable>; +export function pipeableFirst(predicate: BooleanConstructor, defaultValue: D): (source: Observable) => Observable | D>; +export function pipeableFirst(predicate: (value: T, index: number, source: Observable) => value is S, defaultValue?: S): (source: Observable) => Observable; +export function pipeableFirst(predicate: (value: T, index: number, source: Observable) => value is S, defaultValue: D): (source: Observable) => Observable; +export function pipeableFirst(predicate: (value: T, index: number, source: Observable) => boolean, defaultValue?: D): (source: Observable) => Observable; +export function pipeableFirst(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[first] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/fork-join.ts b/packages/rxjs/src/fork-join.ts index cf45c561aa..c9252c0e12 100644 --- a/packages/rxjs/src/fork-join.ts +++ b/packages/rxjs/src/fork-join.ts @@ -133,3 +133,27 @@ function createResultObject(keys: readonly string[], values: readonly any[]): Re } return result; } + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Calls the static exact-Symbol `Observable[forkJoin]` capability as an ordinary function. + * + * Construction, conversion, error forwarding, and cancellation remain owned + * by the installed Symbol implementation. + */ +export function staticForkJoin(arg: T): Observable; +export function staticForkJoin(): Observable; +export function staticForkJoin(sources: readonly []): Observable; +export function staticForkJoin[]>(sources: Sources): Observable>; +export function staticForkJoin[], Result>(sources: Sources, resultSelector: (...values: ForkJoinTuple) => Result): Observable; +export function staticForkJoin(sourcesObject: Record): Observable; +export function staticForkJoin>>(sourcesObject: Sources): Observable>; +export function staticForkJoin(source: null | undefined): Observable; +export function staticForkJoin[]>(...sources: Sources): Observable>; +export function staticForkJoin[], Result>(...sourcesAndResultSelector: [...Sources, (...values: ForkJoinTuple) => Result]): Observable; +export function staticForkJoin(...args: any[]): any { + return Reflect.apply(Observable[forkJoin] as (...values: any[]) => any, Observable, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/generate.ts b/packages/rxjs/src/generate.ts index a0140a2ef6..d1c95e9437 100644 --- a/packages/rxjs/src/generate.ts +++ b/packages/rxjs/src/generate.ts @@ -95,3 +95,21 @@ Observable[generate] = function generateImpl( } }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Calls the static exact-Symbol `Observable[generate]` capability as an ordinary function. + * + * Construction, conversion, error forwarding, and cancellation remain owned + * by the installed Symbol implementation. + */ +export function staticGenerate(initialState: S, condition: (state: S) => boolean, iterate: (state: S) => S): Observable; +export function staticGenerate(initialState: S, condition: (state: S) => boolean, iterate: (state: S) => S, resultSelector: (state: S) => T): Observable; +export function staticGenerate(options: GenerateOptions): Observable; +export function staticGenerate(options: GenerateBaseOptions): Observable; +export function staticGenerate(...args: any[]): any { + return Reflect.apply(Observable[generate] as (...values: any[]) => any, Observable, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/group-by.ts b/packages/rxjs/src/group-by.ts index f87d4114c9..d9f420d30f 100644 --- a/packages/rxjs/src/group-by.ts +++ b/packages/rxjs/src/group-by.ts @@ -306,3 +306,29 @@ function groupByOperator( } Observable.prototype[groupBy] = groupByOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `groupBy` form of the exact-Symbol `[groupBy]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[groupBy]` to its source. + */ +export function pipeableGroupBy(keySelector: (value: T) => value is K): (source: Observable) => Observable< + KeyedGroupObservable | KeyedGroupObservable> + >; +export function pipeableGroupBy(keySelector: (value: T) => K): (source: Observable) => Observable>; +export function pipeableGroupBy(keySelector: (value: T) => K, options: GroupByOptions): (source: Observable) => Observable>; +export function pipeableGroupBy(keySelector: (value: T) => K, options: GroupByOptions & { element: (value: T) => E }): (source: Observable) => Observable< + KeyedGroupObservable + >; +export function pipeableGroupBy(keySelector: (value: T) => K, element: (value: T) => E, duration?: (group: KeyedGroupObservable) => ObservableInput, connector?: () => SubjectLike): (source: Observable) => Observable>; +export function pipeableGroupBy(keySelector: (value: T) => K, element: undefined, duration: (group: KeyedGroupObservable) => ObservableInput, connector?: () => SubjectLike): (source: Observable) => Observable>; +export function pipeableGroupBy(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[groupBy] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/index.ts b/packages/rxjs/src/index.ts index 32891a6f39..2ee5f3adbb 100644 --- a/packages/rxjs/src/index.ts +++ b/packages/rxjs/src/index.ts @@ -32,3 +32,120 @@ export { rx } from './rx.js'; export { SequenceError } from './sequence-error.js'; export { Subject } from './subject.js'; export { TimeoutError, type TimeoutInfo } from './timeout-error.js'; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +export { animationFrames } from './static/animation-frames.js'; +export type { AnimationFrameTimestampProvider } from './animation-frames.js'; +export { bufferTime } from './pipeable/buffer-time.js'; +export { bufferToggle } from './pipeable/buffer-toggle.js'; +export { buffer } from './pipeable/buffer.js'; +export { catchError } from './pipeable/catch-error.js'; +export { combineLatestAll } from './pipeable/combine-latest-all.js'; +export { combineLatestWith } from './pipeable/combine-latest-with.js'; +export { combineLatest } from './static/combine-latest.js'; +export { combineWith } from './pipeable/combine-with.js'; +export { combine } from './static/combine.js'; +export { concatWith } from './pipeable/concat-with.js'; +export { concat } from './static/concat.js'; +export { connect } from './pipeable/connect.js'; +export type { ConnectConfig } from './connect.js'; +export { count } from './pipeable/count.js'; +export { debounce } from './pipeable/debounce.js'; +export { defaultIfEmpty } from './pipeable/default-if-empty.js'; +export { delayWhen } from './pipeable/delay-when.js'; +export { delay } from './pipeable/delay.js'; +export { dematerialize } from './pipeable/dematerialize.js'; +export { distinctUntilChanged } from './pipeable/distinct-until-changed.js'; +export { distinctUntilKeyChanged } from './pipeable/distinct-until-key-changed.js'; +export { distinct } from './pipeable/distinct.js'; +export { elementAt } from './pipeable/element-at.js'; +export { every } from './pipeable/every.js'; +export { exhaustMap } from './pipeable/exhaust-map.js'; +export { expand } from './pipeable/expand.js'; +export type { ExpandOptions } from './expand.js'; +export { finalize } from './pipeable/finalize.js'; +export { findIndex } from './pipeable/find-index.js'; +export { find } from './pipeable/find.js'; +export { first } from './pipeable/first.js'; +export { forkJoin } from './static/fork-join.js'; +export { generate } from './static/generate.js'; +export type { GenerateBaseOptions, GenerateOptions } from './generate.js'; +export { groupBy } from './pipeable/group-by.js'; +export type { KeyedGroupObservable, GroupByOptions } from './group-by.js'; +export { interval } from './static/interval.js'; +export { isEmpty } from './pipeable/is-empty.js'; +export { iterateBufferedValues } from './pipeable/iterate-buffered-values.js'; +export { iterateEachValue } from './pipeable/iterate-each-value.js'; +export { iterateLatestValue } from './pipeable/iterate-latest-value.js'; +export { iterateNextValue } from './pipeable/iterate-next-value.js'; +export { last } from './pipeable/last.js'; +export { materialize } from './pipeable/materialize.js'; +export { max } from './pipeable/max.js'; +export { mergeMap } from './pipeable/merge-map.js'; +export { mergeScan } from './pipeable/merge-scan.js'; +export { mergeWith } from './pipeable/merge-with.js'; +export { merge } from './static/merge.js'; +export { min } from './pipeable/min.js'; +export { multicast } from './pipeable/multicast.js'; +export { observeOn } from './pipeable/observe-on.js'; +export { onErrorResumeNextWith } from './pipeable/on-error-resume-next-with.js'; +export { onErrorResumeNext } from './static/on-error-resume-next.js'; +export { pairwise } from './pipeable/pairwise.js'; +export { partition } from './static/partition.js'; +export { pipe } from './pipeable/pipe.js'; +export { pluck } from './pipeable/pluck.js'; +export { publishBehavior } from './pipeable/publish-behavior.js'; +export { publishLast } from './pipeable/publish-last.js'; +export { publishReplay } from './pipeable/publish-replay.js'; +export type { PublishReplayTimestampProvider } from './publish-replay.js'; +export { publish } from './pipeable/publish.js'; +export { raceWith } from './pipeable/race-with.js'; +export { race } from './static/race.js'; +export { reduce } from './pipeable/reduce.js'; +export { refCount } from './pipeable/ref-count.js'; +export { repeatWhen } from './pipeable/repeat-when.js'; +export { repeat } from './pipeable/repeat.js'; +export { retryWhen } from './pipeable/retry-when.js'; +export { retry } from './pipeable/retry.js'; +export { sampleTime } from './pipeable/sample-time.js'; +export { sample } from './pipeable/sample.js'; +export { scan } from './pipeable/scan.js'; +export { sequenceEqual } from './pipeable/sequence-equal.js'; +export { shareReplay } from './pipeable/share-replay.js'; +export type { ShareReplayConfig } from './share-replay.js'; +export { share } from './pipeable/share.js'; +export type { ShareConfig } from './share.js'; +export { single } from './pipeable/single.js'; +export { skipLast } from './pipeable/skip-last.js'; +export { skipUntil } from './pipeable/skip-until.js'; +export { skipWhile } from './pipeable/skip-while.js'; +export { skip } from './pipeable/skip.js'; +export { startWith } from './pipeable/start-with.js'; +export { subscribeOn } from './pipeable/subscribe-on.js'; +export { switchMap } from './pipeable/switch-map.js'; +export { switchScan } from './pipeable/switch-scan.js'; +export { takeLast } from './pipeable/take-last.js'; +export { takeUntil } from './pipeable/take-until.js'; +export { takeWhile } from './pipeable/take-while.js'; +export { tap } from './pipeable/tap.js'; +export type { TapObserver } from './tap.js'; +export { throttle } from './pipeable/throttle.js'; +export { throwIfEmpty } from './pipeable/throw-if-empty.js'; +export { timeInterval } from './pipeable/time-interval.js'; +export { TimeInterval } from './time-interval.js'; +export type { TimeIntervalProvider } from './time-interval.js'; +export { timeout } from './pipeable/timeout.js'; +export { timer } from './static/timer.js'; +export { timestamp } from './pipeable/timestamp.js'; +export type { TimestampProvider, Timestamp } from './timestamp.js'; +export { windowCount } from './pipeable/window-count.js'; +export { windowTime } from './pipeable/window-time.js'; +export { windowToggle } from './pipeable/window-toggle.js'; +export { windowWhen } from './pipeable/window-when.js'; +export { window } from './pipeable/window.js'; +export { withLatestFrom } from './pipeable/with-latest-from.js'; +export { zipAll } from './pipeable/zip-all.js'; +export { zipWith } from './pipeable/zip-with.js'; + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/interval.ts b/packages/rxjs/src/interval.ts index a685bb8128..c2b48a3815 100644 --- a/packages/rxjs/src/interval.ts +++ b/packages/rxjs/src/interval.ts @@ -20,3 +20,18 @@ function intervalImpl(this: ObservableCtor, ms: number): Observable { subscriber.addTeardown(() => globalThis.clearInterval(id)); }); } + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Calls the static exact-Symbol `Observable[interval]` capability as an ordinary function. + * + * Construction, conversion, error forwarding, and cancellation remain owned + * by the installed Symbol implementation. + */ +export function staticInterval(ms: number): Observable; +export function staticInterval(...args: any[]): any { + return Reflect.apply(Observable[interval] as (...values: any[]) => any, Observable, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/is-empty.ts b/packages/rxjs/src/is-empty.ts index 0c079b7ec9..1e018b11df 100644 --- a/packages/rxjs/src/is-empty.ts +++ b/packages/rxjs/src/is-empty.ts @@ -38,3 +38,20 @@ function isEmptyOperator(this: Observable): Observable { } Observable.prototype[isEmpty] = isEmptyOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `isEmpty` form of the exact-Symbol `[isEmpty]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[isEmpty]` to its source. + */ +export function pipeableIsEmpty(): (source: Observable) => Observable; +export function pipeableIsEmpty(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[isEmpty] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/iterate-buffered-values.ts b/packages/rxjs/src/iterate-buffered-values.ts index 83ff54478e..a8e4e5e47f 100644 --- a/packages/rxjs/src/iterate-buffered-values.ts +++ b/packages/rxjs/src/iterate-buffered-values.ts @@ -46,3 +46,20 @@ declare global { Observable.prototype[iterateBufferedValues] = function (this: Observable): AsyncGenerator { return bufferedValuesAsyncGenerator(this); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `iterateBufferedValues` form of the exact-Symbol `[iterateBufferedValues]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The AsyncGenerator result is returned unchanged, preserving the selected AsyncIterable strategy. + * + * @returns A unary function that applies `[iterateBufferedValues]` to its source. + */ +export function pipeableIterateBufferedValues(): (source: Observable) => AsyncGenerator; +export function pipeableIterateBufferedValues(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[iterateBufferedValues] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/iterate-each-value.ts b/packages/rxjs/src/iterate-each-value.ts index 10969fcee5..acf0bb9186 100644 --- a/packages/rxjs/src/iterate-each-value.ts +++ b/packages/rxjs/src/iterate-each-value.ts @@ -45,3 +45,20 @@ declare global { Observable.prototype[iterateEachValue] = function (this: Observable): AsyncGenerator { return eachValueAsyncGenerator(this); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `iterateEachValue` form of the exact-Symbol `[iterateEachValue]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The AsyncGenerator result is returned unchanged, preserving the selected AsyncIterable strategy. + * + * @returns A unary function that applies `[iterateEachValue]` to its source. + */ +export function pipeableIterateEachValue(): (source: Observable) => AsyncGenerator; +export function pipeableIterateEachValue(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[iterateEachValue] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/iterate-latest-value.ts b/packages/rxjs/src/iterate-latest-value.ts index 21d3870e16..78297e7737 100644 --- a/packages/rxjs/src/iterate-latest-value.ts +++ b/packages/rxjs/src/iterate-latest-value.ts @@ -45,3 +45,20 @@ declare global { Observable.prototype[iterateLatestValue] = function (this: Observable): AsyncGenerator { return latestValueAsyncGenerator(this); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `iterateLatestValue` form of the exact-Symbol `[iterateLatestValue]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The AsyncGenerator result is returned unchanged, preserving the selected AsyncIterable strategy. + * + * @returns A unary function that applies `[iterateLatestValue]` to its source. + */ +export function pipeableIterateLatestValue(): (source: Observable) => AsyncGenerator; +export function pipeableIterateLatestValue(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[iterateLatestValue] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/iterate-next-value.ts b/packages/rxjs/src/iterate-next-value.ts index 7eede05cd3..5b12fb85e0 100644 --- a/packages/rxjs/src/iterate-next-value.ts +++ b/packages/rxjs/src/iterate-next-value.ts @@ -47,3 +47,20 @@ declare global { Observable.prototype[iterateNextValue] = function (this: Observable): AsyncGenerator { return nextValueAsyncGenerator(this); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `iterateNextValue` form of the exact-Symbol `[iterateNextValue]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The AsyncGenerator result is returned unchanged, preserving the selected AsyncIterable strategy. + * + * @returns A unary function that applies `[iterateNextValue]` to its source. + */ +export function pipeableIterateNextValue(): (source: Observable) => AsyncGenerator; +export function pipeableIterateNextValue(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[iterateNextValue] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/last.ts b/packages/rxjs/src/last.ts index 26398b09dd..987f517c8f 100644 --- a/packages/rxjs/src/last.ts +++ b/packages/rxjs/src/last.ts @@ -83,3 +83,24 @@ function lastOperator( } Observable.prototype[last] = lastOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `last` form of the exact-Symbol `[last]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[last]` to its source. + */ +export function pipeableLast(predicate: BooleanConstructor): (source: Observable) => Observable>; +export function pipeableLast(predicate: BooleanConstructor, defaultValue: D): (source: Observable) => Observable | D>; +export function pipeableLast(predicate?: null, defaultValue?: D): (source: Observable) => Observable; +export function pipeableLast(predicate: (value: T, index: number, source: Observable) => value is S, defaultValue?: S): (source: Observable) => Observable; +export function pipeableLast(predicate: (value: T, index: number, source: Observable) => boolean, defaultValue?: D): (source: Observable) => Observable; +export function pipeableLast(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[last] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/materialize.ts b/packages/rxjs/src/materialize.ts index ae39b27bf2..8e623f7b93 100644 --- a/packages/rxjs/src/materialize.ts +++ b/packages/rxjs/src/materialize.ts @@ -25,3 +25,20 @@ Observable.prototype[materialize] = function (this: Observable): Observabl }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `materialize` form of the exact-Symbol `[materialize]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[materialize]` to its source. + */ +export function pipeableMaterialize(): (source: Observable) => Observable & ObservableNotification>; +export function pipeableMaterialize(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[materialize] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/max.ts b/packages/rxjs/src/max.ts index 10208b7970..a3612b6d06 100644 --- a/packages/rxjs/src/max.ts +++ b/packages/rxjs/src/max.ts @@ -18,3 +18,20 @@ Observable.prototype[max] = function (this: Observable, comparer?: Compare return this[reduce](selectMaximum); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `max` form of the exact-Symbol `[max]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[max]` to its source. + */ +export function pipeableMax(comparer?: Comparer): (source: Observable) => Observable; +export function pipeableMax(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[max] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/merge-map.ts b/packages/rxjs/src/merge-map.ts index e013894746..3a55d5f46d 100644 --- a/packages/rxjs/src/merge-map.ts +++ b/packages/rxjs/src/merge-map.ts @@ -58,3 +58,20 @@ Observable.prototype[mergeMap] = function ( }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `mergeMap` form of the exact-Symbol `[mergeMap]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[mergeMap]` to its source. + */ +export function pipeableMergeMap(mapper: (value: T, index: number) => ObservableInput, options?: { concurrent?: number }): (source: Observable) => Observable; +export function pipeableMergeMap(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[mergeMap] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/merge-scan.ts b/packages/rxjs/src/merge-scan.ts index 74baabadb5..d8cce31ade 100644 --- a/packages/rxjs/src/merge-scan.ts +++ b/packages/rxjs/src/merge-scan.ts @@ -99,3 +99,20 @@ Observable.prototype[mergeScan] = function ( }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `mergeScan` form of the exact-Symbol `[mergeScan]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[mergeScan]` to its source. + */ +export function pipeableMergeScan(accumulator: (accumulator: R, value: T, index: number) => ObservableInput, seed: R, concurrent?: number): (source: Observable) => Observable; +export function pipeableMergeScan(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[mergeScan] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/merge.ts b/packages/rxjs/src/merge.ts index 011360d1e2..daeb164cc9 100644 --- a/packages/rxjs/src/merge.ts +++ b/packages/rxjs/src/merge.ts @@ -71,3 +71,31 @@ function mergeImpl[]>( subscribeNext(); }); } + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `mergeWith` form of the exact-Symbol `[merge]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[merge]` to its source. + */ +export function pipeableMerge[]>(sources: Sources, config?: { concurrency?: number }): (source: Observable) => Observable>; +export function pipeableMerge(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[merge] as (...values: any[]) => any, source, args); +} + +/** + * Calls the static exact-Symbol `Observable[merge]` capability as an ordinary function. + * + * Construction, conversion, error forwarding, and cancellation remain owned + * by the installed Symbol implementation. + */ +export function staticMerge[]>(sources: Sources, config?: { concurrency?: number }): Observable>; +export function staticMerge(...args: any[]): any { + return Reflect.apply(Observable[merge] as (...values: any[]) => any, Observable, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/min.ts b/packages/rxjs/src/min.ts index 7854f4db42..1a301f8257 100644 --- a/packages/rxjs/src/min.ts +++ b/packages/rxjs/src/min.ts @@ -16,3 +16,20 @@ Observable.prototype[min] = function (this: Observable, comparer?: (previo return this[reduce](selectMinimum); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `min` form of the exact-Symbol `[min]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[min]` to its source. + */ +export function pipeableMin(comparer?: (previous: T, current: T) => number): (source: Observable) => Observable; +export function pipeableMin(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[min] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/multicast.ts b/packages/rxjs/src/multicast.ts index 3007b21f27..16a29b4e53 100644 --- a/packages/rxjs/src/multicast.ts +++ b/packages/rxjs/src/multicast.ts @@ -32,3 +32,20 @@ Observable.prototype[multicast] = function (subject: SubjectLike): (source: Observable) => ConnectableObservable; +export function pipeableMulticast(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[multicast] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/observe-on.ts b/packages/rxjs/src/observe-on.ts index 5e375a77ab..b685364d40 100644 --- a/packages/rxjs/src/observe-on.ts +++ b/packages/rxjs/src/observe-on.ts @@ -40,3 +40,20 @@ Observable.prototype[observeOn] = function (this: Observable, delay = 0): }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `observeOn` form of the exact-Symbol `[observeOn]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[observeOn]` to its source. + */ +export function pipeableObserveOn(delay?: number): (source: Observable) => Observable; +export function pipeableObserveOn(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[observeOn] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/on-error-resume-next.ts b/packages/rxjs/src/on-error-resume-next.ts index b85ee5f803..62b7750858 100644 --- a/packages/rxjs/src/on-error-resume-next.ts +++ b/packages/rxjs/src/on-error-resume-next.ts @@ -52,3 +52,31 @@ function onErrorResumeNextImpl[]>( subscribeNext(); }); } + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `onErrorResumeNextWith` form of the exact-Symbol `[onErrorResumeNext]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[onErrorResumeNext]` to its source. + */ +export function pipeableOnErrorResumeNext[]>(sources: Sources): (source: Observable) => Observable>; +export function pipeableOnErrorResumeNext(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[onErrorResumeNext] as (...values: any[]) => any, source, args); +} + +/** + * Calls the static exact-Symbol `Observable[onErrorResumeNext]` capability as an ordinary function. + * + * Construction, conversion, error forwarding, and cancellation remain owned + * by the installed Symbol implementation. + */ +export function staticOnErrorResumeNext[]>(sources: Sources): Observable>; +export function staticOnErrorResumeNext(...args: any[]): any { + return Reflect.apply(Observable[onErrorResumeNext] as (...values: any[]) => any, Observable, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/pairwise.ts b/packages/rxjs/src/pairwise.ts index aa6f3834ba..4a7b1b2242 100644 --- a/packages/rxjs/src/pairwise.ts +++ b/packages/rxjs/src/pairwise.ts @@ -27,3 +27,20 @@ Observable.prototype[pairwise] = function (this: Observable): Observable<[ }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `pairwise` form of the exact-Symbol `[pairwise]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[pairwise]` to its source. + */ +export function pipeablePairwise(): (source: Observable) => Observable<[T, T]>; +export function pipeablePairwise(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[pairwise] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/partition.ts b/packages/rxjs/src/partition.ts index 9b005953a1..b8c1a4253c 100644 --- a/packages/rxjs/src/partition.ts +++ b/packages/rxjs/src/partition.ts @@ -48,3 +48,22 @@ function partitionImpl(this: ObservableCtor, source: ObservableInput, pred } Observable[partition] = partitionImpl; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Calls the static exact-Symbol `Observable[partition]` capability as an ordinary function. + * + * Construction, conversion, error forwarding, and cancellation remain owned + * by the installed Symbol implementation. + */ +export function staticPartition(source: ObservableInput, predicate: (value: T, index: number) => value is U): [ + Observable, + Observable> + ]; +export function staticPartition(source: ObservableInput, predicate: (value: T, index: number) => boolean): [Observable, Observable]; +export function staticPartition(...args: any[]): any { + return Reflect.apply(Observable[partition] as (...values: any[]) => any, Observable, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/pipe.ts b/packages/rxjs/src/pipe.ts index 6cb8c47b7e..2786117e86 100644 --- a/packages/rxjs/src/pipe.ts +++ b/packages/rxjs/src/pipe.ts @@ -58,3 +58,26 @@ function staticPipe(this: ObservableCtor, source: ObservableInput, ...fns: Observable[pipe] = staticPipe; Observable.prototype[pipe] = instancePipe; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `pipe` form of the exact-Symbol `[pipe]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. Any non-Observable result is returned unchanged. + * + * @returns A unary function that applies `[pipe]` to its source. + */ +export function pipeablePipe(t: Fn, A>, a: Fn, b: Fn, c: Fn, d: Fn, e: Fn, f: Fn): (source: Observable) => G; +export function pipeablePipe(t: Fn, A>, a: Fn, b: Fn, c: Fn, d: Fn, e: Fn): (source: Observable) => F; +export function pipeablePipe(t: Fn, A>, a: Fn, b: Fn, c: Fn, d: Fn): (source: Observable) => E; +export function pipeablePipe(t: Fn, A>, a: Fn, b: Fn, c: Fn): (source: Observable) => D; +export function pipeablePipe(t: Fn, A>, a: Fn, b: Fn): (source: Observable) => C; +export function pipeablePipe(t: Fn, A>, a: Fn): (source: Observable) => B; +export function pipeablePipe(t: Fn, A>): (source: Observable) => A; +export function pipeablePipe(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[pipe] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/pipeable/buffer-time.ts b/packages/rxjs/src/pipeable/buffer-time.ts new file mode 100644 index 0000000000..fdacbbe81e --- /dev/null +++ b/packages/rxjs/src/pipeable/buffer-time.ts @@ -0,0 +1 @@ +export { pipeableBufferTime as bufferTime } from '../buffer-time.js'; diff --git a/packages/rxjs/src/pipeable/buffer-toggle.ts b/packages/rxjs/src/pipeable/buffer-toggle.ts new file mode 100644 index 0000000000..d72f260470 --- /dev/null +++ b/packages/rxjs/src/pipeable/buffer-toggle.ts @@ -0,0 +1 @@ +export { pipeableBufferToggle as bufferToggle } from '../buffer-toggle.js'; diff --git a/packages/rxjs/src/pipeable/buffer.ts b/packages/rxjs/src/pipeable/buffer.ts new file mode 100644 index 0000000000..de5dafcea2 --- /dev/null +++ b/packages/rxjs/src/pipeable/buffer.ts @@ -0,0 +1 @@ +export { pipeableBuffer as buffer } from '../buffer.js'; diff --git a/packages/rxjs/src/pipeable/catalog.json b/packages/rxjs/src/pipeable/catalog.json new file mode 100644 index 0000000000..626394744c --- /dev/null +++ b/packages/rxjs/src/pipeable/catalog.json @@ -0,0 +1,209 @@ +{ + "pipeableOperators": [ + "bufferTime", + "bufferToggle", + "buffer", + "catchError", + "combineLatestAll", + "combineLatestWith", + "combineWith", + "concatWith", + "connect", + "count", + "debounce", + "defaultIfEmpty", + "delayWhen", + "delay", + "dematerialize", + "distinctUntilChanged", + "distinctUntilKeyChanged", + "distinct", + "elementAt", + "every", + "exhaustMap", + "expand", + "filter", + "finalize", + "findIndex", + "find", + "first", + "groupBy", + "isEmpty", + "iterateBufferedValues", + "iterateEachValue", + "iterateLatestValue", + "iterateNextValue", + "last", + "map", + "materialize", + "max", + "mergeMap", + "mergeScan", + "mergeWith", + "min", + "multicast", + "observeOn", + "onErrorResumeNextWith", + "pairwise", + "pipe", + "pluck", + "publishBehavior", + "publishLast", + "publishReplay", + "publish", + "raceWith", + "reduce", + "refCount", + "repeatWhen", + "repeat", + "retryWhen", + "retry", + "sampleTime", + "sample", + "scan", + "sequenceEqual", + "shareReplay", + "share", + "single", + "skipLast", + "skipUntil", + "skipWhile", + "skip", + "startWith", + "subscribeOn", + "switchMap", + "switchScan", + "takeLast", + "takeUntil", + "takeWhile", + "take", + "tap", + "throttle", + "throwIfEmpty", + "timeInterval", + "timeout", + "timestamp", + "windowCount", + "windowTime", + "windowToggle", + "windowWhen", + "window", + "withLatestFrom", + "zipAll", + "zipWith" + ], + "staticFunctions": [ + "animationFrames", + "combineLatest", + "combine", + "concat", + "forkJoin", + "generate", + "interval", + "merge", + "onErrorResumeNext", + "partition", + "race", + "timer" + ], + "symbols": [ + "animationFrames", + "bufferTime", + "bufferToggle", + "buffer", + "catchError", + "combineLatestAll", + "combineLatest", + "combine", + "concat", + "connect", + "count", + "create", + "debounce", + "defaultIfEmpty", + "delayWhen", + "delay", + "dematerialize", + "distinctUntilChanged", + "distinctUntilKeyChanged", + "distinct", + "elementAt", + "every", + "exhaustMap", + "expand", + "filter", + "finalize", + "findIndex", + "find", + "first", + "forkJoin", + "generate", + "groupBy", + "interval", + "isEmpty", + "iterateBufferedValues", + "iterateEachValue", + "iterateLatestValue", + "iterateNextValue", + "last", + "map", + "materialize", + "max", + "mergeMap", + "mergeScan", + "merge", + "min", + "multicast", + "observeOn", + "onErrorResumeNext", + "pairwise", + "partition", + "pipe", + "pluck", + "publishBehavior", + "publishLast", + "publishReplay", + "publish", + "race", + "reduce", + "refCount", + "repeatWhen", + "repeat", + "retryWhen", + "retry", + "sampleTime", + "sample", + "scan", + "sequenceEqual", + "shareReplay", + "share", + "single", + "skipLast", + "skipUntil", + "skipWhile", + "skip", + "startWith", + "subscribeOn", + "switchMap", + "switchScan", + "takeLast", + "takeUntil", + "takeWhile", + "take", + "tap", + "throttle", + "throwIfEmpty", + "timeInterval", + "timeout", + "timer", + "timestamp", + "windowCount", + "windowTime", + "windowToggle", + "windowWhen", + "window", + "withLatestFrom", + "zipAll", + "zipWith" + ] +} diff --git a/packages/rxjs/src/pipeable/catalog.spec.ts b/packages/rxjs/src/pipeable/catalog.spec.ts new file mode 100644 index 0000000000..55f2bb05f4 --- /dev/null +++ b/packages/rxjs/src/pipeable/catalog.spec.ts @@ -0,0 +1,72 @@ +import { describe, expect, expectTypeOf, it } from 'vitest'; +import * as functionalSurface from '../index.js'; +import { merge as mergeSymbol } from '../merge.js'; +import * as symbolSurface from '../symbol/index.js'; +import catalog from './catalog.json' with { type: 'json' }; + +describe('complete functional surface', () => { + it('exports every source-bound capability as a root function', () => { + const exports = functionalSurface as unknown as Record; + + for (const name of catalog.pipeableOperators) { + expect(exports[name], `missing pipeable root export ${name}`).toBeTypeOf('function'); + } + }); + + it('exports every static capability as a root function', () => { + const exports = functionalSurface as unknown as Record; + + for (const name of catalog.staticFunctions) { + expect(exports[name], `missing static root export ${name}`).toBeTypeOf('function'); + } + }); + + it('retains every exact Symbol through the symbol barrel', () => { + const exports = symbolSurface as unknown as Record; + + for (const name of catalog.symbols) { + expect(exports[name], `missing exact Symbol export ${name}`).toBeTypeOf('symbol'); + } + }); + + it('runs generated operators through the existing exact-Symbol implementations', () => { + const buffered: number[][] = []; + const merged: Array = []; + const symbolMerged: Array = []; + + functionalSurface.rx([1, 2, 3], functionalSurface.buffer({ maxSize: 2 })).subscribe((value) => buffered.push(value)); + functionalSurface.rx([1, 2], functionalSurface.mergeWith([['three']])).subscribe((value) => merged.push(value)); + Observable.from([1, 2])[mergeSymbol]([['three']]).subscribe((value) => symbolMerged.push(value)); + + expect(buffered).toEqual([[1, 2], [3]]); + expect(merged).toEqual([1, 2, 'three']); + expect(symbolMerged).toEqual(merged); + }); + + it('keeps AsyncIterable terminals outside the Observable result type', async () => { + const iterable = functionalSurface.rx( + [1, 2, 3], + functionalSurface.map((value) => value * 10), + functionalSurface.iterateEachValue() + ); + const values: number[] = []; + + for await (const value of iterable) { + values.push(value); + } + + expectTypeOf(iterable).toEqualTypeOf>(); + expect(values).toEqual([10, 20, 30]); + }); + + it('keeps static creation separate from source-bound *With operators', () => { + const staticValues: Array = []; + const sourceBoundValues: Array = []; + + functionalSurface.merge([[1, 2], ['three']]).subscribe((value) => staticValues.push(value)); + functionalSurface.rx([1, 2], functionalSurface.mergeWith([['three']])).subscribe((value) => sourceBoundValues.push(value)); + + expect(staticValues).toEqual([1, 2, 'three']); + expect(sourceBoundValues).toEqual(staticValues); + }); +}); diff --git a/packages/rxjs/src/pipeable/catch-error.ts b/packages/rxjs/src/pipeable/catch-error.ts new file mode 100644 index 0000000000..df57ca35a5 --- /dev/null +++ b/packages/rxjs/src/pipeable/catch-error.ts @@ -0,0 +1 @@ +export { pipeableCatchError as catchError } from '../catch-error.js'; diff --git a/packages/rxjs/src/pipeable/combine-latest-all.ts b/packages/rxjs/src/pipeable/combine-latest-all.ts new file mode 100644 index 0000000000..75e7b88ddd --- /dev/null +++ b/packages/rxjs/src/pipeable/combine-latest-all.ts @@ -0,0 +1 @@ +export { pipeableCombineLatestAll as combineLatestAll } from '../combine-latest-all.js'; diff --git a/packages/rxjs/src/pipeable/combine-latest-with.ts b/packages/rxjs/src/pipeable/combine-latest-with.ts new file mode 100644 index 0000000000..00d18ff7e4 --- /dev/null +++ b/packages/rxjs/src/pipeable/combine-latest-with.ts @@ -0,0 +1 @@ +export { pipeableCombineLatest as combineLatestWith } from '../combine-latest.js'; diff --git a/packages/rxjs/src/pipeable/combine-with.ts b/packages/rxjs/src/pipeable/combine-with.ts new file mode 100644 index 0000000000..27076e5941 --- /dev/null +++ b/packages/rxjs/src/pipeable/combine-with.ts @@ -0,0 +1 @@ +export { pipeableCombine as combineWith } from '../combine.js'; diff --git a/packages/rxjs/src/pipeable/concat-with.ts b/packages/rxjs/src/pipeable/concat-with.ts new file mode 100644 index 0000000000..cbe42587ba --- /dev/null +++ b/packages/rxjs/src/pipeable/concat-with.ts @@ -0,0 +1 @@ +export { pipeableConcat as concatWith } from '../concat.js'; diff --git a/packages/rxjs/src/pipeable/connect.ts b/packages/rxjs/src/pipeable/connect.ts new file mode 100644 index 0000000000..52bfb7a371 --- /dev/null +++ b/packages/rxjs/src/pipeable/connect.ts @@ -0,0 +1,2 @@ +export { pipeableConnect as connect } from '../connect.js'; +export type { ConnectConfig } from '../connect.js'; diff --git a/packages/rxjs/src/pipeable/count.ts b/packages/rxjs/src/pipeable/count.ts new file mode 100644 index 0000000000..7bcdffb79a --- /dev/null +++ b/packages/rxjs/src/pipeable/count.ts @@ -0,0 +1 @@ +export { pipeableCount as count } from '../count.js'; diff --git a/packages/rxjs/src/pipeable/debounce.ts b/packages/rxjs/src/pipeable/debounce.ts new file mode 100644 index 0000000000..087684c17f --- /dev/null +++ b/packages/rxjs/src/pipeable/debounce.ts @@ -0,0 +1 @@ +export { pipeableDebounce as debounce } from '../debounce.js'; diff --git a/packages/rxjs/src/pipeable/default-if-empty.ts b/packages/rxjs/src/pipeable/default-if-empty.ts new file mode 100644 index 0000000000..012e07549a --- /dev/null +++ b/packages/rxjs/src/pipeable/default-if-empty.ts @@ -0,0 +1 @@ +export { pipeableDefaultIfEmpty as defaultIfEmpty } from '../default-if-empty.js'; diff --git a/packages/rxjs/src/pipeable/delay-when.ts b/packages/rxjs/src/pipeable/delay-when.ts new file mode 100644 index 0000000000..ff986a2417 --- /dev/null +++ b/packages/rxjs/src/pipeable/delay-when.ts @@ -0,0 +1 @@ +export { pipeableDelayWhen as delayWhen } from '../delay-when.js'; diff --git a/packages/rxjs/src/pipeable/delay.ts b/packages/rxjs/src/pipeable/delay.ts new file mode 100644 index 0000000000..3afdf05b4a --- /dev/null +++ b/packages/rxjs/src/pipeable/delay.ts @@ -0,0 +1 @@ +export { pipeableDelay as delay } from '../delay.js'; diff --git a/packages/rxjs/src/pipeable/dematerialize.ts b/packages/rxjs/src/pipeable/dematerialize.ts new file mode 100644 index 0000000000..de1a158ece --- /dev/null +++ b/packages/rxjs/src/pipeable/dematerialize.ts @@ -0,0 +1 @@ +export { pipeableDematerialize as dematerialize } from '../dematerialize.js'; diff --git a/packages/rxjs/src/pipeable/distinct-until-changed.ts b/packages/rxjs/src/pipeable/distinct-until-changed.ts new file mode 100644 index 0000000000..eef80dd073 --- /dev/null +++ b/packages/rxjs/src/pipeable/distinct-until-changed.ts @@ -0,0 +1 @@ +export { pipeableDistinctUntilChanged as distinctUntilChanged } from '../distinct-until-changed.js'; diff --git a/packages/rxjs/src/pipeable/distinct-until-key-changed.ts b/packages/rxjs/src/pipeable/distinct-until-key-changed.ts new file mode 100644 index 0000000000..81cd4f9234 --- /dev/null +++ b/packages/rxjs/src/pipeable/distinct-until-key-changed.ts @@ -0,0 +1 @@ +export { pipeableDistinctUntilKeyChanged as distinctUntilKeyChanged } from '../distinct-until-key-changed.js'; diff --git a/packages/rxjs/src/pipeable/distinct.ts b/packages/rxjs/src/pipeable/distinct.ts new file mode 100644 index 0000000000..587d12a2f3 --- /dev/null +++ b/packages/rxjs/src/pipeable/distinct.ts @@ -0,0 +1 @@ +export { pipeableDistinct as distinct } from '../distinct.js'; diff --git a/packages/rxjs/src/pipeable/element-at.ts b/packages/rxjs/src/pipeable/element-at.ts new file mode 100644 index 0000000000..9f5e5eb289 --- /dev/null +++ b/packages/rxjs/src/pipeable/element-at.ts @@ -0,0 +1 @@ +export { pipeableElementAt as elementAt } from '../element-at.js'; diff --git a/packages/rxjs/src/pipeable/every.ts b/packages/rxjs/src/pipeable/every.ts new file mode 100644 index 0000000000..8da1a3fcf3 --- /dev/null +++ b/packages/rxjs/src/pipeable/every.ts @@ -0,0 +1 @@ +export { pipeableEvery as every } from '../every.js'; diff --git a/packages/rxjs/src/pipeable/exhaust-map.ts b/packages/rxjs/src/pipeable/exhaust-map.ts new file mode 100644 index 0000000000..45b781081d --- /dev/null +++ b/packages/rxjs/src/pipeable/exhaust-map.ts @@ -0,0 +1 @@ +export { pipeableExhaustMap as exhaustMap } from '../exhaust-map.js'; diff --git a/packages/rxjs/src/pipeable/expand.ts b/packages/rxjs/src/pipeable/expand.ts new file mode 100644 index 0000000000..27d83b87c9 --- /dev/null +++ b/packages/rxjs/src/pipeable/expand.ts @@ -0,0 +1,2 @@ +export { pipeableExpand as expand } from '../expand.js'; +export type { ExpandOptions } from '../expand.js'; diff --git a/packages/rxjs/src/pipeable/finalize.ts b/packages/rxjs/src/pipeable/finalize.ts new file mode 100644 index 0000000000..ab05ff235e --- /dev/null +++ b/packages/rxjs/src/pipeable/finalize.ts @@ -0,0 +1 @@ +export { pipeableFinalize as finalize } from '../finalize.js'; diff --git a/packages/rxjs/src/pipeable/find-index.ts b/packages/rxjs/src/pipeable/find-index.ts new file mode 100644 index 0000000000..5c91259e91 --- /dev/null +++ b/packages/rxjs/src/pipeable/find-index.ts @@ -0,0 +1 @@ +export { pipeableFindIndex as findIndex } from '../find-index.js'; diff --git a/packages/rxjs/src/pipeable/find.ts b/packages/rxjs/src/pipeable/find.ts new file mode 100644 index 0000000000..3cd961b8f8 --- /dev/null +++ b/packages/rxjs/src/pipeable/find.ts @@ -0,0 +1 @@ +export { pipeableFind as find } from '../find.js'; diff --git a/packages/rxjs/src/pipeable/first.ts b/packages/rxjs/src/pipeable/first.ts new file mode 100644 index 0000000000..27e299e102 --- /dev/null +++ b/packages/rxjs/src/pipeable/first.ts @@ -0,0 +1 @@ +export { pipeableFirst as first } from '../first.js'; diff --git a/packages/rxjs/src/pipeable/group-by.ts b/packages/rxjs/src/pipeable/group-by.ts new file mode 100644 index 0000000000..9f8c0e9aca --- /dev/null +++ b/packages/rxjs/src/pipeable/group-by.ts @@ -0,0 +1,2 @@ +export { pipeableGroupBy as groupBy } from '../group-by.js'; +export type { KeyedGroupObservable, GroupByOptions } from '../group-by.js'; diff --git a/packages/rxjs/src/pipeable/index.ts b/packages/rxjs/src/pipeable/index.ts new file mode 100644 index 0000000000..dd56f69c8e --- /dev/null +++ b/packages/rxjs/src/pipeable/index.ts @@ -0,0 +1,94 @@ +export { filter } from './filter.js'; +export { map } from './map.js'; +export { subscribe, type Subscription } from './subscribe.js'; +export { take } from './take.js'; +export { toArray } from './to-array.js'; +export type { OperatorFunction, UnaryFunction } from './types.js'; +export { bufferTime } from './buffer-time.js'; +export { bufferToggle } from './buffer-toggle.js'; +export { buffer } from './buffer.js'; +export { catchError } from './catch-error.js'; +export { combineLatestAll } from './combine-latest-all.js'; +export { combineLatestWith } from './combine-latest-with.js'; +export { combineWith } from './combine-with.js'; +export { concatWith } from './concat-with.js'; +export { connect } from './connect.js'; +export { count } from './count.js'; +export { debounce } from './debounce.js'; +export { defaultIfEmpty } from './default-if-empty.js'; +export { delayWhen } from './delay-when.js'; +export { delay } from './delay.js'; +export { dematerialize } from './dematerialize.js'; +export { distinctUntilChanged } from './distinct-until-changed.js'; +export { distinctUntilKeyChanged } from './distinct-until-key-changed.js'; +export { distinct } from './distinct.js'; +export { elementAt } from './element-at.js'; +export { every } from './every.js'; +export { exhaustMap } from './exhaust-map.js'; +export { expand } from './expand.js'; +export { finalize } from './finalize.js'; +export { findIndex } from './find-index.js'; +export { find } from './find.js'; +export { first } from './first.js'; +export { groupBy } from './group-by.js'; +export { isEmpty } from './is-empty.js'; +export { iterateBufferedValues } from './iterate-buffered-values.js'; +export { iterateEachValue } from './iterate-each-value.js'; +export { iterateLatestValue } from './iterate-latest-value.js'; +export { iterateNextValue } from './iterate-next-value.js'; +export { last } from './last.js'; +export { materialize } from './materialize.js'; +export { max } from './max.js'; +export { mergeMap } from './merge-map.js'; +export { mergeScan } from './merge-scan.js'; +export { mergeWith } from './merge-with.js'; +export { min } from './min.js'; +export { multicast } from './multicast.js'; +export { observeOn } from './observe-on.js'; +export { onErrorResumeNextWith } from './on-error-resume-next-with.js'; +export { pairwise } from './pairwise.js'; +export { pipe } from './pipe.js'; +export { pluck } from './pluck.js'; +export { publishBehavior } from './publish-behavior.js'; +export { publishLast } from './publish-last.js'; +export { publishReplay } from './publish-replay.js'; +export { publish } from './publish.js'; +export { raceWith } from './race-with.js'; +export { reduce } from './reduce.js'; +export { refCount } from './ref-count.js'; +export { repeatWhen } from './repeat-when.js'; +export { repeat } from './repeat.js'; +export { retryWhen } from './retry-when.js'; +export { retry } from './retry.js'; +export { sampleTime } from './sample-time.js'; +export { sample } from './sample.js'; +export { scan } from './scan.js'; +export { sequenceEqual } from './sequence-equal.js'; +export { shareReplay } from './share-replay.js'; +export { share } from './share.js'; +export { single } from './single.js'; +export { skipLast } from './skip-last.js'; +export { skipUntil } from './skip-until.js'; +export { skipWhile } from './skip-while.js'; +export { skip } from './skip.js'; +export { startWith } from './start-with.js'; +export { subscribeOn } from './subscribe-on.js'; +export { switchMap } from './switch-map.js'; +export { switchScan } from './switch-scan.js'; +export { takeLast } from './take-last.js'; +export { takeUntil } from './take-until.js'; +export { takeWhile } from './take-while.js'; +export { tap } from './tap.js'; +export { throttle } from './throttle.js'; +export { throwIfEmpty } from './throw-if-empty.js'; +export { timeInterval } from './time-interval.js'; +export { timeout } from './timeout.js'; +export { timestamp } from './timestamp.js'; +export { windowCount } from './window-count.js'; +export { windowTime } from './window-time.js'; +export { windowToggle } from './window-toggle.js'; +export { windowWhen } from './window-when.js'; +export { window } from './window.js'; +export { withLatestFrom } from './with-latest-from.js'; +export { zipAll } from './zip-all.js'; +export { zipWith } from './zip-with.js'; diff --git a/packages/rxjs/src/pipeable/is-empty.ts b/packages/rxjs/src/pipeable/is-empty.ts new file mode 100644 index 0000000000..05b7529589 --- /dev/null +++ b/packages/rxjs/src/pipeable/is-empty.ts @@ -0,0 +1 @@ +export { pipeableIsEmpty as isEmpty } from '../is-empty.js'; diff --git a/packages/rxjs/src/pipeable/iterate-buffered-values.ts b/packages/rxjs/src/pipeable/iterate-buffered-values.ts new file mode 100644 index 0000000000..235f657c63 --- /dev/null +++ b/packages/rxjs/src/pipeable/iterate-buffered-values.ts @@ -0,0 +1 @@ +export { pipeableIterateBufferedValues as iterateBufferedValues } from '../iterate-buffered-values.js'; diff --git a/packages/rxjs/src/pipeable/iterate-each-value.ts b/packages/rxjs/src/pipeable/iterate-each-value.ts new file mode 100644 index 0000000000..7dea4d0ca5 --- /dev/null +++ b/packages/rxjs/src/pipeable/iterate-each-value.ts @@ -0,0 +1 @@ +export { pipeableIterateEachValue as iterateEachValue } from '../iterate-each-value.js'; diff --git a/packages/rxjs/src/pipeable/iterate-latest-value.ts b/packages/rxjs/src/pipeable/iterate-latest-value.ts new file mode 100644 index 0000000000..a2f97b6b41 --- /dev/null +++ b/packages/rxjs/src/pipeable/iterate-latest-value.ts @@ -0,0 +1 @@ +export { pipeableIterateLatestValue as iterateLatestValue } from '../iterate-latest-value.js'; diff --git a/packages/rxjs/src/pipeable/iterate-next-value.ts b/packages/rxjs/src/pipeable/iterate-next-value.ts new file mode 100644 index 0000000000..03fd7e13e8 --- /dev/null +++ b/packages/rxjs/src/pipeable/iterate-next-value.ts @@ -0,0 +1 @@ +export { pipeableIterateNextValue as iterateNextValue } from '../iterate-next-value.js'; diff --git a/packages/rxjs/src/pipeable/last.ts b/packages/rxjs/src/pipeable/last.ts new file mode 100644 index 0000000000..506412ee6c --- /dev/null +++ b/packages/rxjs/src/pipeable/last.ts @@ -0,0 +1 @@ +export { pipeableLast as last } from '../last.js'; diff --git a/packages/rxjs/src/pipeable/materialize.ts b/packages/rxjs/src/pipeable/materialize.ts new file mode 100644 index 0000000000..2ce6efd783 --- /dev/null +++ b/packages/rxjs/src/pipeable/materialize.ts @@ -0,0 +1 @@ +export { pipeableMaterialize as materialize } from '../materialize.js'; diff --git a/packages/rxjs/src/pipeable/max.ts b/packages/rxjs/src/pipeable/max.ts new file mode 100644 index 0000000000..4d51becafd --- /dev/null +++ b/packages/rxjs/src/pipeable/max.ts @@ -0,0 +1 @@ +export { pipeableMax as max } from '../max.js'; diff --git a/packages/rxjs/src/pipeable/merge-map.ts b/packages/rxjs/src/pipeable/merge-map.ts new file mode 100644 index 0000000000..2b39929d0c --- /dev/null +++ b/packages/rxjs/src/pipeable/merge-map.ts @@ -0,0 +1 @@ +export { pipeableMergeMap as mergeMap } from '../merge-map.js'; diff --git a/packages/rxjs/src/pipeable/merge-scan.ts b/packages/rxjs/src/pipeable/merge-scan.ts new file mode 100644 index 0000000000..3a7e68e7aa --- /dev/null +++ b/packages/rxjs/src/pipeable/merge-scan.ts @@ -0,0 +1 @@ +export { pipeableMergeScan as mergeScan } from '../merge-scan.js'; diff --git a/packages/rxjs/src/pipeable/merge-with.ts b/packages/rxjs/src/pipeable/merge-with.ts new file mode 100644 index 0000000000..686e623334 --- /dev/null +++ b/packages/rxjs/src/pipeable/merge-with.ts @@ -0,0 +1 @@ +export { pipeableMerge as mergeWith } from '../merge.js'; diff --git a/packages/rxjs/src/pipeable/min.ts b/packages/rxjs/src/pipeable/min.ts new file mode 100644 index 0000000000..656b087d2d --- /dev/null +++ b/packages/rxjs/src/pipeable/min.ts @@ -0,0 +1 @@ +export { pipeableMin as min } from '../min.js'; diff --git a/packages/rxjs/src/pipeable/multicast.ts b/packages/rxjs/src/pipeable/multicast.ts new file mode 100644 index 0000000000..45e030f8dc --- /dev/null +++ b/packages/rxjs/src/pipeable/multicast.ts @@ -0,0 +1 @@ +export { pipeableMulticast as multicast } from '../multicast.js'; diff --git a/packages/rxjs/src/pipeable/observe-on.ts b/packages/rxjs/src/pipeable/observe-on.ts new file mode 100644 index 0000000000..1eaa72304a --- /dev/null +++ b/packages/rxjs/src/pipeable/observe-on.ts @@ -0,0 +1 @@ +export { pipeableObserveOn as observeOn } from '../observe-on.js'; diff --git a/packages/rxjs/src/pipeable/on-error-resume-next-with.ts b/packages/rxjs/src/pipeable/on-error-resume-next-with.ts new file mode 100644 index 0000000000..c6aa58a7af --- /dev/null +++ b/packages/rxjs/src/pipeable/on-error-resume-next-with.ts @@ -0,0 +1 @@ +export { pipeableOnErrorResumeNext as onErrorResumeNextWith } from '../on-error-resume-next.js'; diff --git a/packages/rxjs/src/pipeable/pairwise.ts b/packages/rxjs/src/pipeable/pairwise.ts new file mode 100644 index 0000000000..ec94893f52 --- /dev/null +++ b/packages/rxjs/src/pipeable/pairwise.ts @@ -0,0 +1 @@ +export { pipeablePairwise as pairwise } from '../pairwise.js'; diff --git a/packages/rxjs/src/pipeable/pipe.ts b/packages/rxjs/src/pipeable/pipe.ts new file mode 100644 index 0000000000..914c50ad12 --- /dev/null +++ b/packages/rxjs/src/pipeable/pipe.ts @@ -0,0 +1 @@ +export { pipeablePipe as pipe } from '../pipe.js'; diff --git a/packages/rxjs/src/pipeable/pluck.ts b/packages/rxjs/src/pipeable/pluck.ts new file mode 100644 index 0000000000..9a3f6619ca --- /dev/null +++ b/packages/rxjs/src/pipeable/pluck.ts @@ -0,0 +1 @@ +export { pipeablePluck as pluck } from '../pluck.js'; diff --git a/packages/rxjs/src/pipeable/publish-behavior.ts b/packages/rxjs/src/pipeable/publish-behavior.ts new file mode 100644 index 0000000000..fe83f2baf5 --- /dev/null +++ b/packages/rxjs/src/pipeable/publish-behavior.ts @@ -0,0 +1 @@ +export { pipeablePublishBehavior as publishBehavior } from '../publish-behavior.js'; diff --git a/packages/rxjs/src/pipeable/publish-last.ts b/packages/rxjs/src/pipeable/publish-last.ts new file mode 100644 index 0000000000..d4ae87e1e0 --- /dev/null +++ b/packages/rxjs/src/pipeable/publish-last.ts @@ -0,0 +1 @@ +export { pipeablePublishLast as publishLast } from '../publish-last.js'; diff --git a/packages/rxjs/src/pipeable/publish-replay.ts b/packages/rxjs/src/pipeable/publish-replay.ts new file mode 100644 index 0000000000..9a521ebfaa --- /dev/null +++ b/packages/rxjs/src/pipeable/publish-replay.ts @@ -0,0 +1,2 @@ +export { pipeablePublishReplay as publishReplay } from '../publish-replay.js'; +export type { PublishReplayTimestampProvider } from '../publish-replay.js'; diff --git a/packages/rxjs/src/pipeable/publish.ts b/packages/rxjs/src/pipeable/publish.ts new file mode 100644 index 0000000000..8964f40c5c --- /dev/null +++ b/packages/rxjs/src/pipeable/publish.ts @@ -0,0 +1 @@ +export { pipeablePublish as publish } from '../publish.js'; diff --git a/packages/rxjs/src/pipeable/race-with.ts b/packages/rxjs/src/pipeable/race-with.ts new file mode 100644 index 0000000000..2e86b41f16 --- /dev/null +++ b/packages/rxjs/src/pipeable/race-with.ts @@ -0,0 +1 @@ +export { pipeableRace as raceWith } from '../race.js'; diff --git a/packages/rxjs/src/pipeable/reduce.ts b/packages/rxjs/src/pipeable/reduce.ts new file mode 100644 index 0000000000..ceee9640bb --- /dev/null +++ b/packages/rxjs/src/pipeable/reduce.ts @@ -0,0 +1 @@ +export { pipeableReduce as reduce } from '../reduce.js'; diff --git a/packages/rxjs/src/pipeable/ref-count.ts b/packages/rxjs/src/pipeable/ref-count.ts new file mode 100644 index 0000000000..0a951ad38f --- /dev/null +++ b/packages/rxjs/src/pipeable/ref-count.ts @@ -0,0 +1 @@ +export { pipeableRefCount as refCount } from '../ref-count.js'; diff --git a/packages/rxjs/src/pipeable/repeat-when.ts b/packages/rxjs/src/pipeable/repeat-when.ts new file mode 100644 index 0000000000..49deed5c6e --- /dev/null +++ b/packages/rxjs/src/pipeable/repeat-when.ts @@ -0,0 +1 @@ +export { pipeableRepeatWhen as repeatWhen } from '../repeat-when.js'; diff --git a/packages/rxjs/src/pipeable/repeat.ts b/packages/rxjs/src/pipeable/repeat.ts new file mode 100644 index 0000000000..5a6fbc3d1c --- /dev/null +++ b/packages/rxjs/src/pipeable/repeat.ts @@ -0,0 +1 @@ +export { pipeableRepeat as repeat } from '../repeat.js'; diff --git a/packages/rxjs/src/pipeable/retry-when.ts b/packages/rxjs/src/pipeable/retry-when.ts new file mode 100644 index 0000000000..90e5b31127 --- /dev/null +++ b/packages/rxjs/src/pipeable/retry-when.ts @@ -0,0 +1 @@ +export { pipeableRetryWhen as retryWhen } from '../retry-when.js'; diff --git a/packages/rxjs/src/pipeable/retry.ts b/packages/rxjs/src/pipeable/retry.ts new file mode 100644 index 0000000000..e57d31e35a --- /dev/null +++ b/packages/rxjs/src/pipeable/retry.ts @@ -0,0 +1 @@ +export { pipeableRetry as retry } from '../retry.js'; diff --git a/packages/rxjs/src/pipeable/sample-time.ts b/packages/rxjs/src/pipeable/sample-time.ts new file mode 100644 index 0000000000..b12dad3832 --- /dev/null +++ b/packages/rxjs/src/pipeable/sample-time.ts @@ -0,0 +1 @@ +export { pipeableSampleTime as sampleTime } from '../sample-time.js'; diff --git a/packages/rxjs/src/pipeable/sample.ts b/packages/rxjs/src/pipeable/sample.ts new file mode 100644 index 0000000000..61518de475 --- /dev/null +++ b/packages/rxjs/src/pipeable/sample.ts @@ -0,0 +1 @@ +export { pipeableSample as sample } from '../sample.js'; diff --git a/packages/rxjs/src/pipeable/scan.ts b/packages/rxjs/src/pipeable/scan.ts new file mode 100644 index 0000000000..6238b09abc --- /dev/null +++ b/packages/rxjs/src/pipeable/scan.ts @@ -0,0 +1 @@ +export { pipeableScan as scan } from '../scan.js'; diff --git a/packages/rxjs/src/pipeable/sequence-equal.ts b/packages/rxjs/src/pipeable/sequence-equal.ts new file mode 100644 index 0000000000..e7847771fd --- /dev/null +++ b/packages/rxjs/src/pipeable/sequence-equal.ts @@ -0,0 +1 @@ +export { pipeableSequenceEqual as sequenceEqual } from '../sequence-equal.js'; diff --git a/packages/rxjs/src/pipeable/share-replay.ts b/packages/rxjs/src/pipeable/share-replay.ts new file mode 100644 index 0000000000..20407b9e8e --- /dev/null +++ b/packages/rxjs/src/pipeable/share-replay.ts @@ -0,0 +1,2 @@ +export { pipeableShareReplay as shareReplay } from '../share-replay.js'; +export type { ShareReplayConfig } from '../share-replay.js'; diff --git a/packages/rxjs/src/pipeable/share.ts b/packages/rxjs/src/pipeable/share.ts new file mode 100644 index 0000000000..8fd21b2fb9 --- /dev/null +++ b/packages/rxjs/src/pipeable/share.ts @@ -0,0 +1,2 @@ +export { pipeableShare as share } from '../share.js'; +export type { ShareConfig } from '../share.js'; diff --git a/packages/rxjs/src/pipeable/single.ts b/packages/rxjs/src/pipeable/single.ts new file mode 100644 index 0000000000..ee3b9a8760 --- /dev/null +++ b/packages/rxjs/src/pipeable/single.ts @@ -0,0 +1 @@ +export { pipeableSingle as single } from '../single.js'; diff --git a/packages/rxjs/src/pipeable/skip-last.ts b/packages/rxjs/src/pipeable/skip-last.ts new file mode 100644 index 0000000000..e80dd42b81 --- /dev/null +++ b/packages/rxjs/src/pipeable/skip-last.ts @@ -0,0 +1 @@ +export { pipeableSkipLast as skipLast } from '../skip-last.js'; diff --git a/packages/rxjs/src/pipeable/skip-until.ts b/packages/rxjs/src/pipeable/skip-until.ts new file mode 100644 index 0000000000..78f2bd7d0d --- /dev/null +++ b/packages/rxjs/src/pipeable/skip-until.ts @@ -0,0 +1 @@ +export { pipeableSkipUntil as skipUntil } from '../skip-until.js'; diff --git a/packages/rxjs/src/pipeable/skip-while.ts b/packages/rxjs/src/pipeable/skip-while.ts new file mode 100644 index 0000000000..1702f63ab3 --- /dev/null +++ b/packages/rxjs/src/pipeable/skip-while.ts @@ -0,0 +1 @@ +export { pipeableSkipWhile as skipWhile } from '../skip-while.js'; diff --git a/packages/rxjs/src/pipeable/skip.ts b/packages/rxjs/src/pipeable/skip.ts new file mode 100644 index 0000000000..60b102d68b --- /dev/null +++ b/packages/rxjs/src/pipeable/skip.ts @@ -0,0 +1 @@ +export { pipeableSkip as skip } from '../skip.js'; diff --git a/packages/rxjs/src/pipeable/start-with.ts b/packages/rxjs/src/pipeable/start-with.ts new file mode 100644 index 0000000000..18c71da1e8 --- /dev/null +++ b/packages/rxjs/src/pipeable/start-with.ts @@ -0,0 +1 @@ +export { pipeableStartWith as startWith } from '../start-with.js'; diff --git a/packages/rxjs/src/pipeable/subscribe-on.ts b/packages/rxjs/src/pipeable/subscribe-on.ts new file mode 100644 index 0000000000..0cf675cfe4 --- /dev/null +++ b/packages/rxjs/src/pipeable/subscribe-on.ts @@ -0,0 +1 @@ +export { pipeableSubscribeOn as subscribeOn } from '../subscribe-on.js'; diff --git a/packages/rxjs/src/pipeable/switch-map.ts b/packages/rxjs/src/pipeable/switch-map.ts new file mode 100644 index 0000000000..5e4c215ce4 --- /dev/null +++ b/packages/rxjs/src/pipeable/switch-map.ts @@ -0,0 +1 @@ +export { pipeableSwitchMap as switchMap } from '../switch-map.js'; diff --git a/packages/rxjs/src/pipeable/switch-scan.ts b/packages/rxjs/src/pipeable/switch-scan.ts new file mode 100644 index 0000000000..69a61082d2 --- /dev/null +++ b/packages/rxjs/src/pipeable/switch-scan.ts @@ -0,0 +1 @@ +export { pipeableSwitchScan as switchScan } from '../switch-scan.js'; diff --git a/packages/rxjs/src/pipeable/take-last.ts b/packages/rxjs/src/pipeable/take-last.ts new file mode 100644 index 0000000000..8e75a1695a --- /dev/null +++ b/packages/rxjs/src/pipeable/take-last.ts @@ -0,0 +1 @@ +export { pipeableTakeLast as takeLast } from '../take-last.js'; diff --git a/packages/rxjs/src/pipeable/take-until.ts b/packages/rxjs/src/pipeable/take-until.ts new file mode 100644 index 0000000000..71d1356cb4 --- /dev/null +++ b/packages/rxjs/src/pipeable/take-until.ts @@ -0,0 +1 @@ +export { pipeableTakeUntil as takeUntil } from '../take-until.js'; diff --git a/packages/rxjs/src/pipeable/take-while.ts b/packages/rxjs/src/pipeable/take-while.ts new file mode 100644 index 0000000000..062aead0e8 --- /dev/null +++ b/packages/rxjs/src/pipeable/take-while.ts @@ -0,0 +1 @@ +export { pipeableTakeWhile as takeWhile } from '../take-while.js'; diff --git a/packages/rxjs/src/pipeable/tap.ts b/packages/rxjs/src/pipeable/tap.ts new file mode 100644 index 0000000000..2bb19f0eaa --- /dev/null +++ b/packages/rxjs/src/pipeable/tap.ts @@ -0,0 +1,2 @@ +export { pipeableTap as tap } from '../tap.js'; +export type { TapObserver } from '../tap.js'; diff --git a/packages/rxjs/src/pipeable/throttle.ts b/packages/rxjs/src/pipeable/throttle.ts new file mode 100644 index 0000000000..c7177f2630 --- /dev/null +++ b/packages/rxjs/src/pipeable/throttle.ts @@ -0,0 +1 @@ +export { pipeableThrottle as throttle } from '../throttle.js'; diff --git a/packages/rxjs/src/pipeable/throw-if-empty.ts b/packages/rxjs/src/pipeable/throw-if-empty.ts new file mode 100644 index 0000000000..4df2603e54 --- /dev/null +++ b/packages/rxjs/src/pipeable/throw-if-empty.ts @@ -0,0 +1 @@ +export { pipeableThrowIfEmpty as throwIfEmpty } from '../throw-if-empty.js'; diff --git a/packages/rxjs/src/pipeable/time-interval.ts b/packages/rxjs/src/pipeable/time-interval.ts new file mode 100644 index 0000000000..a60338533e --- /dev/null +++ b/packages/rxjs/src/pipeable/time-interval.ts @@ -0,0 +1,2 @@ +export { pipeableTimeInterval as timeInterval, TimeInterval } from '../time-interval.js'; +export type { TimeIntervalProvider } from '../time-interval.js'; diff --git a/packages/rxjs/src/pipeable/timeout.ts b/packages/rxjs/src/pipeable/timeout.ts new file mode 100644 index 0000000000..e643f6da3d --- /dev/null +++ b/packages/rxjs/src/pipeable/timeout.ts @@ -0,0 +1 @@ +export { pipeableTimeout as timeout } from '../timeout.js'; diff --git a/packages/rxjs/src/pipeable/timestamp.ts b/packages/rxjs/src/pipeable/timestamp.ts new file mode 100644 index 0000000000..3ea36d6f63 --- /dev/null +++ b/packages/rxjs/src/pipeable/timestamp.ts @@ -0,0 +1,2 @@ +export { pipeableTimestamp as timestamp } from '../timestamp.js'; +export type { TimestampProvider, Timestamp } from '../timestamp.js'; diff --git a/packages/rxjs/src/pipeable/window-count.ts b/packages/rxjs/src/pipeable/window-count.ts new file mode 100644 index 0000000000..8fee9fdf50 --- /dev/null +++ b/packages/rxjs/src/pipeable/window-count.ts @@ -0,0 +1 @@ +export { pipeableWindowCount as windowCount } from '../window-count.js'; diff --git a/packages/rxjs/src/pipeable/window-time.ts b/packages/rxjs/src/pipeable/window-time.ts new file mode 100644 index 0000000000..dbe3b70085 --- /dev/null +++ b/packages/rxjs/src/pipeable/window-time.ts @@ -0,0 +1 @@ +export { pipeableWindowTime as windowTime } from '../window-time.js'; diff --git a/packages/rxjs/src/pipeable/window-toggle.ts b/packages/rxjs/src/pipeable/window-toggle.ts new file mode 100644 index 0000000000..4bfdc5d96c --- /dev/null +++ b/packages/rxjs/src/pipeable/window-toggle.ts @@ -0,0 +1 @@ +export { pipeableWindowToggle as windowToggle } from '../window-toggle.js'; diff --git a/packages/rxjs/src/pipeable/window-when.ts b/packages/rxjs/src/pipeable/window-when.ts new file mode 100644 index 0000000000..a4cc400446 --- /dev/null +++ b/packages/rxjs/src/pipeable/window-when.ts @@ -0,0 +1 @@ +export { pipeableWindowWhen as windowWhen } from '../window-when.js'; diff --git a/packages/rxjs/src/pipeable/window.ts b/packages/rxjs/src/pipeable/window.ts new file mode 100644 index 0000000000..610723659e --- /dev/null +++ b/packages/rxjs/src/pipeable/window.ts @@ -0,0 +1 @@ +export { pipeableWindow as window } from '../window.js'; diff --git a/packages/rxjs/src/pipeable/with-latest-from.ts b/packages/rxjs/src/pipeable/with-latest-from.ts new file mode 100644 index 0000000000..01e17a72f9 --- /dev/null +++ b/packages/rxjs/src/pipeable/with-latest-from.ts @@ -0,0 +1 @@ +export { pipeableWithLatestFrom as withLatestFrom } from '../with-latest-from.js'; diff --git a/packages/rxjs/src/pipeable/zip-all.ts b/packages/rxjs/src/pipeable/zip-all.ts new file mode 100644 index 0000000000..7cfa5e86b1 --- /dev/null +++ b/packages/rxjs/src/pipeable/zip-all.ts @@ -0,0 +1 @@ +export { pipeableZipAll as zipAll } from '../zip-all.js'; diff --git a/packages/rxjs/src/pipeable/zip-with.ts b/packages/rxjs/src/pipeable/zip-with.ts new file mode 100644 index 0000000000..3be82c3237 --- /dev/null +++ b/packages/rxjs/src/pipeable/zip-with.ts @@ -0,0 +1 @@ +export { pipeableZipWith as zipWith } from '../zip-with.js'; diff --git a/packages/rxjs/src/pluck.ts b/packages/rxjs/src/pluck.ts index 13e9d7152f..a1cceafde2 100644 --- a/packages/rxjs/src/pluck.ts +++ b/packages/rxjs/src/pluck.ts @@ -169,3 +169,28 @@ function pluckOperator(this: Observable, ...properties: PluckKey[]): Obser } Observable.prototype[pluck] = pluckOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `pluck` form of the exact-Symbol `[pluck]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[pluck]` to its source. + */ +export function pipeablePluck>(k1: K1): (source: Observable) => Observable>; +export function pipeablePluck, K2 extends keyof NonNullable>>(k1: K1, k2: K2): (source: Observable) => Observable< + PluckedValue, K2> + >; +export function pipeablePluck, K2 extends keyof NonNullable>, K3 extends keyof NonNullable, K2>>>(k1: K1, k2: K2, k3: K3): (source: Observable) => Observable, K2>, K3>>; +export function pipeablePluck, K2 extends keyof NonNullable>, K3 extends keyof NonNullable, K2>>, K4 extends keyof NonNullable, K2>, K3>>>(k1: K1, k2: K2, k3: K3, k4: K4): (source: Observable) => Observable, K2>, K3>, K4>>; +export function pipeablePluck, K2 extends keyof NonNullable>, K3 extends keyof NonNullable, K2>>, K4 extends keyof NonNullable, K2>, K3>>, K5 extends keyof NonNullable, K2>, K3>, K4>>>(k1: K1, k2: K2, k3: K3, k4: K4, k5: K5): (source: Observable) => Observable, K2>, K3>, K4>, K5>>; +export function pipeablePluck, K2 extends keyof NonNullable>, K3 extends keyof NonNullable, K2>>, K4 extends keyof NonNullable, K2>, K3>>, K5 extends keyof NonNullable, K2>, K3>, K4>>, K6 extends keyof NonNullable, K2>, K3>, K4>, K5>>>(k1: K1, k2: K2, k3: K3, k4: K4, k5: K5, k6: K6): (source: Observable) => Observable, K2>, K3>, K4>, K5>, K6>>; +export function pipeablePluck, K2 extends keyof NonNullable>, K3 extends keyof NonNullable, K2>>, K4 extends keyof NonNullable, K2>, K3>>, K5 extends keyof NonNullable, K2>, K3>, K4>>, K6 extends keyof NonNullable, K2>, K3>, K4>, K5>>>(k1: K1, k2: K2, k3: K3, k4: K4, k5: K5, k6: K6, k7: PluckKey, ...rest: PluckKey[]): (source: Observable) => Observable; +export function pipeablePluck(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[pluck] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/publish-behavior.ts b/packages/rxjs/src/publish-behavior.ts index f0ee69d87e..ca42d9fd33 100644 --- a/packages/rxjs/src/publish-behavior.ts +++ b/packages/rxjs/src/publish-behavior.ts @@ -15,3 +15,20 @@ Observable.prototype[publishBehavior] = function (this: Observable, initia // same instance across manual disconnects and terminal notifications. return this[multicast](behaviorSubject(initialValue)); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `publishBehavior` form of the exact-Symbol `[publishBehavior]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. Any non-Observable result is returned unchanged. + * + * @returns A unary function that applies `[publishBehavior]` to its source. + */ +export function pipeablePublishBehavior(initialValue: T): (source: Observable) => ConnectableObservable; +export function pipeablePublishBehavior(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[publishBehavior] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/publish-last.ts b/packages/rxjs/src/publish-last.ts index 9042c794fd..0a495bc8b5 100644 --- a/packages/rxjs/src/publish-last.ts +++ b/packages/rxjs/src/publish-last.ts @@ -15,3 +15,20 @@ Observable.prototype[publishLast] = function (this: Observable): Connectab // connectable result, including after completion or error. return this[multicast](new AsyncSubject()); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `publishLast` form of the exact-Symbol `[publishLast]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. Any non-Observable result is returned unchanged. + * + * @returns A unary function that applies `[publishLast]` to its source. + */ +export function pipeablePublishLast(): (source: Observable) => ConnectableObservable; +export function pipeablePublishLast(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[publishLast] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/publish-replay.ts b/packages/rxjs/src/publish-replay.ts index c2bdaef0f0..465bca5153 100644 --- a/packages/rxjs/src/publish-replay.ts +++ b/packages/rxjs/src/publish-replay.ts @@ -58,3 +58,20 @@ Observable.prototype[publishReplay] = function >(bufferSize: number | undefined, windowTime: number | undefined, selector: (shared: Observable) => Selected, scheduler?: PublishReplayTimestampProvider): (source: Observable) => Observable>; +export function pipeablePublishReplay(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[publishReplay] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/publish.ts b/packages/rxjs/src/publish.ts index 81f4e3de11..80bf0cdfd9 100644 --- a/packages/rxjs/src/publish.ts +++ b/packages/rxjs/src/publish.ts @@ -26,3 +26,20 @@ Observable.prototype[publish] = function ()); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `publish` form of the exact-Symbol `[publish]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. Any non-Observable result is returned unchanged. + * + * @returns A unary function that applies `[publish]` to its source. + */ +export function pipeablePublish(): (source: Observable) => ConnectableObservable; +export function pipeablePublish(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[publish] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/race.ts b/packages/rxjs/src/race.ts index b390489065..f67ea7f769 100644 --- a/packages/rxjs/src/race.ts +++ b/packages/rxjs/src/race.ts @@ -73,3 +73,31 @@ function raceImpl[]>( } }); } + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `raceWith` form of the exact-Symbol `[race]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[race]` to its source. + */ +export function pipeableRace[]>(sources: Sources): (source: Observable) => Observable>; +export function pipeableRace(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[race] as (...values: any[]) => any, source, args); +} + +/** + * Calls the static exact-Symbol `Observable[race]` capability as an ordinary function. + * + * Construction, conversion, error forwarding, and cancellation remain owned + * by the installed Symbol implementation. + */ +export function staticRace[]>(sources: Sources): Observable>; +export function staticRace(...args: any[]): any { + return Reflect.apply(Observable[race] as (...values: any[]) => any, Observable, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/reduce.ts b/packages/rxjs/src/reduce.ts index 8ee4e77516..9d7b158bef 100644 --- a/packages/rxjs/src/reduce.ts +++ b/packages/rxjs/src/reduce.ts @@ -61,3 +61,22 @@ function reduceOperator( } Observable.prototype[reduce] = reduceOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `reduce` form of the exact-Symbol `[reduce]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[reduce]` to its source. + */ +export function pipeableReduce(accumulator: (accumulator: A | T, value: T, index: number) => A): (source: Observable) => Observable; +export function pipeableReduce(accumulator: (accumulator: A, value: T, index: number) => A, seed: A): (source: Observable) => Observable
; +export function pipeableReduce(accumulator: (accumulator: A | S, value: T, index: number) => A, seed: S): (source: Observable) => Observable; +export function pipeableReduce(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[reduce] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/ref-count.ts b/packages/rxjs/src/ref-count.ts index 233fe11f6e..8d162b658d 100644 --- a/packages/rxjs/src/ref-count.ts +++ b/packages/rxjs/src/ref-count.ts @@ -107,3 +107,20 @@ function getState(source: object): RefCountState { } return state; } + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `refCount` form of the exact-Symbol `[refCount]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[refCount]` to its source. + */ +export function pipeableRefCount(): (source: ConnectableObservable) => Observable; +export function pipeableRefCount(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[refCount] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/repeat-when.ts b/packages/rxjs/src/repeat-when.ts index 4f7a16ff03..65a5773d43 100644 --- a/packages/rxjs/src/repeat-when.ts +++ b/packages/rxjs/src/repeat-when.ts @@ -78,3 +78,20 @@ Observable.prototype[repeatWhen] = function ( requestSource(); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `repeatWhen` form of the exact-Symbol `[repeatWhen]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[repeatWhen]` to its source. + */ +export function pipeableRepeatWhen(notifier: (completions: Observable) => ObservableInput): (source: Observable) => Observable; +export function pipeableRepeatWhen(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[repeatWhen] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/repeat.ts b/packages/rxjs/src/repeat.ts index 011909e9b2..f765269fec 100644 --- a/packages/rxjs/src/repeat.ts +++ b/packages/rxjs/src/repeat.ts @@ -72,3 +72,20 @@ Observable.prototype[repeat] = function ( startSub(); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `repeat` form of the exact-Symbol `[repeat]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[repeat]` to its source. + */ +export function pipeableRepeat(config?: { count?: number; delay?: number | ((repeatCount: number) => ObservableInput) }): (source: Observable) => Observable; +export function pipeableRepeat(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[repeat] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/retry-when.ts b/packages/rxjs/src/retry-when.ts index 4ffdc4f6f3..52bab3fac6 100644 --- a/packages/rxjs/src/retry-when.ts +++ b/packages/rxjs/src/retry-when.ts @@ -92,3 +92,20 @@ Observable.prototype[retryWhen] = function ( drainAttempts(); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `retryWhen` form of the exact-Symbol `[retryWhen]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[retryWhen]` to its source. + */ +export function pipeableRetryWhen(notifier: (errors: Observable) => ObservableInput): (source: Observable) => Observable; +export function pipeableRetryWhen(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[retryWhen] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/retry.ts b/packages/rxjs/src/retry.ts index a87fb39492..f52fc5c9af 100644 --- a/packages/rxjs/src/retry.ts +++ b/packages/rxjs/src/retry.ts @@ -87,3 +87,24 @@ Observable.prototype[retry] = function ( innerSub(); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `retry` form of the exact-Symbol `[retry]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[retry]` to its source. + */ +export function pipeableRetry(config?: { + count?: number; + delay?: number | ((error: any, retryCount: number) => ObservableInput); + resetOnSuccess?: boolean; + }): (source: Observable) => Observable; +export function pipeableRetry(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[retry] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/sample-time.ts b/packages/rxjs/src/sample-time.ts index 2b16340fac..92c695df34 100644 --- a/packages/rxjs/src/sample-time.ts +++ b/packages/rxjs/src/sample-time.ts @@ -34,3 +34,20 @@ Observable.prototype[sampleTime] = function (this: Observable, period: num subscriber.addTeardown(() => globalThis.clearInterval(id)); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `sampleTime` form of the exact-Symbol `[sampleTime]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[sampleTime]` to its source. + */ +export function pipeableSampleTime(period: number): (source: Observable) => Observable; +export function pipeableSampleTime(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[sampleTime] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/sample.ts b/packages/rxjs/src/sample.ts index 3e7873151f..370d7eeeab 100644 --- a/packages/rxjs/src/sample.ts +++ b/packages/rxjs/src/sample.ts @@ -46,3 +46,20 @@ Observable.prototype[sample] = function (this: Observable, notifier: Obser }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `sample` form of the exact-Symbol `[sample]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[sample]` to its source. + */ +export function pipeableSample(notifier: ObservableInput): (source: Observable) => Observable; +export function pipeableSample(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[sample] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/scan.ts b/packages/rxjs/src/scan.ts index 7344d42516..0d938edcac 100644 --- a/packages/rxjs/src/scan.ts +++ b/packages/rxjs/src/scan.ts @@ -52,3 +52,20 @@ function scanOperator( } Observable.prototype[scan] = scanOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `scan` form of the exact-Symbol `[scan]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[scan]` to its source. + */ +export function pipeableScan(accumulator: (accumulator: A | T, value: T, index: number) => A): (source: Observable) => Observable; +export function pipeableScan(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[scan] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/sequence-equal.ts b/packages/rxjs/src/sequence-equal.ts index 83131e337e..86ac040521 100644 --- a/packages/rxjs/src/sequence-equal.ts +++ b/packages/rxjs/src/sequence-equal.ts @@ -84,3 +84,20 @@ Observable.prototype[sequenceEqual] = function ( }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `sequenceEqual` form of the exact-Symbol `[sequenceEqual]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[sequenceEqual]` to its source. + */ +export function pipeableSequenceEqual(other: Observable, comparator?: (left: T, right: T) => boolean): (source: Observable) => Observable; +export function pipeableSequenceEqual(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[sequenceEqual] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/share-replay.ts b/packages/rxjs/src/share-replay.ts index 24712982f1..076bc9da5e 100644 --- a/packages/rxjs/src/share-replay.ts +++ b/packages/rxjs/src/share-replay.ts @@ -53,3 +53,20 @@ Observable.prototype[shareReplay] = function ( resetOnRefCountZero: refCount, }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `shareReplay` form of the exact-Symbol `[shareReplay]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[shareReplay]` to its source. + */ +export function pipeableShareReplay(config: ShareReplayConfig): (source: Observable) => Observable; +export function pipeableShareReplay(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[shareReplay] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/share.ts b/packages/rxjs/src/share.ts index 375f28a691..804988980b 100644 --- a/packages/rxjs/src/share.ts +++ b/packages/rxjs/src/share.ts @@ -145,3 +145,20 @@ Observable.prototype[share] = function (this: Observable, config: ShareCon } }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `share` form of the exact-Symbol `[share]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[share]` to its source. + */ +export function pipeableShare(config?: ShareConfig): (source: Observable) => Observable; +export function pipeableShare(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[share] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/single.ts b/packages/rxjs/src/single.ts index 949bd4112f..464f207f67 100644 --- a/packages/rxjs/src/single.ts +++ b/packages/rxjs/src/single.ts @@ -74,3 +74,21 @@ function singleOperator(this: Observable, predicate?: (value: T, index: nu } Observable.prototype[single] = singleOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `single` form of the exact-Symbol `[single]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[single]` to its source. + */ +export function pipeableSingle(predicate: BooleanConstructor): (source: Observable) => Observable>; +export function pipeableSingle(predicate?: (value: T, index: number, source: Observable) => boolean): (source: Observable) => Observable; +export function pipeableSingle(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[single] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/skip-last.ts b/packages/rxjs/src/skip-last.ts index dffe454efd..564c6a42e7 100644 --- a/packages/rxjs/src/skip-last.ts +++ b/packages/rxjs/src/skip-last.ts @@ -36,3 +36,20 @@ Observable.prototype[skipLast] = function (this: Observable, amount = 1): }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `skipLast` form of the exact-Symbol `[skipLast]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[skipLast]` to its source. + */ +export function pipeableSkipLast(amount?: number): (source: Observable) => Observable; +export function pipeableSkipLast(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[skipLast] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/skip-until.ts b/packages/rxjs/src/skip-until.ts index d3f92d8360..081b03769c 100644 --- a/packages/rxjs/src/skip-until.ts +++ b/packages/rxjs/src/skip-until.ts @@ -49,3 +49,20 @@ Observable.prototype[skipUntil] = function (this: Observable, notifier: Ob }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `skipUntil` form of the exact-Symbol `[skipUntil]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[skipUntil]` to its source. + */ +export function pipeableSkipUntil(notifier: ObservableInput): (source: Observable) => Observable; +export function pipeableSkipUntil(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[skipUntil] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/skip-while.ts b/packages/rxjs/src/skip-while.ts index fffbf8867a..5e3bdde59c 100644 --- a/packages/rxjs/src/skip-while.ts +++ b/packages/rxjs/src/skip-while.ts @@ -30,3 +30,21 @@ Observable.prototype[skipWhile] = function (this: Observable, predicate: ( }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `skipWhile` form of the exact-Symbol `[skipWhile]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[skipWhile]` to its source. + */ +export function pipeableSkipWhile(predicate: (value: T, index: number) => value is R): (source: Observable) => Observable>; +export function pipeableSkipWhile(predicate: (value: T, index: number) => boolean): (source: Observable) => Observable; +export function pipeableSkipWhile(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[skipWhile] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/skip.ts b/packages/rxjs/src/skip.ts index f70a1a36d7..f650db73af 100644 --- a/packages/rxjs/src/skip.ts +++ b/packages/rxjs/src/skip.ts @@ -22,3 +22,20 @@ Observable.prototype[skip] = function (this: Observable, count: number): O }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `skip` form of the exact-Symbol `[skip]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[skip]` to its source. + */ +export function pipeableSkip(count: number): (source: Observable) => Observable; +export function pipeableSkip(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[skip] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/start-with.ts b/packages/rxjs/src/start-with.ts index 39a70d459c..0c4403b36f 100644 --- a/packages/rxjs/src/start-with.ts +++ b/packages/rxjs/src/start-with.ts @@ -25,3 +25,20 @@ Observable.prototype[startWith] = function (thi subscribeToSource(this, subscriber); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `startWith` form of the exact-Symbol `[startWith]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[startWith]` to its source. + */ +export function pipeableStartWith(...values: A): (source: Observable) => Observable; +export function pipeableStartWith(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[startWith] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/static/animation-frames.ts b/packages/rxjs/src/static/animation-frames.ts new file mode 100644 index 0000000000..4b60394e15 --- /dev/null +++ b/packages/rxjs/src/static/animation-frames.ts @@ -0,0 +1,2 @@ +export { staticAnimationFrames as animationFrames } from '../animation-frames.js'; +export type { AnimationFrameTimestampProvider } from '../animation-frames.js'; diff --git a/packages/rxjs/src/static/combine-latest.ts b/packages/rxjs/src/static/combine-latest.ts new file mode 100644 index 0000000000..b56cd03e80 --- /dev/null +++ b/packages/rxjs/src/static/combine-latest.ts @@ -0,0 +1 @@ +export { staticCombineLatest as combineLatest } from '../combine-latest.js'; diff --git a/packages/rxjs/src/static/combine.ts b/packages/rxjs/src/static/combine.ts new file mode 100644 index 0000000000..523344f377 --- /dev/null +++ b/packages/rxjs/src/static/combine.ts @@ -0,0 +1 @@ +export { staticCombine as combine } from '../combine.js'; diff --git a/packages/rxjs/src/static/concat.ts b/packages/rxjs/src/static/concat.ts new file mode 100644 index 0000000000..c1aaf829fd --- /dev/null +++ b/packages/rxjs/src/static/concat.ts @@ -0,0 +1 @@ +export { staticConcat as concat } from '../concat.js'; diff --git a/packages/rxjs/src/static/fork-join.ts b/packages/rxjs/src/static/fork-join.ts new file mode 100644 index 0000000000..21bc52fcc9 --- /dev/null +++ b/packages/rxjs/src/static/fork-join.ts @@ -0,0 +1 @@ +export { staticForkJoin as forkJoin } from '../fork-join.js'; diff --git a/packages/rxjs/src/static/generate.ts b/packages/rxjs/src/static/generate.ts new file mode 100644 index 0000000000..c75e8a6936 --- /dev/null +++ b/packages/rxjs/src/static/generate.ts @@ -0,0 +1,2 @@ +export { staticGenerate as generate } from '../generate.js'; +export type { GenerateBaseOptions, GenerateOptions } from '../generate.js'; diff --git a/packages/rxjs/src/static/index.ts b/packages/rxjs/src/static/index.ts new file mode 100644 index 0000000000..ac1060ecff --- /dev/null +++ b/packages/rxjs/src/static/index.ts @@ -0,0 +1,12 @@ +export { animationFrames } from './animation-frames.js'; +export { combineLatest } from './combine-latest.js'; +export { combine } from './combine.js'; +export { concat } from './concat.js'; +export { forkJoin } from './fork-join.js'; +export { generate } from './generate.js'; +export { interval } from './interval.js'; +export { merge } from './merge.js'; +export { onErrorResumeNext } from './on-error-resume-next.js'; +export { partition } from './partition.js'; +export { race } from './race.js'; +export { timer } from './timer.js'; diff --git a/packages/rxjs/src/static/interval.ts b/packages/rxjs/src/static/interval.ts new file mode 100644 index 0000000000..2c918b3088 --- /dev/null +++ b/packages/rxjs/src/static/interval.ts @@ -0,0 +1 @@ +export { staticInterval as interval } from '../interval.js'; diff --git a/packages/rxjs/src/static/merge.ts b/packages/rxjs/src/static/merge.ts new file mode 100644 index 0000000000..61cc701ee1 --- /dev/null +++ b/packages/rxjs/src/static/merge.ts @@ -0,0 +1 @@ +export { staticMerge as merge } from '../merge.js'; diff --git a/packages/rxjs/src/static/on-error-resume-next.ts b/packages/rxjs/src/static/on-error-resume-next.ts new file mode 100644 index 0000000000..9dbd484c35 --- /dev/null +++ b/packages/rxjs/src/static/on-error-resume-next.ts @@ -0,0 +1 @@ +export { staticOnErrorResumeNext as onErrorResumeNext } from '../on-error-resume-next.js'; diff --git a/packages/rxjs/src/static/partition.ts b/packages/rxjs/src/static/partition.ts new file mode 100644 index 0000000000..95f951b53f --- /dev/null +++ b/packages/rxjs/src/static/partition.ts @@ -0,0 +1 @@ +export { staticPartition as partition } from '../partition.js'; diff --git a/packages/rxjs/src/static/race.ts b/packages/rxjs/src/static/race.ts new file mode 100644 index 0000000000..76512090e0 --- /dev/null +++ b/packages/rxjs/src/static/race.ts @@ -0,0 +1 @@ +export { staticRace as race } from '../race.js'; diff --git a/packages/rxjs/src/static/timer.ts b/packages/rxjs/src/static/timer.ts new file mode 100644 index 0000000000..ba4f46347f --- /dev/null +++ b/packages/rxjs/src/static/timer.ts @@ -0,0 +1 @@ +export { staticTimer as timer } from '../timer.js'; diff --git a/packages/rxjs/src/subscribe-on.ts b/packages/rxjs/src/subscribe-on.ts index 0ae90c2f90..ab9f7defd6 100644 --- a/packages/rxjs/src/subscribe-on.ts +++ b/packages/rxjs/src/subscribe-on.ts @@ -23,3 +23,20 @@ Observable.prototype[subscribeOn] = function (this: Observable, delay = 0) subscriber.addTeardown(() => globalThis.clearTimeout(id)); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `subscribeOn` form of the exact-Symbol `[subscribeOn]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[subscribeOn]` to its source. + */ +export function pipeableSubscribeOn(delay?: number): (source: Observable) => Observable; +export function pipeableSubscribeOn(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[subscribeOn] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/switch-map.ts b/packages/rxjs/src/switch-map.ts index be2f776ea0..47ff45713e 100644 --- a/packages/rxjs/src/switch-map.ts +++ b/packages/rxjs/src/switch-map.ts @@ -59,3 +59,20 @@ function switchMapOperator( } Observable.prototype[switchMap] = switchMapOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `switchMap` form of the exact-Symbol `[switchMap]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[switchMap]` to its source. + */ +export function pipeableSwitchMap(mapper: (value: T, index: number) => ObservableInput, options?: { concurrent?: number }): (source: Observable) => Observable; +export function pipeableSwitchMap(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[switchMap] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/switch-scan.ts b/packages/rxjs/src/switch-scan.ts index 346c131125..831e042ee5 100644 --- a/packages/rxjs/src/switch-scan.ts +++ b/packages/rxjs/src/switch-scan.ts @@ -89,3 +89,20 @@ function switchScanOperator>( } Observable.prototype[switchScan] = switchScanOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `switchScan` form of the exact-Symbol `[switchScan]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[switchScan]` to its source. + */ +export function pipeableSwitchScan>(accumulator: (accumulator: R, value: T, index: number) => Input, seed: R): (source: Observable) => Observable>; +export function pipeableSwitchScan(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[switchScan] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/symbol/animation-frames.ts b/packages/rxjs/src/symbol/animation-frames.ts new file mode 100644 index 0000000000..a829bbda85 --- /dev/null +++ b/packages/rxjs/src/symbol/animation-frames.ts @@ -0,0 +1,2 @@ +export { animationFrames } from '../animation-frames.js'; +export type { AnimationFrameTimestampProvider } from '../animation-frames.js'; diff --git a/packages/rxjs/src/symbol/buffer-time.ts b/packages/rxjs/src/symbol/buffer-time.ts new file mode 100644 index 0000000000..34900a3eab --- /dev/null +++ b/packages/rxjs/src/symbol/buffer-time.ts @@ -0,0 +1 @@ +export { bufferTime } from '../buffer-time.js'; diff --git a/packages/rxjs/src/symbol/buffer-toggle.ts b/packages/rxjs/src/symbol/buffer-toggle.ts new file mode 100644 index 0000000000..e06f5c24d9 --- /dev/null +++ b/packages/rxjs/src/symbol/buffer-toggle.ts @@ -0,0 +1 @@ +export { bufferToggle } from '../buffer-toggle.js'; diff --git a/packages/rxjs/src/symbol/buffer.ts b/packages/rxjs/src/symbol/buffer.ts new file mode 100644 index 0000000000..26bd620519 --- /dev/null +++ b/packages/rxjs/src/symbol/buffer.ts @@ -0,0 +1 @@ +export { buffer } from '../buffer.js'; diff --git a/packages/rxjs/src/symbol/catch-error.ts b/packages/rxjs/src/symbol/catch-error.ts new file mode 100644 index 0000000000..bf546552ae --- /dev/null +++ b/packages/rxjs/src/symbol/catch-error.ts @@ -0,0 +1 @@ +export { catchError } from '../catch-error.js'; diff --git a/packages/rxjs/src/symbol/combine-latest-all.ts b/packages/rxjs/src/symbol/combine-latest-all.ts new file mode 100644 index 0000000000..be40df2b85 --- /dev/null +++ b/packages/rxjs/src/symbol/combine-latest-all.ts @@ -0,0 +1 @@ +export { combineLatestAll } from '../combine-latest-all.js'; diff --git a/packages/rxjs/src/symbol/combine-latest.ts b/packages/rxjs/src/symbol/combine-latest.ts new file mode 100644 index 0000000000..a38ddbea77 --- /dev/null +++ b/packages/rxjs/src/symbol/combine-latest.ts @@ -0,0 +1 @@ +export { combineLatest } from '../combine-latest.js'; diff --git a/packages/rxjs/src/symbol/combine.ts b/packages/rxjs/src/symbol/combine.ts new file mode 100644 index 0000000000..25a1b585dd --- /dev/null +++ b/packages/rxjs/src/symbol/combine.ts @@ -0,0 +1 @@ +export { combine } from '../combine.js'; diff --git a/packages/rxjs/src/symbol/concat.ts b/packages/rxjs/src/symbol/concat.ts new file mode 100644 index 0000000000..f3889d8875 --- /dev/null +++ b/packages/rxjs/src/symbol/concat.ts @@ -0,0 +1 @@ +export { concat } from '../concat.js'; diff --git a/packages/rxjs/src/symbol/connect.ts b/packages/rxjs/src/symbol/connect.ts new file mode 100644 index 0000000000..bcd6d88907 --- /dev/null +++ b/packages/rxjs/src/symbol/connect.ts @@ -0,0 +1,2 @@ +export { connect } from '../connect.js'; +export type { ConnectConfig } from '../connect.js'; diff --git a/packages/rxjs/src/symbol/count.ts b/packages/rxjs/src/symbol/count.ts new file mode 100644 index 0000000000..0031e01153 --- /dev/null +++ b/packages/rxjs/src/symbol/count.ts @@ -0,0 +1 @@ +export { count } from '../count.js'; diff --git a/packages/rxjs/src/symbol/create.ts b/packages/rxjs/src/symbol/create.ts new file mode 100644 index 0000000000..10988beba1 --- /dev/null +++ b/packages/rxjs/src/symbol/create.ts @@ -0,0 +1 @@ +export { create } from '../create.js'; diff --git a/packages/rxjs/src/symbol/debounce.ts b/packages/rxjs/src/symbol/debounce.ts new file mode 100644 index 0000000000..836091b9a5 --- /dev/null +++ b/packages/rxjs/src/symbol/debounce.ts @@ -0,0 +1 @@ +export { debounce } from '../debounce.js'; diff --git a/packages/rxjs/src/symbol/default-if-empty.ts b/packages/rxjs/src/symbol/default-if-empty.ts new file mode 100644 index 0000000000..0e5f5f05d6 --- /dev/null +++ b/packages/rxjs/src/symbol/default-if-empty.ts @@ -0,0 +1 @@ +export { defaultIfEmpty } from '../default-if-empty.js'; diff --git a/packages/rxjs/src/symbol/delay-when.ts b/packages/rxjs/src/symbol/delay-when.ts new file mode 100644 index 0000000000..df392d3b72 --- /dev/null +++ b/packages/rxjs/src/symbol/delay-when.ts @@ -0,0 +1 @@ +export { delayWhen } from '../delay-when.js'; diff --git a/packages/rxjs/src/symbol/delay.ts b/packages/rxjs/src/symbol/delay.ts new file mode 100644 index 0000000000..3cc6c0ca92 --- /dev/null +++ b/packages/rxjs/src/symbol/delay.ts @@ -0,0 +1 @@ +export { delay } from '../delay.js'; diff --git a/packages/rxjs/src/symbol/dematerialize.ts b/packages/rxjs/src/symbol/dematerialize.ts new file mode 100644 index 0000000000..10f0df4e8d --- /dev/null +++ b/packages/rxjs/src/symbol/dematerialize.ts @@ -0,0 +1 @@ +export { dematerialize } from '../dematerialize.js'; diff --git a/packages/rxjs/src/symbol/distinct-until-changed.ts b/packages/rxjs/src/symbol/distinct-until-changed.ts new file mode 100644 index 0000000000..a6fb72751d --- /dev/null +++ b/packages/rxjs/src/symbol/distinct-until-changed.ts @@ -0,0 +1 @@ +export { distinctUntilChanged } from '../distinct-until-changed.js'; diff --git a/packages/rxjs/src/symbol/distinct-until-key-changed.ts b/packages/rxjs/src/symbol/distinct-until-key-changed.ts new file mode 100644 index 0000000000..134dea7612 --- /dev/null +++ b/packages/rxjs/src/symbol/distinct-until-key-changed.ts @@ -0,0 +1 @@ +export { distinctUntilKeyChanged } from '../distinct-until-key-changed.js'; diff --git a/packages/rxjs/src/symbol/distinct.ts b/packages/rxjs/src/symbol/distinct.ts new file mode 100644 index 0000000000..c95611c0bc --- /dev/null +++ b/packages/rxjs/src/symbol/distinct.ts @@ -0,0 +1 @@ +export { distinct } from '../distinct.js'; diff --git a/packages/rxjs/src/symbol/element-at.ts b/packages/rxjs/src/symbol/element-at.ts new file mode 100644 index 0000000000..8d31d63a4e --- /dev/null +++ b/packages/rxjs/src/symbol/element-at.ts @@ -0,0 +1 @@ +export { elementAt } from '../element-at.js'; diff --git a/packages/rxjs/src/symbol/every.ts b/packages/rxjs/src/symbol/every.ts new file mode 100644 index 0000000000..5a8c279c0c --- /dev/null +++ b/packages/rxjs/src/symbol/every.ts @@ -0,0 +1 @@ +export { every } from '../every.js'; diff --git a/packages/rxjs/src/symbol/exhaust-map.ts b/packages/rxjs/src/symbol/exhaust-map.ts new file mode 100644 index 0000000000..a951dd6f65 --- /dev/null +++ b/packages/rxjs/src/symbol/exhaust-map.ts @@ -0,0 +1 @@ +export { exhaustMap } from '../exhaust-map.js'; diff --git a/packages/rxjs/src/symbol/expand.ts b/packages/rxjs/src/symbol/expand.ts new file mode 100644 index 0000000000..cb5863c652 --- /dev/null +++ b/packages/rxjs/src/symbol/expand.ts @@ -0,0 +1,2 @@ +export { expand } from '../expand.js'; +export type { ExpandOptions } from '../expand.js'; diff --git a/packages/rxjs/src/symbol/filter.ts b/packages/rxjs/src/symbol/filter.ts new file mode 100644 index 0000000000..30585b0c41 --- /dev/null +++ b/packages/rxjs/src/symbol/filter.ts @@ -0,0 +1 @@ +export { filter } from '../filter.js'; diff --git a/packages/rxjs/src/symbol/finalize.ts b/packages/rxjs/src/symbol/finalize.ts new file mode 100644 index 0000000000..91c4479377 --- /dev/null +++ b/packages/rxjs/src/symbol/finalize.ts @@ -0,0 +1 @@ +export { finalize } from '../finalize.js'; diff --git a/packages/rxjs/src/symbol/find-index.ts b/packages/rxjs/src/symbol/find-index.ts new file mode 100644 index 0000000000..9d0c259fc4 --- /dev/null +++ b/packages/rxjs/src/symbol/find-index.ts @@ -0,0 +1 @@ +export { findIndex } from '../find-index.js'; diff --git a/packages/rxjs/src/symbol/find.ts b/packages/rxjs/src/symbol/find.ts new file mode 100644 index 0000000000..f10651df3c --- /dev/null +++ b/packages/rxjs/src/symbol/find.ts @@ -0,0 +1 @@ +export { find } from '../find.js'; diff --git a/packages/rxjs/src/symbol/first.ts b/packages/rxjs/src/symbol/first.ts new file mode 100644 index 0000000000..1952d0014f --- /dev/null +++ b/packages/rxjs/src/symbol/first.ts @@ -0,0 +1 @@ +export { first } from '../first.js'; diff --git a/packages/rxjs/src/symbol/fork-join.ts b/packages/rxjs/src/symbol/fork-join.ts new file mode 100644 index 0000000000..a13a4b3694 --- /dev/null +++ b/packages/rxjs/src/symbol/fork-join.ts @@ -0,0 +1 @@ +export { forkJoin } from '../fork-join.js'; diff --git a/packages/rxjs/src/symbol/generate.ts b/packages/rxjs/src/symbol/generate.ts new file mode 100644 index 0000000000..317608e209 --- /dev/null +++ b/packages/rxjs/src/symbol/generate.ts @@ -0,0 +1,2 @@ +export { generate } from '../generate.js'; +export type { GenerateBaseOptions, GenerateOptions } from '../generate.js'; diff --git a/packages/rxjs/src/symbol/group-by.ts b/packages/rxjs/src/symbol/group-by.ts new file mode 100644 index 0000000000..0c2282c7e4 --- /dev/null +++ b/packages/rxjs/src/symbol/group-by.ts @@ -0,0 +1,2 @@ +export { groupBy } from '../group-by.js'; +export type { KeyedGroupObservable, GroupByOptions } from '../group-by.js'; diff --git a/packages/rxjs/src/symbol/index.ts b/packages/rxjs/src/symbol/index.ts new file mode 100644 index 0000000000..40337d313d --- /dev/null +++ b/packages/rxjs/src/symbol/index.ts @@ -0,0 +1,98 @@ +export { animationFrames } from './animation-frames.js'; +export { bufferTime } from './buffer-time.js'; +export { bufferToggle } from './buffer-toggle.js'; +export { buffer } from './buffer.js'; +export { catchError } from './catch-error.js'; +export { combineLatestAll } from './combine-latest-all.js'; +export { combineLatest } from './combine-latest.js'; +export { combine } from './combine.js'; +export { concat } from './concat.js'; +export { connect } from './connect.js'; +export { count } from './count.js'; +export { create } from './create.js'; +export { debounce } from './debounce.js'; +export { defaultIfEmpty } from './default-if-empty.js'; +export { delayWhen } from './delay-when.js'; +export { delay } from './delay.js'; +export { dematerialize } from './dematerialize.js'; +export { distinctUntilChanged } from './distinct-until-changed.js'; +export { distinctUntilKeyChanged } from './distinct-until-key-changed.js'; +export { distinct } from './distinct.js'; +export { elementAt } from './element-at.js'; +export { every } from './every.js'; +export { exhaustMap } from './exhaust-map.js'; +export { expand } from './expand.js'; +export { filter } from './filter.js'; +export { finalize } from './finalize.js'; +export { findIndex } from './find-index.js'; +export { find } from './find.js'; +export { first } from './first.js'; +export { forkJoin } from './fork-join.js'; +export { generate } from './generate.js'; +export { groupBy } from './group-by.js'; +export { interval } from './interval.js'; +export { isEmpty } from './is-empty.js'; +export { iterateBufferedValues } from './iterate-buffered-values.js'; +export { iterateEachValue } from './iterate-each-value.js'; +export { iterateLatestValue } from './iterate-latest-value.js'; +export { iterateNextValue } from './iterate-next-value.js'; +export { last } from './last.js'; +export { map } from './map.js'; +export { materialize } from './materialize.js'; +export { max } from './max.js'; +export { mergeMap } from './merge-map.js'; +export { mergeScan } from './merge-scan.js'; +export { merge } from './merge.js'; +export { min } from './min.js'; +export { multicast } from './multicast.js'; +export { observeOn } from './observe-on.js'; +export { onErrorResumeNext } from './on-error-resume-next.js'; +export { pairwise } from './pairwise.js'; +export { partition } from './partition.js'; +export { pipe } from './pipe.js'; +export { pluck } from './pluck.js'; +export { publishBehavior } from './publish-behavior.js'; +export { publishLast } from './publish-last.js'; +export { publishReplay } from './publish-replay.js'; +export { publish } from './publish.js'; +export { race } from './race.js'; +export { reduce } from './reduce.js'; +export { refCount } from './ref-count.js'; +export { repeatWhen } from './repeat-when.js'; +export { repeat } from './repeat.js'; +export { retryWhen } from './retry-when.js'; +export { retry } from './retry.js'; +export { sampleTime } from './sample-time.js'; +export { sample } from './sample.js'; +export { scan } from './scan.js'; +export { sequenceEqual } from './sequence-equal.js'; +export { shareReplay } from './share-replay.js'; +export { share } from './share.js'; +export { single } from './single.js'; +export { skipLast } from './skip-last.js'; +export { skipUntil } from './skip-until.js'; +export { skipWhile } from './skip-while.js'; +export { skip } from './skip.js'; +export { startWith } from './start-with.js'; +export { subscribeOn } from './subscribe-on.js'; +export { switchMap } from './switch-map.js'; +export { switchScan } from './switch-scan.js'; +export { takeLast } from './take-last.js'; +export { takeUntil } from './take-until.js'; +export { takeWhile } from './take-while.js'; +export { take } from './take.js'; +export { tap } from './tap.js'; +export { throttle } from './throttle.js'; +export { throwIfEmpty } from './throw-if-empty.js'; +export { timeInterval } from './time-interval.js'; +export { timeout } from './timeout.js'; +export { timer } from './timer.js'; +export { timestamp } from './timestamp.js'; +export { windowCount } from './window-count.js'; +export { windowTime } from './window-time.js'; +export { windowToggle } from './window-toggle.js'; +export { windowWhen } from './window-when.js'; +export { window } from './window.js'; +export { withLatestFrom } from './with-latest-from.js'; +export { zipAll } from './zip-all.js'; +export { zipWith } from './zip-with.js'; diff --git a/packages/rxjs/src/symbol/interval.ts b/packages/rxjs/src/symbol/interval.ts new file mode 100644 index 0000000000..69c950810a --- /dev/null +++ b/packages/rxjs/src/symbol/interval.ts @@ -0,0 +1 @@ +export { interval } from '../interval.js'; diff --git a/packages/rxjs/src/symbol/is-empty.ts b/packages/rxjs/src/symbol/is-empty.ts new file mode 100644 index 0000000000..383c9454d1 --- /dev/null +++ b/packages/rxjs/src/symbol/is-empty.ts @@ -0,0 +1 @@ +export { isEmpty } from '../is-empty.js'; diff --git a/packages/rxjs/src/symbol/iterate-buffered-values.ts b/packages/rxjs/src/symbol/iterate-buffered-values.ts new file mode 100644 index 0000000000..b51de98e64 --- /dev/null +++ b/packages/rxjs/src/symbol/iterate-buffered-values.ts @@ -0,0 +1 @@ +export { iterateBufferedValues } from '../iterate-buffered-values.js'; diff --git a/packages/rxjs/src/symbol/iterate-each-value.ts b/packages/rxjs/src/symbol/iterate-each-value.ts new file mode 100644 index 0000000000..000eba9064 --- /dev/null +++ b/packages/rxjs/src/symbol/iterate-each-value.ts @@ -0,0 +1 @@ +export { iterateEachValue } from '../iterate-each-value.js'; diff --git a/packages/rxjs/src/symbol/iterate-latest-value.ts b/packages/rxjs/src/symbol/iterate-latest-value.ts new file mode 100644 index 0000000000..e81b53485e --- /dev/null +++ b/packages/rxjs/src/symbol/iterate-latest-value.ts @@ -0,0 +1 @@ +export { iterateLatestValue } from '../iterate-latest-value.js'; diff --git a/packages/rxjs/src/symbol/iterate-next-value.ts b/packages/rxjs/src/symbol/iterate-next-value.ts new file mode 100644 index 0000000000..6af01468a1 --- /dev/null +++ b/packages/rxjs/src/symbol/iterate-next-value.ts @@ -0,0 +1 @@ +export { iterateNextValue } from '../iterate-next-value.js'; diff --git a/packages/rxjs/src/symbol/last.ts b/packages/rxjs/src/symbol/last.ts new file mode 100644 index 0000000000..03ffbaad63 --- /dev/null +++ b/packages/rxjs/src/symbol/last.ts @@ -0,0 +1 @@ +export { last } from '../last.js'; diff --git a/packages/rxjs/src/symbol/map.ts b/packages/rxjs/src/symbol/map.ts new file mode 100644 index 0000000000..33ef8e9c8c --- /dev/null +++ b/packages/rxjs/src/symbol/map.ts @@ -0,0 +1 @@ +export { map } from '../map.js'; diff --git a/packages/rxjs/src/symbol/materialize.ts b/packages/rxjs/src/symbol/materialize.ts new file mode 100644 index 0000000000..d2ec58b252 --- /dev/null +++ b/packages/rxjs/src/symbol/materialize.ts @@ -0,0 +1 @@ +export { materialize } from '../materialize.js'; diff --git a/packages/rxjs/src/symbol/max.ts b/packages/rxjs/src/symbol/max.ts new file mode 100644 index 0000000000..dc009a7a81 --- /dev/null +++ b/packages/rxjs/src/symbol/max.ts @@ -0,0 +1 @@ +export { max } from '../max.js'; diff --git a/packages/rxjs/src/symbol/merge-map.ts b/packages/rxjs/src/symbol/merge-map.ts new file mode 100644 index 0000000000..37b35ff196 --- /dev/null +++ b/packages/rxjs/src/symbol/merge-map.ts @@ -0,0 +1 @@ +export { mergeMap } from '../merge-map.js'; diff --git a/packages/rxjs/src/symbol/merge-scan.ts b/packages/rxjs/src/symbol/merge-scan.ts new file mode 100644 index 0000000000..63eb13da76 --- /dev/null +++ b/packages/rxjs/src/symbol/merge-scan.ts @@ -0,0 +1 @@ +export { mergeScan } from '../merge-scan.js'; diff --git a/packages/rxjs/src/symbol/merge.ts b/packages/rxjs/src/symbol/merge.ts new file mode 100644 index 0000000000..00498ebf72 --- /dev/null +++ b/packages/rxjs/src/symbol/merge.ts @@ -0,0 +1 @@ +export { merge } from '../merge.js'; diff --git a/packages/rxjs/src/symbol/min.ts b/packages/rxjs/src/symbol/min.ts new file mode 100644 index 0000000000..13d7f947f7 --- /dev/null +++ b/packages/rxjs/src/symbol/min.ts @@ -0,0 +1 @@ +export { min } from '../min.js'; diff --git a/packages/rxjs/src/symbol/multicast.ts b/packages/rxjs/src/symbol/multicast.ts new file mode 100644 index 0000000000..5c60dcf197 --- /dev/null +++ b/packages/rxjs/src/symbol/multicast.ts @@ -0,0 +1 @@ +export { multicast } from '../multicast.js'; diff --git a/packages/rxjs/src/symbol/observe-on.ts b/packages/rxjs/src/symbol/observe-on.ts new file mode 100644 index 0000000000..1243671985 --- /dev/null +++ b/packages/rxjs/src/symbol/observe-on.ts @@ -0,0 +1 @@ +export { observeOn } from '../observe-on.js'; diff --git a/packages/rxjs/src/symbol/on-error-resume-next.ts b/packages/rxjs/src/symbol/on-error-resume-next.ts new file mode 100644 index 0000000000..ed02b70d80 --- /dev/null +++ b/packages/rxjs/src/symbol/on-error-resume-next.ts @@ -0,0 +1 @@ +export { onErrorResumeNext } from '../on-error-resume-next.js'; diff --git a/packages/rxjs/src/symbol/pairwise.ts b/packages/rxjs/src/symbol/pairwise.ts new file mode 100644 index 0000000000..50865b4b41 --- /dev/null +++ b/packages/rxjs/src/symbol/pairwise.ts @@ -0,0 +1 @@ +export { pairwise } from '../pairwise.js'; diff --git a/packages/rxjs/src/symbol/partition.ts b/packages/rxjs/src/symbol/partition.ts new file mode 100644 index 0000000000..88fdc553d6 --- /dev/null +++ b/packages/rxjs/src/symbol/partition.ts @@ -0,0 +1 @@ +export { partition } from '../partition.js'; diff --git a/packages/rxjs/src/symbol/pipe.ts b/packages/rxjs/src/symbol/pipe.ts new file mode 100644 index 0000000000..00f8ac7fa8 --- /dev/null +++ b/packages/rxjs/src/symbol/pipe.ts @@ -0,0 +1 @@ +export { pipe } from '../pipe.js'; diff --git a/packages/rxjs/src/symbol/pluck.ts b/packages/rxjs/src/symbol/pluck.ts new file mode 100644 index 0000000000..213ac6b699 --- /dev/null +++ b/packages/rxjs/src/symbol/pluck.ts @@ -0,0 +1 @@ +export { pluck } from '../pluck.js'; diff --git a/packages/rxjs/src/symbol/publish-behavior.ts b/packages/rxjs/src/symbol/publish-behavior.ts new file mode 100644 index 0000000000..6ffba59e45 --- /dev/null +++ b/packages/rxjs/src/symbol/publish-behavior.ts @@ -0,0 +1 @@ +export { publishBehavior } from '../publish-behavior.js'; diff --git a/packages/rxjs/src/symbol/publish-last.ts b/packages/rxjs/src/symbol/publish-last.ts new file mode 100644 index 0000000000..4d51c47787 --- /dev/null +++ b/packages/rxjs/src/symbol/publish-last.ts @@ -0,0 +1 @@ +export { publishLast } from '../publish-last.js'; diff --git a/packages/rxjs/src/symbol/publish-replay.ts b/packages/rxjs/src/symbol/publish-replay.ts new file mode 100644 index 0000000000..6136cfbc1f --- /dev/null +++ b/packages/rxjs/src/symbol/publish-replay.ts @@ -0,0 +1,2 @@ +export { publishReplay } from '../publish-replay.js'; +export type { PublishReplayTimestampProvider } from '../publish-replay.js'; diff --git a/packages/rxjs/src/symbol/publish.ts b/packages/rxjs/src/symbol/publish.ts new file mode 100644 index 0000000000..6d49f01f79 --- /dev/null +++ b/packages/rxjs/src/symbol/publish.ts @@ -0,0 +1 @@ +export { publish } from '../publish.js'; diff --git a/packages/rxjs/src/symbol/race.ts b/packages/rxjs/src/symbol/race.ts new file mode 100644 index 0000000000..08fd66e0ac --- /dev/null +++ b/packages/rxjs/src/symbol/race.ts @@ -0,0 +1 @@ +export { race } from '../race.js'; diff --git a/packages/rxjs/src/symbol/reduce.ts b/packages/rxjs/src/symbol/reduce.ts new file mode 100644 index 0000000000..bfa4733b10 --- /dev/null +++ b/packages/rxjs/src/symbol/reduce.ts @@ -0,0 +1 @@ +export { reduce } from '../reduce.js'; diff --git a/packages/rxjs/src/symbol/ref-count.ts b/packages/rxjs/src/symbol/ref-count.ts new file mode 100644 index 0000000000..9a99ab1289 --- /dev/null +++ b/packages/rxjs/src/symbol/ref-count.ts @@ -0,0 +1 @@ +export { refCount } from '../ref-count.js'; diff --git a/packages/rxjs/src/symbol/repeat-when.ts b/packages/rxjs/src/symbol/repeat-when.ts new file mode 100644 index 0000000000..2875a26e8e --- /dev/null +++ b/packages/rxjs/src/symbol/repeat-when.ts @@ -0,0 +1 @@ +export { repeatWhen } from '../repeat-when.js'; diff --git a/packages/rxjs/src/symbol/repeat.ts b/packages/rxjs/src/symbol/repeat.ts new file mode 100644 index 0000000000..9ac2447369 --- /dev/null +++ b/packages/rxjs/src/symbol/repeat.ts @@ -0,0 +1 @@ +export { repeat } from '../repeat.js'; diff --git a/packages/rxjs/src/symbol/retry-when.ts b/packages/rxjs/src/symbol/retry-when.ts new file mode 100644 index 0000000000..11c1f4a6bf --- /dev/null +++ b/packages/rxjs/src/symbol/retry-when.ts @@ -0,0 +1 @@ +export { retryWhen } from '../retry-when.js'; diff --git a/packages/rxjs/src/symbol/retry.ts b/packages/rxjs/src/symbol/retry.ts new file mode 100644 index 0000000000..41c48fe97e --- /dev/null +++ b/packages/rxjs/src/symbol/retry.ts @@ -0,0 +1 @@ +export { retry } from '../retry.js'; diff --git a/packages/rxjs/src/symbol/sample-time.ts b/packages/rxjs/src/symbol/sample-time.ts new file mode 100644 index 0000000000..989c394ed2 --- /dev/null +++ b/packages/rxjs/src/symbol/sample-time.ts @@ -0,0 +1 @@ +export { sampleTime } from '../sample-time.js'; diff --git a/packages/rxjs/src/symbol/sample.ts b/packages/rxjs/src/symbol/sample.ts new file mode 100644 index 0000000000..03a7b305d3 --- /dev/null +++ b/packages/rxjs/src/symbol/sample.ts @@ -0,0 +1 @@ +export { sample } from '../sample.js'; diff --git a/packages/rxjs/src/symbol/scan.ts b/packages/rxjs/src/symbol/scan.ts new file mode 100644 index 0000000000..25bd326693 --- /dev/null +++ b/packages/rxjs/src/symbol/scan.ts @@ -0,0 +1 @@ +export { scan } from '../scan.js'; diff --git a/packages/rxjs/src/symbol/sequence-equal.ts b/packages/rxjs/src/symbol/sequence-equal.ts new file mode 100644 index 0000000000..194a2e89b8 --- /dev/null +++ b/packages/rxjs/src/symbol/sequence-equal.ts @@ -0,0 +1 @@ +export { sequenceEqual } from '../sequence-equal.js'; diff --git a/packages/rxjs/src/symbol/share-replay.ts b/packages/rxjs/src/symbol/share-replay.ts new file mode 100644 index 0000000000..6c51b41dbf --- /dev/null +++ b/packages/rxjs/src/symbol/share-replay.ts @@ -0,0 +1,2 @@ +export { shareReplay } from '../share-replay.js'; +export type { ShareReplayConfig } from '../share-replay.js'; diff --git a/packages/rxjs/src/symbol/share.ts b/packages/rxjs/src/symbol/share.ts new file mode 100644 index 0000000000..2a31cb3340 --- /dev/null +++ b/packages/rxjs/src/symbol/share.ts @@ -0,0 +1,2 @@ +export { share } from '../share.js'; +export type { ShareConfig } from '../share.js'; diff --git a/packages/rxjs/src/symbol/single.ts b/packages/rxjs/src/symbol/single.ts new file mode 100644 index 0000000000..bdcea3d3f7 --- /dev/null +++ b/packages/rxjs/src/symbol/single.ts @@ -0,0 +1 @@ +export { single } from '../single.js'; diff --git a/packages/rxjs/src/symbol/skip-last.ts b/packages/rxjs/src/symbol/skip-last.ts new file mode 100644 index 0000000000..8d849e957c --- /dev/null +++ b/packages/rxjs/src/symbol/skip-last.ts @@ -0,0 +1 @@ +export { skipLast } from '../skip-last.js'; diff --git a/packages/rxjs/src/symbol/skip-until.ts b/packages/rxjs/src/symbol/skip-until.ts new file mode 100644 index 0000000000..d6a66931db --- /dev/null +++ b/packages/rxjs/src/symbol/skip-until.ts @@ -0,0 +1 @@ +export { skipUntil } from '../skip-until.js'; diff --git a/packages/rxjs/src/symbol/skip-while.ts b/packages/rxjs/src/symbol/skip-while.ts new file mode 100644 index 0000000000..5afee5102a --- /dev/null +++ b/packages/rxjs/src/symbol/skip-while.ts @@ -0,0 +1 @@ +export { skipWhile } from '../skip-while.js'; diff --git a/packages/rxjs/src/symbol/skip.ts b/packages/rxjs/src/symbol/skip.ts new file mode 100644 index 0000000000..e8af176f1f --- /dev/null +++ b/packages/rxjs/src/symbol/skip.ts @@ -0,0 +1 @@ +export { skip } from '../skip.js'; diff --git a/packages/rxjs/src/symbol/start-with.ts b/packages/rxjs/src/symbol/start-with.ts new file mode 100644 index 0000000000..b0b9567ec2 --- /dev/null +++ b/packages/rxjs/src/symbol/start-with.ts @@ -0,0 +1 @@ +export { startWith } from '../start-with.js'; diff --git a/packages/rxjs/src/symbol/subscribe-on.ts b/packages/rxjs/src/symbol/subscribe-on.ts new file mode 100644 index 0000000000..10bc079e92 --- /dev/null +++ b/packages/rxjs/src/symbol/subscribe-on.ts @@ -0,0 +1 @@ +export { subscribeOn } from '../subscribe-on.js'; diff --git a/packages/rxjs/src/symbol/switch-map.ts b/packages/rxjs/src/symbol/switch-map.ts new file mode 100644 index 0000000000..0475dca4f1 --- /dev/null +++ b/packages/rxjs/src/symbol/switch-map.ts @@ -0,0 +1 @@ +export { switchMap } from '../switch-map.js'; diff --git a/packages/rxjs/src/symbol/switch-scan.ts b/packages/rxjs/src/symbol/switch-scan.ts new file mode 100644 index 0000000000..e13716131f --- /dev/null +++ b/packages/rxjs/src/symbol/switch-scan.ts @@ -0,0 +1 @@ +export { switchScan } from '../switch-scan.js'; diff --git a/packages/rxjs/src/symbol/take-last.ts b/packages/rxjs/src/symbol/take-last.ts new file mode 100644 index 0000000000..2e97d5ae57 --- /dev/null +++ b/packages/rxjs/src/symbol/take-last.ts @@ -0,0 +1 @@ +export { takeLast } from '../take-last.js'; diff --git a/packages/rxjs/src/symbol/take-until.ts b/packages/rxjs/src/symbol/take-until.ts new file mode 100644 index 0000000000..835eb4d146 --- /dev/null +++ b/packages/rxjs/src/symbol/take-until.ts @@ -0,0 +1 @@ +export { takeUntil } from '../take-until.js'; diff --git a/packages/rxjs/src/symbol/take-while.ts b/packages/rxjs/src/symbol/take-while.ts new file mode 100644 index 0000000000..995b2e33d5 --- /dev/null +++ b/packages/rxjs/src/symbol/take-while.ts @@ -0,0 +1 @@ +export { takeWhile } from '../take-while.js'; diff --git a/packages/rxjs/src/symbol/take.ts b/packages/rxjs/src/symbol/take.ts new file mode 100644 index 0000000000..4ea54717cb --- /dev/null +++ b/packages/rxjs/src/symbol/take.ts @@ -0,0 +1 @@ +export { take } from '../take.js'; diff --git a/packages/rxjs/src/symbol/tap.ts b/packages/rxjs/src/symbol/tap.ts new file mode 100644 index 0000000000..ec544dce23 --- /dev/null +++ b/packages/rxjs/src/symbol/tap.ts @@ -0,0 +1,2 @@ +export { tap } from '../tap.js'; +export type { TapObserver } from '../tap.js'; diff --git a/packages/rxjs/src/symbol/throttle.ts b/packages/rxjs/src/symbol/throttle.ts new file mode 100644 index 0000000000..7901145f62 --- /dev/null +++ b/packages/rxjs/src/symbol/throttle.ts @@ -0,0 +1 @@ +export { throttle } from '../throttle.js'; diff --git a/packages/rxjs/src/symbol/throw-if-empty.ts b/packages/rxjs/src/symbol/throw-if-empty.ts new file mode 100644 index 0000000000..3621d71cc7 --- /dev/null +++ b/packages/rxjs/src/symbol/throw-if-empty.ts @@ -0,0 +1 @@ +export { throwIfEmpty } from '../throw-if-empty.js'; diff --git a/packages/rxjs/src/symbol/time-interval.ts b/packages/rxjs/src/symbol/time-interval.ts new file mode 100644 index 0000000000..278c68ca52 --- /dev/null +++ b/packages/rxjs/src/symbol/time-interval.ts @@ -0,0 +1,2 @@ +export { timeInterval, TimeInterval } from '../time-interval.js'; +export type { TimeIntervalProvider } from '../time-interval.js'; diff --git a/packages/rxjs/src/symbol/timeout.ts b/packages/rxjs/src/symbol/timeout.ts new file mode 100644 index 0000000000..2519a9ce0c --- /dev/null +++ b/packages/rxjs/src/symbol/timeout.ts @@ -0,0 +1 @@ +export { timeout } from '../timeout.js'; diff --git a/packages/rxjs/src/symbol/timer.ts b/packages/rxjs/src/symbol/timer.ts new file mode 100644 index 0000000000..58c8a589a7 --- /dev/null +++ b/packages/rxjs/src/symbol/timer.ts @@ -0,0 +1 @@ +export { timer } from '../timer.js'; diff --git a/packages/rxjs/src/symbol/timestamp.ts b/packages/rxjs/src/symbol/timestamp.ts new file mode 100644 index 0000000000..4486dbdd45 --- /dev/null +++ b/packages/rxjs/src/symbol/timestamp.ts @@ -0,0 +1,2 @@ +export { timestamp } from '../timestamp.js'; +export type { TimestampProvider, Timestamp } from '../timestamp.js'; diff --git a/packages/rxjs/src/symbol/window-count.ts b/packages/rxjs/src/symbol/window-count.ts new file mode 100644 index 0000000000..72cc156d6b --- /dev/null +++ b/packages/rxjs/src/symbol/window-count.ts @@ -0,0 +1 @@ +export { windowCount } from '../window-count.js'; diff --git a/packages/rxjs/src/symbol/window-time.ts b/packages/rxjs/src/symbol/window-time.ts new file mode 100644 index 0000000000..b9d10cfebd --- /dev/null +++ b/packages/rxjs/src/symbol/window-time.ts @@ -0,0 +1 @@ +export { windowTime } from '../window-time.js'; diff --git a/packages/rxjs/src/symbol/window-toggle.ts b/packages/rxjs/src/symbol/window-toggle.ts new file mode 100644 index 0000000000..07a58c0908 --- /dev/null +++ b/packages/rxjs/src/symbol/window-toggle.ts @@ -0,0 +1 @@ +export { windowToggle } from '../window-toggle.js'; diff --git a/packages/rxjs/src/symbol/window-when.ts b/packages/rxjs/src/symbol/window-when.ts new file mode 100644 index 0000000000..83eda9bb88 --- /dev/null +++ b/packages/rxjs/src/symbol/window-when.ts @@ -0,0 +1 @@ +export { windowWhen } from '../window-when.js'; diff --git a/packages/rxjs/src/symbol/window.ts b/packages/rxjs/src/symbol/window.ts new file mode 100644 index 0000000000..87f9d49553 --- /dev/null +++ b/packages/rxjs/src/symbol/window.ts @@ -0,0 +1 @@ +export { window } from '../window.js'; diff --git a/packages/rxjs/src/symbol/with-latest-from.ts b/packages/rxjs/src/symbol/with-latest-from.ts new file mode 100644 index 0000000000..73035fb6e0 --- /dev/null +++ b/packages/rxjs/src/symbol/with-latest-from.ts @@ -0,0 +1 @@ +export { withLatestFrom } from '../with-latest-from.js'; diff --git a/packages/rxjs/src/symbol/zip-all.ts b/packages/rxjs/src/symbol/zip-all.ts new file mode 100644 index 0000000000..5b908d7e3a --- /dev/null +++ b/packages/rxjs/src/symbol/zip-all.ts @@ -0,0 +1 @@ +export { zipAll } from '../zip-all.js'; diff --git a/packages/rxjs/src/symbol/zip-with.ts b/packages/rxjs/src/symbol/zip-with.ts new file mode 100644 index 0000000000..124836f75b --- /dev/null +++ b/packages/rxjs/src/symbol/zip-with.ts @@ -0,0 +1 @@ +export { zipWith } from '../zip-with.js'; diff --git a/packages/rxjs/src/take-last.ts b/packages/rxjs/src/take-last.ts index ec8d699d1e..17dde0e5c1 100644 --- a/packages/rxjs/src/take-last.ts +++ b/packages/rxjs/src/take-last.ts @@ -36,3 +36,20 @@ Observable.prototype[takeLast] = function (this: Observable, amount = 1): }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `takeLast` form of the exact-Symbol `[takeLast]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[takeLast]` to its source. + */ +export function pipeableTakeLast(amount?: number): (source: Observable) => Observable; +export function pipeableTakeLast(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[takeLast] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/take-until.ts b/packages/rxjs/src/take-until.ts index 1b129a19d2..daa4fdd061 100644 --- a/packages/rxjs/src/take-until.ts +++ b/packages/rxjs/src/take-until.ts @@ -28,3 +28,20 @@ Observable.prototype[takeUntil] = function (this: Observable, notifier: Ob subscribeToSource(this, subscriber); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `takeUntil` form of the exact-Symbol `[takeUntil]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[takeUntil]` to its source. + */ +export function pipeableTakeUntil(notifier: ObservableInput): (source: Observable) => Observable; +export function pipeableTakeUntil(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[takeUntil] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/take-while.ts b/packages/rxjs/src/take-while.ts index 7a67b0d6ea..500c08fa1d 100644 --- a/packages/rxjs/src/take-while.ts +++ b/packages/rxjs/src/take-while.ts @@ -34,3 +34,21 @@ Observable.prototype[takeWhile] = function ( }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `takeWhile` form of the exact-Symbol `[takeWhile]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[takeWhile]` to its source. + */ +export function pipeableTakeWhile(predicate: (value: T, index: number) => value is R, config?: { includeLast?: boolean }): (source: Observable) => Observable; +export function pipeableTakeWhile(predicate: (value: T, index: number) => boolean, config?: { includeLast?: boolean }): (source: Observable) => Observable; +export function pipeableTakeWhile(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[takeWhile] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/tap.ts b/packages/rxjs/src/tap.ts index 5edec93bad..e354ece045 100644 --- a/packages/rxjs/src/tap.ts +++ b/packages/rxjs/src/tap.ts @@ -125,3 +125,21 @@ function tapOperator( } Observable.prototype[tap] = tapOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `tap` form of the exact-Symbol `[tap]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[tap]` to its source. + */ +export function pipeableTap(observerOrNext?: Partial> | ((value: T) => void) | null): (source: Observable) => Observable; +export function pipeableTap(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): (source: Observable) => Observable; +export function pipeableTap(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[tap] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/throttle.ts b/packages/rxjs/src/throttle.ts index 14f4e7c7d7..35e945637b 100644 --- a/packages/rxjs/src/throttle.ts +++ b/packages/rxjs/src/throttle.ts @@ -111,3 +111,20 @@ Observable.prototype[throttle] = function ( }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `throttle` form of the exact-Symbol `[throttle]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[throttle]` to its source. + */ +export function pipeableThrottle(delay: number | ((value: T, index: number) => ObservableInput), config?: ThrottleConfig): (source: Observable) => Observable; +export function pipeableThrottle(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[throttle] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/throw-if-empty.ts b/packages/rxjs/src/throw-if-empty.ts index 7f68de4bac..77f7e3875d 100644 --- a/packages/rxjs/src/throw-if-empty.ts +++ b/packages/rxjs/src/throw-if-empty.ts @@ -33,3 +33,20 @@ Observable.prototype[throwIfEmpty] = function ( }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `throwIfEmpty` form of the exact-Symbol `[throwIfEmpty]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[throwIfEmpty]` to its source. + */ +export function pipeableThrowIfEmpty(errorFactory?: () => unknown): (source: Observable) => Observable; +export function pipeableThrowIfEmpty(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[throwIfEmpty] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/time-interval.ts b/packages/rxjs/src/time-interval.ts index f8079c8750..ee9aec3abd 100644 --- a/packages/rxjs/src/time-interval.ts +++ b/packages/rxjs/src/time-interval.ts @@ -40,3 +40,20 @@ Observable.prototype[timeInterval] = function ( }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `timeInterval` form of the exact-Symbol `[timeInterval]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[timeInterval]` to its source. + */ +export function pipeableTimeInterval(timestampProvider?: TimeIntervalProvider): (source: Observable) => Observable>; +export function pipeableTimeInterval(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[timeInterval] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/timeout.ts b/packages/rxjs/src/timeout.ts index f234379dfa..b20602b810 100644 --- a/packages/rxjs/src/timeout.ts +++ b/packages/rxjs/src/timeout.ts @@ -112,3 +112,25 @@ Observable.prototype[timeout] = timeoutOperator; function timeoutErrorFactory(info: TimeoutInfo): never { throw new TimeoutError(info); } + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `timeout` form of the exact-Symbol `[timeout]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[timeout]` to its source. + */ +export function pipeableTimeout(config: { + each?: number; + first?: number | Date; + with?: (info: TimeoutInfo) => ObservableInput; + meta?: M; + }): (source: Observable) => Observable; +export function pipeableTimeout(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[timeout] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/timer.ts b/packages/rxjs/src/timer.ts index 1be0fc25dd..d8d44ab1b9 100644 --- a/packages/rxjs/src/timer.ts +++ b/packages/rxjs/src/timer.ts @@ -33,3 +33,19 @@ function timerFactory(this: ObservableCtor, delay: number, interval?: number): O } Observable[timer] = timerFactory; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Calls the static exact-Symbol `Observable[timer]` capability as an ordinary function. + * + * Construction, conversion, error forwarding, and cancellation remain owned + * by the installed Symbol implementation. + */ +export function staticTimer(delay: number): Observable; +export function staticTimer(delay: number, interval: number): Observable; +export function staticTimer(...args: any[]): any { + return Reflect.apply(Observable[timer] as (...values: any[]) => any, Observable, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/timestamp.ts b/packages/rxjs/src/timestamp.ts index 87abf87b81..ad3b0ae6de 100644 --- a/packages/rxjs/src/timestamp.ts +++ b/packages/rxjs/src/timestamp.ts @@ -28,3 +28,20 @@ Observable.prototype[timestamp] = function (this: Observable, timestampPro }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `timestamp` form of the exact-Symbol `[timestamp]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[timestamp]` to its source. + */ +export function pipeableTimestamp(timestampProvider?: TimestampProvider): (source: Observable) => Observable>; +export function pipeableTimestamp(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[timestamp] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/window-count.ts b/packages/rxjs/src/window-count.ts index 6bec2249bd..5465f56ff0 100644 --- a/packages/rxjs/src/window-count.ts +++ b/packages/rxjs/src/window-count.ts @@ -85,3 +85,20 @@ Observable.prototype[windowCount] = function (this: Observable, windowSize }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `windowCount` form of the exact-Symbol `[windowCount]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[windowCount]` to its source. + */ +export function pipeableWindowCount(windowSize: number, startWindowEvery?: number): (source: Observable) => Observable>; +export function pipeableWindowCount(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[windowCount] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/window-time.ts b/packages/rxjs/src/window-time.ts index 56870f9d66..56ec5a2c6a 100644 --- a/packages/rxjs/src/window-time.ts +++ b/packages/rxjs/src/window-time.ts @@ -126,3 +126,20 @@ Observable.prototype[windowTime] = function ( }); }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `windowTime` form of the exact-Symbol `[windowTime]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[windowTime]` to its source. + */ +export function pipeableWindowTime(span: number, creationInterval?: number | null, maxWindowSize?: number): (source: Observable) => Observable>; +export function pipeableWindowTime(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[windowTime] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/window-toggle.ts b/packages/rxjs/src/window-toggle.ts index f008b03062..a830999104 100644 --- a/packages/rxjs/src/window-toggle.ts +++ b/packages/rxjs/src/window-toggle.ts @@ -196,3 +196,20 @@ Observable.prototype[windowToggle] = function ( } }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `windowToggle` form of the exact-Symbol `[windowToggle]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[windowToggle]` to its source. + */ +export function pipeableWindowToggle(openings: ObservableInput, closingSelector: (opening: Opening) => ObservableInput): (source: Observable) => Observable>; +export function pipeableWindowToggle(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[windowToggle] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/window-when.ts b/packages/rxjs/src/window-when.ts index b3da8e9991..7187a3bd79 100644 --- a/packages/rxjs/src/window-when.ts +++ b/packages/rxjs/src/window-when.ts @@ -177,3 +177,20 @@ Observable.prototype[windowWhen] = function ( } }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `windowWhen` form of the exact-Symbol `[windowWhen]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[windowWhen]` to its source. + */ +export function pipeableWindowWhen(closingSelector: () => ObservableInput): (source: Observable) => Observable>; +export function pipeableWindowWhen(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[windowWhen] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/window.ts b/packages/rxjs/src/window.ts index 618c422ecc..4d56fe5f70 100644 --- a/packages/rxjs/src/window.ts +++ b/packages/rxjs/src/window.ts @@ -96,3 +96,20 @@ Observable.prototype[window] = function (this: Observable, boundaries: Obs } }); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `window` form of the exact-Symbol `[window]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[window]` to its source. + */ +export function pipeableWindow(boundaries: ObservableInput): (source: Observable) => Observable>; +export function pipeableWindow(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[window] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/with-latest-from.ts b/packages/rxjs/src/with-latest-from.ts index 888a5a7a69..ebcd4f4362 100644 --- a/packages/rxjs/src/with-latest-from.ts +++ b/packages/rxjs/src/with-latest-from.ts @@ -62,3 +62,21 @@ function withLatestFromImpl( } }); } + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `withLatestFrom` form of the exact-Symbol `[withLatestFrom]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[withLatestFrom]` to its source. + */ +export function pipeableWithLatestFrom[]>(sources: Sources): (source: Observable) => Observable<[T, ...ObservableArrayToValueArray]>; +export function pipeableWithLatestFrom[], Result>(sources: Sources, project: (value: T, ...latestValues: ObservableArrayToValueArray) => Result): (source: Observable) => Observable; +export function pipeableWithLatestFrom(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[withLatestFrom] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/zip-all.ts b/packages/rxjs/src/zip-all.ts index c8b120abe0..aaf9d5ef16 100644 --- a/packages/rxjs/src/zip-all.ts +++ b/packages/rxjs/src/zip-all.ts @@ -38,3 +38,22 @@ function zipAllOperator(this: Observable>, project?: (. } Observable.prototype[zipAll] = zipAllOperator; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `zipAll` form of the exact-Symbol `[zipAll]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[zipAll]` to its source. + */ +export function pipeableZipAll(): (source: Observable>) => Observable; +export function pipeableZipAll(project: (...values: V[]) => R): (source: Observable>) => Observable; +export function pipeableZipAll(project: (...values: any[]) => R): (source: Observable>) => Observable; +export function pipeableZipAll(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[zipAll] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/src/zip-with.ts b/packages/rxjs/src/zip-with.ts index 22fa88aff0..173deadf47 100644 --- a/packages/rxjs/src/zip-with.ts +++ b/packages/rxjs/src/zip-with.ts @@ -24,3 +24,20 @@ Observable.prototype[zipWith] = function > { return zip([this, ...otherSources] as [Observable, ...OtherSources]); }; + +// BEGIN GENERATED FUNCTIONAL SURFACE + +/** + * Creates the pipeable `zipWith` form of the exact-Symbol `[zipWith]` capability. + * + * The source is supplied when the returned unary function is composed with + * `rx`, `pipe`, or another function-composition helper. The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form. + * + * @returns A unary function that applies `[zipWith]` to its source. + */ +export function pipeableZipWith[]>(...otherSources: OtherSources): (source: Observable) => Observable>; +export function pipeableZipWith(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[zipWith] as (...values: any[]) => any, source, args); +} + +// END GENERATED FUNCTIONAL SURFACE diff --git a/packages/rxjs/test/import/bundler.mjs b/packages/rxjs/test/import/bundler.mjs index d163d3c114..c93e483595 100644 --- a/packages/rxjs/test/import/bundler.mjs +++ b/packages/rxjs/test/import/bundler.mjs @@ -11,13 +11,13 @@ const temporaryRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'rxjs-extension-bu try { await buildAndRun({ - label: 'root-core-only', + label: 'root-functional-surface', source: ` import 'rxjs'; const constructorSymbols = Object.getOwnPropertySymbols(globalThis.Observable).map((symbol) => symbol.description); const prototypeSymbols = Object.getOwnPropertySymbols(globalThis.Observable.prototype).map((symbol) => symbol.description); - if (constructorSymbols.includes('map') || prototypeSymbols.includes('map')) { - throw new Error('The bundled root import installed the map capability'); + if (!prototypeSymbols.includes('buffer') || !constructorSymbols.includes('merge')) { + throw new Error('The bundled root import did not retain the functional surface implementations'); } `, }); diff --git a/packages/rxjs/test/import/esm.mjs b/packages/rxjs/test/import/esm.mjs index e0723a2807..3808fbd44d 100644 --- a/packages/rxjs/test/import/esm.mjs +++ b/packages/rxjs/test/import/esm.mjs @@ -1,5 +1,19 @@ import assert from 'node:assert/strict'; -import { ColdObservable, Subject, TimeoutError, filter, map, rx, subscribe, take, toArray } from 'rxjs'; +import { + ColdObservable, + Subject, + TimeoutError, + filter, + iterateEachValue, + map, + merge, + mergeWith, + rx, + subscribe, + take, + toArray, +} from 'rxjs'; +import { buffer as barrelBuffer } from 'rxjs/pipeable'; import * as deepMapModule from 'rxjs/pipeable/map'; import * as deepTakeModule from 'rxjs/pipeable/take'; import { rx as deepRx } from 'rxjs/rx'; @@ -7,6 +21,8 @@ import { subscribe as deepSubscribe } from 'rxjs/subscribe'; import { filter as filterSymbol } from 'rxjs/symbol/filter'; import { map as mapSymbol } from 'rxjs/symbol/map'; import { take as takeSymbol } from 'rxjs/symbol/take'; +import * as symbolCatalog from 'rxjs/symbol'; +import { merge as staticMerge } from 'rxjs/static'; import { toArray as deepToArray } from 'rxjs/to-array'; import { pipe } from 'rxjs/pipe'; import { scan } from 'rxjs/scan'; @@ -24,6 +40,12 @@ assert.equal(typeof filter, 'function'); assert.equal(typeof take, 'function'); assert.equal(typeof toArray, 'function'); assert.equal(typeof subscribe, 'function'); +assert.equal(typeof merge, 'function'); +assert.equal(typeof mergeWith, 'function'); +assert.equal(typeof iterateEachValue, 'function'); +assert.equal(typeof barrelBuffer, 'function'); +assert.equal(typeof staticMerge, 'function'); +assert.equal(typeof symbolCatalog.merge, 'symbol'); assert.equal(typeof deepMapModule.map, 'function'); assert.equal(typeof deepTakeModule.take, 'function'); assert.equal('mapOperator' in deepMapModule, false); @@ -48,3 +70,7 @@ for (const symbol of [pipe, timer]) { assert.equal(typeof globalThis.Observable[symbol], 'function'); assert.equal(Object.getOwnPropertyDescriptor(globalThis.Observable, symbol).enumerable, true); } + +const asyncValues = rx([1, 2], iterateEachValue()); +assert.deepEqual(await asyncValues.next(), { done: false, value: 1 }); +await asyncValues.return(); diff --git a/packages/rxjs/test/import/fixture-scenario.mjs b/packages/rxjs/test/import/fixture-scenario.mjs index 5dfe50482a..d7660ad498 100644 --- a/packages/rxjs/test/import/fixture-scenario.mjs +++ b/packages/rxjs/test/import/fixture-scenario.mjs @@ -35,7 +35,7 @@ if (scenario === 'missing-global-subpath') { }, { configurable: false, enumerable: false, writable: false } ); -} else if (scenario === 'root-core-only') { +} else if (scenario === 'root-functional-surface') { Reflect.deleteProperty(globalThis, 'Observable'); Reflect.deleteProperty(globalThis, 'Subscriber'); Reflect.deleteProperty(EventTarget.prototype, 'when'); @@ -48,6 +48,9 @@ if (scenario === 'missing-global-subpath') { assert.equal(typeof root.rx, 'function'); assert.equal(typeof root.map, 'function'); assert.equal(typeof root.filter, 'function'); + assert.equal(typeof root.merge, 'function'); + assert.equal(typeof root.mergeWith, 'function'); + assert.equal(typeof root.iterateEachValue, 'function'); const values = []; root .rx( @@ -57,8 +60,18 @@ if (scenario === 'missing-global-subpath') { ) .subscribe((value) => values.push(value)); assert.deepEqual(values, [20, 30]); - assert.deepEqual(constructorDescriptions, ['rxjs.observable.polyfill.info.v1', 'rxjs.kernel.create.v1']); - assert.deepEqual(prototypeDescriptions, ['Symbol.toStringTag', 'rxjs.kernel.create.v1']); + const symbolCatalog = await import('rxjs/symbol'); + const independentlyImplementedPipeables = new Set(['filter', 'map', 'take']); + for (const symbol of Object.values(symbolCatalog)) { + assert.equal(typeof symbol, 'symbol'); + if (independentlyImplementedPipeables.has(symbol.description)) { + continue; + } + assert.ok( + constructorDescriptions.includes(symbol.description) || prototypeDescriptions.includes(symbol.description), + `root import did not install ${symbol.description}` + ); + } } else if (scenario === 'foreign-constructor') { class ForeignObservable {} class ForeignSubscriber {} diff --git a/packages/rxjs/test/import/fixtures.mjs b/packages/rxjs/test/import/fixtures.mjs index 8c7b799f9c..b9de09aa12 100644 --- a/packages/rxjs/test/import/fixtures.mjs +++ b/packages/rxjs/test/import/fixtures.mjs @@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url'; const scenarios = [ 'missing-global-subpath', - 'root-core-only', + 'root-functional-surface', 'foreign-constructor', 'earlier-version', 'event-target-when', diff --git a/packages/rxjs/test/ported/unsupported-surface-catalog.json b/packages/rxjs/test/ported/unsupported-surface-catalog.json index d5665b12d5..209ee78ff4 100644 --- a/packages/rxjs/test/ported/unsupported-surface-catalog.json +++ b/packages/rxjs/test/ported/unsupported-surface-catalog.json @@ -10,8 +10,8 @@ "id": "imports:pipeable-functions", "surfaces": ["rxjs/operators", "root-imported operator functions", "source.pipe(...)"], "disposition": "replace", - "replacement": "Use exact Symbols for the complete reviewed catalog. The D-060 pilot also offers root rx composition for its small reviewed operator subset.", - "rationale": "RxJS Next does not preserve the complete RxJS 7 pipeable-function catalog or the string-named .pipe surface.", + "replacement": "Use exact Symbols for the accepted migration target, or review the D-060 root rx and complete functional experiment capability by capability.", + "rationale": "The experiment provides functions for the current Next catalog, but does not preserve rxjs/operators, the string-named .pipe surface, removed aliases, or RxJS 7 lifecycle semantics.", "decisions": ["D-003", "D-039", "D-050", "D-060"] }, { @@ -194,16 +194,16 @@ "id": "aliases:projection-to", "surfaces": ["mapTo", "concatMapTo", "mergeMapTo", "switchMapTo", "pluck"], "disposition": "replace", - "replacement": "Use map with a constant or property projection, or the corresponding canonical flattening Symbol with an explicit projection.", - "rationale": "Migration may preserve behavior through exact mappings, but the deprecated pipeable function/import shape is not supported.", + "replacement": "Use the root map, mergeMap, switchMap, or pluck function with an explicit projection, or use the corresponding exact Symbol.", + "rationale": "The deprecated *To names are not restored; the canonical Next function and Symbol names remain lifecycle-reviewed mappings.", "decisions": ["D-003", "D-039"] }, { "id": "aliases:combination-operators", "surfaces": ["pipeable combineLatest", "pipeable concat", "pipeable merge", "pipeable race", "pipeable zip", "onErrorResumeNextWith"], "disposition": "replace", - "replacement": "Use the accepted unified or With-form exact Symbol and its documented source-array/result-selector mapping.", - "rationale": "Legacy pipeable aliases are migration inputs, not preserved function exports.", + "replacement": "Use combineLatestWith, concatWith, mergeWith, raceWith, zipWith, or onErrorResumeNextWith from the root functional experiment, or the corresponding accepted exact Symbol.", + "rationale": "The functional names exist, but their Next source-array and lifecycle contracts are not a claim of unchanged RxJS 7 overloads or behavior.", "decisions": ["D-003", "D-039", "D-049"] }, { @@ -226,7 +226,7 @@ "id": "aliases:async-iteration", "surfaces": ["eachValueFrom", "bufferedValuesFrom"], "disposition": "replace", - "replacement": "Use one of iterateEachValue, iterateBufferedValues, iterateLatestValue, or iterateNextValue from its exact Symbol subpath.", + "replacement": "Use the root iterateEachValue, iterateBufferedValues, iterateLatestValue, or iterateNextValue terminal, or its exact Symbol form.", "rationale": "The exploratory standalone helpers were removed so buffering and dropping policy stays explicit.", "decisions": ["D-038", "D-039"] } diff --git a/packages/rxjs/test/types/pipeable-api.ts b/packages/rxjs/test/types/pipeable-api.ts index 907f1e414f..cc7b94b74a 100644 --- a/packages/rxjs/test/types/pipeable-api.ts +++ b/packages/rxjs/test/types/pipeable-api.ts @@ -1,11 +1,40 @@ -import { filter, map, rx, subscribe, take, toArray, type OperatorFunction, type Subscription, type UnaryFunction } from 'rxjs'; +import { + combineLatest, + combineLatestWith, + concat, + concatWith, + filter, + first as firstValue, + forkJoin, + iterateBufferedValues, + iterateEachValue, + iterateLatestValue, + iterateNextValue, + map, + merge, + mergeWith, + pipe, + rx, + subscribe, + take, + timer, + toArray, + type OperatorFunction, + type Subscription, + type UnaryFunction, +} from 'rxjs'; import { map as deepMap } from 'rxjs/pipeable/map'; +import { buffer as barrelBuffer } from 'rxjs/pipeable'; +import { mergeWith as deepMergeWith } from 'rxjs/pipeable/merge-with'; import { rx as deepRx } from 'rxjs/rx'; import { subscribe as deepSubscribe } from 'rxjs/subscribe'; +import * as symbols from 'rxjs/symbol'; import { map as mapSymbol } from 'rxjs/symbol/map'; import { toArray as deepToArray } from 'rxjs/to-array'; +import { merge as staticMerge } from 'rxjs/static'; const input: ObservableInput = [1, 2, 3]; +const stringInput: ObservableInput = ['four', 'five']; const stringify: OperatorFunction = map((value) => String(value)); const positive: OperatorFunction = filter((value) => value > 0); const length: UnaryFunction = (value) => value.length; @@ -37,11 +66,37 @@ const deepSubscription: Subscription = deepRx( deepSubscribe((value) => value.toFixed()) ); const symbolMapped: Observable = Observable.from(input)[mapSymbol]((value) => value.toFixed()); +const merged: Observable = rx(input, mergeWith([['four', 'five']])); +const barrelBuffered: Observable = rx(input, barrelBuffer({ maxSize: 2 })); +const deepMerged: Observable = rx(input, deepMergeWith([['four', 'five']])); +const concatenated: Observable = rx(input, concatWith([['four', 'five']])); +const combined: Observable<[number, string]> = rx(input, combineLatestWith([stringInput] as const)); +const staticMerged: Observable = merge([[1, 2], ['three']]); +const staticBarrelMerged: Observable = staticMerge([[1, 2], ['three']]); +const staticConcatenated: Observable = concat([[1, 2], ['three']]); +const staticCombined: Observable = combineLatest([input, stringInput] as const); +const joined: Observable<[number, string]> = forkJoin([input, Promise.resolve('three')] as const); +const ticking: Observable = timer(1); +const iterated: AsyncGenerator = rx(input, iterateEachValue()); +const bufferedIteration: AsyncGenerator = rx(input, iterateBufferedValues()); +const latestIteration: AsyncGenerator = rx(input, iterateLatestValue()); +const nextIteration: AsyncGenerator = rx(input, iterateNextValue()); +const firstString: Observable = rx( + mixed, + firstValue((value): value is string => typeof value === 'string') +); +const reusable: OperatorFunction = pipe( + take(1), + map((value) => value.toFixed()) +); +const reusableResult: Observable = rx(input, reusable); + +const mergeSymbolFromBarrel: typeof import('rxjs/symbol/merge').merge = symbols.merge; const increment = (value: number) => value + 1; -const first = (_source: Observable) => 0; -const nine: number = rx(input, first, increment, increment, increment, increment, increment, increment, increment, increment); -const ten = rx(input, first, increment, increment, increment, increment, increment, increment, increment, increment, increment); +const initial = (_source: Observable) => 0; +const nine: number = rx(input, initial, increment, increment, increment, increment, increment, increment, increment, increment); +const ten = rx(input, initial, increment, increment, increment, increment, increment, increment, increment, increment, increment); // @ts-expect-error Chains beyond nine transformations deliberately return unknown. const unsafeTen: number = ten; @@ -57,5 +112,23 @@ void deepMapped; void deepCollected; void deepSubscription; void symbolMapped; +void merged; +void barrelBuffered; +void deepMerged; +void concatenated; +void combined; +void staticMerged; +void staticBarrelMerged; +void staticConcatenated; +void staticCombined; +void joined; +void ticking; +void iterated; +void bufferedIteration; +void latestIteration; +void nextIteration; +void firstString; +void reusableResult; +void mergeSymbolFromBarrel; void nine; void unsafeTen; diff --git a/scripts/generate-pipeable-surface.mjs b/scripts/generate-pipeable-surface.mjs new file mode 100644 index 0000000000..2caf80e834 --- /dev/null +++ b/scripts/generate-pipeable-surface.mjs @@ -0,0 +1,495 @@ +#!/usr/bin/env node + +import { readFile, readdir, mkdir, writeFile } from 'node:fs/promises'; +import { dirname, join, relative, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import ts from 'typescript'; + +const repositoryRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..'); +const sourceRoot = join(repositoryRoot, 'packages/rxjs/src'); +const generatedStart = '// BEGIN GENERATED FUNCTIONAL SURFACE'; +const generatedEnd = '// END GENERATED FUNCTIONAL SURFACE'; +const checkOnly = process.argv.includes('--check'); + +const customPipeables = new Set(['filter', 'map', 'take']); +const excludedCapabilities = new Set(['create']); +const staticFacadeExclusions = new Set(['create', 'pipe']); +const withNames = new Map([ + ['combine', 'combineWith'], + ['combineLatest', 'combineLatestWith'], + ['concat', 'concatWith'], + ['merge', 'mergeWith'], + ['onErrorResumeNext', 'onErrorResumeNextWith'], + ['race', 'raceWith'], +]); +const sourceTypeParameters = new Map([['combineLatestAll', 'T extends ObservableInput']]); + +const pendingWrites = []; + +function kebabCase(value) { + return value.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase(); +} + +function exported(node) { + return node.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword) ?? false; +} + +function findSymbolName(sourceFile) { + for (const statement of sourceFile.statements) { + if (!ts.isVariableStatement(statement) || !exported(statement)) { + continue; + } + for (const declaration of statement.declarationList.declarations) { + if (ts.isIdentifier(declaration.name) && declaration.type?.getText(sourceFile).includes('unique symbol')) { + return declaration.name.text; + } + } + } + return undefined; +} + +function findInterfaceMember(sourceFile, interfaceName, symbolName) { + let result; + const visit = (node) => { + if (ts.isInterfaceDeclaration(node) && node.name.text === interfaceName) { + for (const member of node.members) { + if (member.name?.getText(sourceFile) === `[${symbolName}]`) { + result = member; + return; + } + } + } + ts.forEachChild(node, visit); + }; + visit(sourceFile); + return result; +} + +function findNamedType(sourceFile, name) { + for (const statement of sourceFile.statements) { + if ((ts.isInterfaceDeclaration(statement) || ts.isTypeAliasDeclaration(statement)) && statement.name.text === name) { + return statement; + } + } + return undefined; +} + +function applySubstitutions(text, substitutions, shadowedNames = new Set()) { + let result = text; + for (const [name, replacement] of substitutions) { + if (!shadowedNames.has(name)) { + result = result.replace(new RegExp(`\\b${name}\\b`, 'g'), replacement); + } + } + return result; +} + +function callSignaturesFromType(sourceFile, typeNode, substitutions = new Map()) { + if (ts.isFunctionTypeNode(typeNode)) { + return [{ node: typeNode, substitutions }]; + } + if (ts.isTypeLiteralNode(typeNode)) { + return typeNode.members.filter(ts.isCallSignatureDeclaration).map((node) => ({ node, substitutions })); + } + if (ts.isConditionalTypeNode(typeNode)) { + return callSignaturesFromType(sourceFile, typeNode.trueType, substitutions); + } + if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName)) { + const declaration = findNamedType(sourceFile, typeNode.typeName.text); + const nextSubstitutions = new Map(substitutions); + const declarationParameters = declaration?.typeParameters ?? []; + const referenceArguments = typeNode.typeArguments ?? []; + for (let index = 0; index < declarationParameters.length; index++) { + const parameter = declarationParameters[index]; + const argument = referenceArguments[index]; + if (parameter && argument) { + nextSubstitutions.set(parameter.name.text, applySubstitutions(argument.getText(sourceFile), substitutions)); + } + } + if (declaration && ts.isInterfaceDeclaration(declaration)) { + return declaration.members.filter(ts.isCallSignatureDeclaration).map((node) => ({ node, substitutions: nextSubstitutions })); + } + if (declaration && ts.isTypeAliasDeclaration(declaration)) { + return callSignaturesFromType(sourceFile, declaration.type, nextSubstitutions); + } + } + throw new Error(`Unsupported callable declaration in ${sourceFile.fileName}: ${typeNode.getText(sourceFile)}`); +} + +function callSignatures(sourceFile, member) { + if (!member) { + return []; + } + if (ts.isMethodSignature(member)) { + return [{ node: member, substitutions: new Map() }]; + } + if (ts.isPropertySignature(member) && member.type) { + return callSignaturesFromType(sourceFile, member.type); + } + throw new Error(`Unsupported interface member in ${sourceFile.fileName}: ${member.getText(sourceFile)}`); +} + +function signatureText(sourceFile, record, node) { + const shadowedNames = new Set((record.node.typeParameters ?? []).map((parameter) => parameter.name.text)); + return applySubstitutions(node.getText(sourceFile), record.substitutions, shadowedNames); +} + +function explicitThisParameter(record) { + const first = record.node.parameters[0]; + return first?.name.getText() === 'this' ? first : undefined; +} + +function sourceType(sourceFile, record) { + const thisParameter = explicitThisParameter(record); + if (!thisParameter?.type) { + return 'Observable'; + } + return signatureText(sourceFile, record, thisParameter.type); +} + +function typeParameters(sourceFile, record, symbolName, includeSourceType) { + const signature = record.node; + const thisType = sourceType(sourceFile, record); + const callTypeNames = new Set((signature.typeParameters ?? []).map((parameter) => parameter.name.text)); + const needsSourceType = includeSourceType && !callTypeNames.has('T') && /\bT\b/.test(thisType); + const sourceParameter = sourceTypeParameters.get(symbolName) ?? 'T'; + const parameters = needsSourceType ? [sourceParameter] : []; + for (const parameter of signature.typeParameters ?? []) { + const text = signatureText(sourceFile, record, parameter); + const name = parameter.name.text; + if (needsSourceType && name === 'T') { + throw new Error(`Unexpected shadowed source type T in ${sourceFile.fileName}: ${signature.getText(sourceFile)}`); + } + parameters.push(text); + } + return parameters.length > 0 ? `<${parameters.join(', ')}>` : ''; +} + +function signatureParameters(sourceFile, record) { + return record.node.parameters + .filter((parameter) => parameter !== explicitThisParameter(record)) + .map((parameter) => signatureText(sourceFile, record, parameter)) + .join(', '); +} + +function returnType(sourceFile, record) { + if (!record.node.type) { + throw new Error(`Missing return type in ${sourceFile.fileName}: ${record.node.getText(sourceFile)}`); + } + return signatureText(sourceFile, record, record.node.type); +} + +function generatedDocumentation(publicName, symbolName, resultKind) { + const terminalText = + resultKind === 'async-generator' + ? 'The AsyncGenerator result is returned unchanged, preserving the selected AsyncIterable strategy.' + : resultKind === 'arbitrary' + ? 'Any non-Observable result is returned unchanged.' + : 'The result uses the same construction, error-forwarding, and AbortSignal cancellation behavior as the Symbol form.'; + return `/** + * Creates the pipeable \`${publicName}\` form of the exact-Symbol \`[${symbolName}]\` capability. + * + * The source is supplied when the returned unary function is composed with + * \`rx\`, \`pipe\`, or another function-composition helper. ${terminalText} + * + * @returns A unary function that applies \`[${symbolName}]\` to its source. + */`; +} + +function generatedPipeableBlock(sourceFile, symbolName, publicName, signatures) { + const internalName = `pipeable${symbolName[0].toUpperCase()}${symbolName.slice(1)}`; + const results = signatures.map((signature) => returnType(sourceFile, signature)); + const resultKind = results.some((result) => result.startsWith('AsyncGenerator<')) + ? 'async-generator' + : results.some((result) => !result.startsWith('Observable<')) + ? 'arbitrary' + : 'observable'; + const overloads = signatures.map((record) => { + const generics = typeParameters(sourceFile, record, symbolName, true); + const parameters = signatureParameters(sourceFile, record); + const result = returnType(sourceFile, record); + return `export function ${internalName}${generics}(${parameters}): (source: ${sourceType(sourceFile, record)}) => ${result};`; + }); + return `${generatedDocumentation(publicName, symbolName, resultKind)} +${overloads.join('\n')} +export function ${internalName}(...args: any[]): any { + return (source: Observable) => Reflect.apply(source[${symbolName}] as (...values: any[]) => any, source, args); +}`; +} + +function generatedStaticBlock(sourceFile, symbolName, signatures) { + const internalName = `static${symbolName[0].toUpperCase()}${symbolName.slice(1)}`; + const overloads = signatures.map((record) => { + const generics = typeParameters(sourceFile, record, symbolName, false); + const parameters = signatureParameters(sourceFile, record); + const result = returnType(sourceFile, record); + return `export function ${internalName}${generics}(${parameters}): ${result};`; + }); + return `/** + * Calls the static exact-Symbol \`Observable[${symbolName}]\` capability as an ordinary function. + * + * Construction, conversion, error forwarding, and cancellation remain owned + * by the installed Symbol implementation. + */ +${overloads.join('\n')} +export function ${internalName}(...args: any[]): any { + return Reflect.apply(Observable[${symbolName}] as (...values: any[]) => any, Observable, args); +}`; +} + +function removeGeneratedBlock(text) { + const start = text.indexOf(generatedStart); + if (start < 0) { + return text.trimEnd(); + } + const end = text.indexOf(generatedEnd, start); + if (end < 0) { + throw new Error('Generated functional-surface block has no end marker'); + } + return `${text.slice(0, start).trimEnd()}${text.slice(end + generatedEnd.length)}`.trimEnd(); +} + +function extraExports(sourceFile, symbolName) { + const values = []; + const types = []; + for (const statement of sourceFile.statements) { + if (!exported(statement)) { + continue; + } + if (ts.isInterfaceDeclaration(statement) || ts.isTypeAliasDeclaration(statement)) { + types.push(statement.name.text); + continue; + } + if (ts.isClassDeclaration(statement) && statement.name) { + values.push(statement.name.text); + continue; + } + if ( + ts.isFunctionDeclaration(statement) && + statement.name && + statement.name.text !== symbolName && + !/^(?:pipeable|static)[A-Z]/.test(statement.name.text) + ) { + values.push(statement.name.text); + continue; + } + if (ts.isVariableStatement(statement)) { + for (const declaration of statement.declarationList.declarations) { + if (ts.isIdentifier(declaration.name) && declaration.name.text !== symbolName) { + values.push(declaration.name.text); + } + } + } + } + return { values, types }; +} + +function aliasModule({ sourceBase, valueExport, sourceExport, extras }) { + const valueNames = [sourceExport, ...extras.values]; + const valueClause = sourceExport === valueExport + ? valueNames.join(', ') + : `${sourceExport} as ${valueExport}${extras.values.length > 0 ? `, ${extras.values.join(', ')}` : ''}`; + const lines = [`export { ${valueClause} } from '../${sourceBase}.js';`]; + if (extras.types.length > 0) { + lines.push(`export type { ${extras.types.join(', ')} } from '../${sourceBase}.js';`); + } + return `${lines.join('\n')}\n`; +} + +async function queueWrite(path, content) { + let existing; + try { + existing = await readFile(path, 'utf8'); + } catch (error) { + if (error.code !== 'ENOENT') { + throw error; + } + } + if (existing !== content) { + pendingWrites.push({ path, content }); + } +} + +async function main() { + const entries = await readdir(sourceRoot); + const catalog = []; + + for (const entry of entries.sort()) { + if (!entry.endsWith('.ts') || entry.endsWith('.spec.ts')) { + continue; + } + const path = join(sourceRoot, entry); + const original = await readFile(path, 'utf8'); + const sourceFile = ts.createSourceFile(path, original, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); + const symbolName = findSymbolName(sourceFile); + if (!symbolName) { + continue; + } + + const sourceBase = entry.slice(0, -3); + const instanceMember = findInterfaceMember(sourceFile, 'Observable', symbolName); + const staticMember = findInterfaceMember(sourceFile, 'ObservableCtor', symbolName); + const instanceSignatures = callSignatures(sourceFile, instanceMember); + const staticSignatures = callSignatures(sourceFile, staticMember); + const publicOperatorName = withNames.get(symbolName) ?? symbolName; + const extras = extraExports(sourceFile, symbolName); + const excluded = excludedCapabilities.has(symbolName); + const custom = customPipeables.has(symbolName); + + catalog.push({ + entry, + sourceBase, + symbolName, + publicOperatorName, + instance: instanceSignatures.length > 0 && !excluded, + static: staticSignatures.length > 0 && !staticFacadeExclusions.has(symbolName), + custom, + extras, + }); + + const blocks = []; + if (instanceSignatures.length > 0 && !excluded && !custom) { + blocks.push(generatedPipeableBlock(sourceFile, symbolName, publicOperatorName, instanceSignatures)); + } + if (staticSignatures.length > 0 && !staticFacadeExclusions.has(symbolName)) { + blocks.push(generatedStaticBlock(sourceFile, symbolName, staticSignatures)); + } + + const base = removeGeneratedBlock(original); + const next = blocks.length > 0 + ? `${base}\n\n${generatedStart}\n\n${blocks.join('\n\n')}\n\n${generatedEnd}\n` + : `${base}\n`; + await queueWrite(path, next); + } + + for (const item of catalog) { + const symbolAlias = aliasModule({ + sourceBase: item.sourceBase, + valueExport: item.symbolName, + sourceExport: item.symbolName, + extras: item.extras, + }); + await queueWrite(join(sourceRoot, 'symbol', item.entry), symbolAlias); + + if (item.instance && !item.custom) { + const internalName = `pipeable${item.symbolName[0].toUpperCase()}${item.symbolName.slice(1)}`; + const pipeableAlias = aliasModule({ + sourceBase: item.sourceBase, + valueExport: item.publicOperatorName, + sourceExport: internalName, + extras: item.extras, + }); + await queueWrite(join(sourceRoot, 'pipeable', `${kebabCase(item.publicOperatorName)}.ts`), pipeableAlias); + } + + if (item.static) { + const internalName = `static${item.symbolName[0].toUpperCase()}${item.symbolName.slice(1)}`; + const staticAlias = aliasModule({ + sourceBase: item.sourceBase, + valueExport: item.symbolName, + sourceExport: internalName, + extras: item.extras, + }); + await queueWrite(join(sourceRoot, 'static', item.entry), staticAlias); + } + } + + const symbolBarrel = catalog + .map((item) => `export { ${item.symbolName} } from './${item.sourceBase}.js';`) + .join('\n'); + await queueWrite(join(sourceRoot, 'symbol', 'index.ts'), `${symbolBarrel}\n`); + + const pipeableBarrelLines = [ + "export { filter } from './filter.js';", + "export { map } from './map.js';", + "export { subscribe, type Subscription } from './subscribe.js';", + "export { take } from './take.js';", + "export { toArray } from './to-array.js';", + "export type { OperatorFunction, UnaryFunction } from './types.js';", + ]; + for (const item of catalog) { + if (item.instance && !item.custom) { + pipeableBarrelLines.push( + `export { ${item.publicOperatorName} } from './${kebabCase(item.publicOperatorName)}.js';` + ); + } + } + await queueWrite(join(sourceRoot, 'pipeable', 'index.ts'), `${pipeableBarrelLines.join('\n')}\n`); + + const staticBarrel = catalog + .filter((item) => item.static) + .map((item) => `export { ${item.symbolName} } from './${item.sourceBase}.js';`) + .join('\n'); + await queueWrite(join(sourceRoot, 'static', 'index.ts'), `${staticBarrel}\n`); + + const rootLines = []; + for (const item of catalog) { + if (item.instance && !item.custom) { + rootLines.push(`export { ${item.publicOperatorName} } from './pipeable/${kebabCase(item.publicOperatorName)}.js';`); + } + if (item.static) { + rootLines.push(`export { ${item.symbolName} } from './static/${item.sourceBase}.js';`); + } + if (item.extras.values.length > 0) { + rootLines.push(`export { ${item.extras.values.join(', ')} } from './${item.sourceBase}.js';`); + } + if (item.extras.types.length > 0) { + rootLines.push(`export type { ${item.extras.types.join(', ')} } from './${item.sourceBase}.js';`); + } + } + + const indexPath = join(sourceRoot, 'index.ts'); + const indexOriginal = await readFile(indexPath, 'utf8'); + const indexBase = removeGeneratedBlock(indexOriginal); + const nextIndex = `${indexBase}\n\n${generatedStart}\n\n${rootLines.join('\n')}\n\n${generatedEnd}\n`; + await queueWrite(indexPath, nextIndex); + + const inventory = { + pipeableOperators: catalog.filter((item) => item.instance).map((item) => item.publicOperatorName), + staticFunctions: catalog.filter((item) => item.static).map((item) => item.symbolName), + symbols: catalog.map((item) => item.symbolName), + }; + await queueWrite(join(sourceRoot, 'pipeable', 'catalog.json'), `${JSON.stringify(inventory, null, 2)}\n`); + + const packagePath = join(repositoryRoot, 'packages/rxjs/package.json'); + const packageJson = JSON.parse(await readFile(packagePath, 'utf8')); + const sourceExports = packageJson.tshy.exports; + sourceExports['./pipeable'] = './src/pipeable/index.ts'; + sourceExports['./static'] = './src/static/index.ts'; + sourceExports['./symbol'] = './src/symbol/index.ts'; + for (const item of catalog) { + sourceExports[`./symbol/${item.sourceBase}`] = `./src/symbol/${item.sourceBase}.ts`; + if (item.instance) { + const publicBase = kebabCase(item.publicOperatorName); + sourceExports[`./pipeable/${publicBase}`] = `./src/pipeable/${publicBase}.ts`; + if (withNames.has(item.symbolName)) { + sourceExports[`./${publicBase}`] = `./src/pipeable/${publicBase}.ts`; + } + } + if (item.static) { + sourceExports[`./static/${item.sourceBase}`] = `./src/static/${item.sourceBase}.ts`; + } + } + packageJson.tshy.exports = Object.fromEntries(Object.entries(sourceExports).sort(([left], [right]) => left.localeCompare(right))); + await queueWrite(packagePath, `${JSON.stringify(packageJson, null, 2)}\n`); + + if (pendingWrites.length === 0) { + console.log('The generated functional surface is current.'); + return; + } + if (checkOnly) { + console.error('The generated functional surface is stale:'); + for (const write of pendingWrites) { + console.error(`- ${relative(repositoryRoot, write.path)}`); + } + process.exitCode = 1; + return; + } + for (const write of pendingWrites) { + await mkdir(dirname(write.path), { recursive: true }); + await writeFile(write.path, write.content); + } + console.log(`Updated ${pendingWrites.length} generated functional-surface files.`); +} + +await main();