diff --git a/.gitignore b/.gitignore index 13b8318be2..d89d0f15e1 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,12 @@ integration/import/**/rx.json integration/import/**/operators.json -.nx/cache \ No newline at end of file +.nx/cache + +# VitePress +.cache +.vitepress/dist +**/.vitepress/cache/ + +**/components.d.ts +**/auto-imports.d.ts diff --git a/apps/rxjs.dev-next/.vitepress/config.ts b/apps/rxjs.dev-next/.vitepress/config.ts new file mode 100644 index 0000000000..1a12f91526 --- /dev/null +++ b/apps/rxjs.dev-next/.vitepress/config.ts @@ -0,0 +1,143 @@ +import { defineConfig, type UserConfig } from 'vitepress' +import type { DefaultTheme, Outline } from 'vitepress/theme' +import typedocSidebar from '../docs/api/typedoc-sidebar.json'; +import ui from '@nuxt/ui/vite' + + +export default defineConfig({ + title: 'RxJS', + description: 'Reactive Extensions Library for JavaScript', + srcDir: 'docs', + + // Markdown configuration + markdown: { + // Shiki is enabled by default in VitePress + // Code blocks will be highlighted automatically + theme: { + light: 'github-light', + dark: 'github-dark' + }, + lineNumbers: true, + }, + + head: [ + ['link', { rel: 'icon', type: 'image/png', href: '/images/favicons/favicon-96x96.png', sizes: '96x96' }], + ['link', { rel: 'icon', type: 'image/svg+xml', href: '/images/favicons/favicon.svg' }], + ['link', { rel: 'shortcut icon', href: '/images/favicons/favicon.ico' }], + ['link', { rel: 'apple-touch-icon', sizes: '180x180', href: '/images/favicons/apple-touch-icon.png' }], + ['link', { rel: 'manifest', href: '/site.webmanifest' }] + ], + + vite: { + plugins: [ + ui({ + router: false, + ui: { + colors: { + primary: 'brand', + neutral: 'zinc' + } + } + }), + ], + }, + + // Theme configuration + themeConfig: { + outline: { + level: [2, 3, 4, 5] as Outline['level'], + }, + logo: { src: '/images/favicons/favicon.svg', width: 24, height: 24 }, + socialLinks: [ + { icon: 'github', link: 'https://github.com/ReactiveX/rxjs' } + ], + search: { + provider: 'local' + }, + nav: [ + { text: 'Overview', link: '/guide/overview' }, + { text: 'API Reference', link: '/api' }, + { + text: 'About', + items: [ + { text: 'Team', link: '/team' }, + { text: 'Code of Conduct', link: '/code-of-conduct' }, + { text: 'Black Lives Matter', link: '/black-lives-matter' } + ] + }, + + ], + sidebar: { + '/guide': [ + { + text: 'Getting Started', + items: [ + { + text: 'Overview', collapsed: true, items: [ + { text: 'Introduction', link: '/guide/overview' }, + { text: 'Observables', link: '/guide/observable' }, + { text: 'Observer', link: '/guide/observer' }, + { text: 'Operators', link: '/guide/operators' }, + { text: 'Subscription', link: '/guide/subscription' }, + { text: 'Subjects', link: '/guide/subject' }, + { text: 'Scheduler', link: '/guide/scheduler' }, + { text: 'Higher-Order Observables', link: '/guide/higher-order-observables' }, + ] + }, + { + text: 'Installation', + link: '/guide/installation' + }, + { + text: 'Importing', + link: '/guide/importing' + }, + { + text: 'Glossary', + collapsed: true, + items: [ + { text: 'Core Semantics', link: '/guide/core-semantics' }, + { text: 'Glossary', link: '/guide/glossary-and-semantics' } + ] + }, + { + text: 'Testing', + items: [ + { text: 'Marble Testing', link: '/guide/testing/marble-testing' } + ] + }, + { text: 'Migration Guide', link: '/deprecations' } + ] + }, + ], + '/deprecations': [ + { + text: 'Deprecations & Breaking Changes', + items: [ + { + text: 'v7.x Breaking Changes', + link: '/deprecations/breaking-changes', + items: [ + { text: 'v6 to v7 change summary', link: '/deprecations/6-to-7-change-summary' }, + { text: 'Scheduler Argument', link: '/deprecations/scheduler-argument' }, + { text: 'Subscribe Arguments', link: '/deprecations/subscribe-arguments' }, + { text: 'ResultSelector Arguments', link: '/deprecations/result-selector' }, + { text: 'Array Arguments', link: '/deprecations/array-argument' }, + { text: 'Multicasting', link: '/deprecations/multicasting' }, + { text: 'Conversion to Promises', link: '/deprecations/to-promise' }, + + ] + }, + { text: 'v6.x Changelog', link: 'https://github.com/ReactiveX/rxjs/blob/6.x/CHANGELOG.md' }, + ] + }, + ], + '/api': [ + { + text: 'API Reference', + items: typedocSidebar, + } + ] + } + }, +} satisfies UserConfig); diff --git a/apps/rxjs.dev-next/.vitepress/theme/index.ts b/apps/rxjs.dev-next/.vitepress/theme/index.ts new file mode 100644 index 0000000000..1296baaae4 --- /dev/null +++ b/apps/rxjs.dev-next/.vitepress/theme/index.ts @@ -0,0 +1,12 @@ +import DefaultTheme from 'vitepress/theme' +import type { Theme } from 'vitepress' +import ui from '@nuxt/ui/vue-plugin' + +import './style.css' + +export default { + extends: DefaultTheme, + enhanceApp({ app }) { + app.use(ui) + }, +} satisfies Theme diff --git a/apps/rxjs.dev-next/.vitepress/theme/shiki.ts b/apps/rxjs.dev-next/.vitepress/theme/shiki.ts new file mode 100644 index 0000000000..b0ecf77fc6 --- /dev/null +++ b/apps/rxjs.dev-next/.vitepress/theme/shiki.ts @@ -0,0 +1,17 @@ +// Shiki is already integrated in VitePress by default +// This file can be used for custom Shiki configuration if needed + +import type { UserConfig } from 'vitepress'; + +// VitePress uses Shiki by default for syntax highlighting +// No additional configuration needed unless we want custom themes or languages + +export const shikiConfig = { + // VitePress default Shiki theme + theme: 'github-dark', + // Additional languages can be added here if needed + langs: ['typescript', 'javascript', 'json', 'bash'], +}; + + + diff --git a/apps/rxjs.dev-next/.vitepress/theme/style.css b/apps/rxjs.dev-next/.vitepress/theme/style.css new file mode 100644 index 0000000000..a3b401e9cc --- /dev/null +++ b/apps/rxjs.dev-next/.vitepress/theme/style.css @@ -0,0 +1,68 @@ +@import 'tailwindcss'; + +/* Tell Tailwind where to scan for classes */ +@source "../../../../node_modules/@nuxt/ui/dist/shared"; +@source "../../components"; +@source "../../docs"; +@import '@nuxt/ui'; + +:root { + /* brand-1: most solid color for colored text (must satisfy contrast on brand-soft) */ + --vp-c-brand-1: #f03aa0; + --vp-c-brand-2: #ee1090; + --vp-c-brand-3: #d00e80; + /* brand-soft: subtle background (semi-transparent, must satisfy contrast with brand-1 text) */ + --vp-c-brand-soft: rgba(238, 16, 144, 0.14); + + /* Hero section customization */ + --vp-home-hero-name-color: transparent; + --vp-home-hero-name-background: linear-gradient(-45deg, var(--vp-c-brand-3) 30%, var(--vp-c-brand-1) 50%); +} + +.dark { + /* Dark mode brand colors - adjust if needed for better contrast */ + --vp-c-brand-1: #f03aa0; + --vp-c-brand-2: #ee1090; + --vp-c-brand-3: #d00e80; + --vp-c-brand-soft: rgba(238, 16, 144, 0.16); + + --vp-home-hero-name-background: linear-gradient(-45deg, var(--vp-c-brand-1) 30%, var(--vp-c-brand-3) 50%); + --vp-home-hero-image-filter: blur(160px); +} + +@theme static { + /* Define new custom color */ + --color-brand-300: #f03aa0; + --color-brand-400: #ee1090; + --color-brand-500: #ee1090; + --color-brand-600: #d00e80; +} + +.only-dark { + display: none; +} +.dark .only-dark { + display: initial; +} +.dark .only-light { + display: none; +} + +img[src*='marble'] { + border-radius: 8px; +} + +button, +input, +optgroup, +select, +textarea { + border: revert-layer; + padding: revert-layer; + background-color: revert-layer; +} + +.image-bg { + top: 60% !important; + left: 50% !important; +} diff --git a/apps/rxjs.dev-next/README.md b/apps/rxjs.dev-next/README.md new file mode 100644 index 0000000000..636f1be7e1 --- /dev/null +++ b/apps/rxjs.dev-next/README.md @@ -0,0 +1,21 @@ +# RxJS Dev Next + +This is the next-generation documentation site for RxJS, built with VitePress. + +## Development + +```bash +yarn dev +``` + +## Build + +```bash +yarn build +``` + +## Preview + +```bash +yarn preview +``` diff --git a/apps/rxjs.dev-next/components/ApiSection.vue b/apps/rxjs.dev-next/components/ApiSection.vue new file mode 100644 index 0000000000..026bebb3ab --- /dev/null +++ b/apps/rxjs.dev-next/components/ApiSection.vue @@ -0,0 +1,94 @@ + + + + + + + diff --git a/apps/rxjs.dev-next/components/Search.vue b/apps/rxjs.dev-next/components/Search.vue new file mode 100644 index 0000000000..39b244ed08 --- /dev/null +++ b/apps/rxjs.dev-next/components/Search.vue @@ -0,0 +1,37 @@ + + diff --git a/apps/rxjs.dev-next/docs/api/@rxjs/observable/enumerations/ObservableInputType.md b/apps/rxjs.dev-next/docs/api/@rxjs/observable/enumerations/ObservableInputType.md new file mode 100644 index 0000000000..407bef3603 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/@rxjs/observable/enumerations/ObservableInputType.md @@ -0,0 +1,17 @@ +[API](../../../index.md) / [@rxjs/observable](../index.md) / ObservableInputType + +# Enumeration: ObservableInputType + +Defined in: [observable/src/observable.ts:1231](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L1231) + +## Enumeration Members + +| Enumeration Member | Value | +| ---------------------------------------------------- | ----- | +| `ArrayLike` | `2` | +| `AsyncIterable` | `4` | +| `InteropObservable` | `1` | +| `Iterable` | `5` | +| `Own` | `0` | +| `Promise` | `3` | +| `ReadableStreamLike` | `6` | diff --git a/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/fromArrayLike.md b/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/fromArrayLike.md new file mode 100644 index 0000000000..1d3170d766 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/fromArrayLike.md @@ -0,0 +1,24 @@ +[API](../../../index.md) / [@rxjs/observable](../index.md) / fromArrayLike + +# Function: fromArrayLike() + +```ts +function fromArrayLike<>(array: ArrayLike): Observable; +``` + +Defined in: [observable/src/observable.ts:1149](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L1149) + +Synchronously emits the values of an array like and completes. +This is exported because there are creation functions and operators that need to +make direct use of the same logic, and there's no reason to make them run through +`from` conditionals because we _know_ they're dealing with an array. + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------ | ----------------------------- | +| `array` | `ArrayLike`\<`T`\> | The array to emit values from | + +## Returns + +[`Observable`](../../../rxjs/classes/Observable.md)\<`T`\> diff --git a/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/getObservableInputType.md b/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/getObservableInputType.md new file mode 100644 index 0000000000..79762a8d25 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/getObservableInputType.md @@ -0,0 +1,19 @@ +[API](../../../index.md) / [@rxjs/observable](../index.md) / getObservableInputType + +# Function: getObservableInputType() + +```ts +function getObservableInputType(input: unknown): ObservableInputType; +``` + +Defined in: [observable/src/observable.ts:1241](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L1241) + +## Parameters + +| Parameter | Type | +| --------- | --------- | +| `input` | `unknown` | + +## Returns + +[`ObservableInputType`](../enumerations/ObservableInputType.md) diff --git a/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/isArrayLike.md b/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/isArrayLike.md new file mode 100644 index 0000000000..994569ac95 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/isArrayLike.md @@ -0,0 +1,19 @@ +[API](../../../index.md) / [@rxjs/observable](../index.md) / isArrayLike + +# Function: isArrayLike() + +```ts +function isArrayLike<>(x: any): x is ArrayLike; +``` + +Defined in: [observable/src/observable.ts:1320](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L1320) + +## Parameters + +| Parameter | Type | +| --------- | ----- | +| `x` | `any` | + +## Returns + +`x is ArrayLike` diff --git a/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/isFunction.md b/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/isFunction.md new file mode 100644 index 0000000000..e41c61cde4 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/isFunction.md @@ -0,0 +1,21 @@ +[API](../../../index.md) / [@rxjs/observable](../index.md) / isFunction + +# Function: isFunction() + +```ts +function isFunction(value: any): value is (args: any[]) => any; +``` + +Defined in: [observable/src/observable.ts:1273](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L1273) + +Returns true if the object is a function. + +## Parameters + +| Parameter | Type | Description | +| --------- | ----- | ------------------ | +| `value` | `any` | The value to check | + +## Returns + +`value is (args: any[]) => any` diff --git a/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/isPromise.md b/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/isPromise.md new file mode 100644 index 0000000000..ffe6739c2f --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/isPromise.md @@ -0,0 +1,21 @@ +[API](../../../index.md) / [@rxjs/observable](../index.md) / isPromise + +# Function: isPromise() + +```ts +function isPromise(value: any): value is PromiseLike; +``` + +Defined in: [observable/src/observable.ts:1306](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L1306) + +Tests to see if the object is "thennable". + +## Parameters + +| Parameter | Type | Description | +| --------- | ----- | ------------------ | +| `value` | `any` | the object to test | + +## Returns + +`value is PromiseLike` diff --git a/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/readableStreamLikeToAsyncGenerator.md b/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/readableStreamLikeToAsyncGenerator.md new file mode 100644 index 0000000000..156fc9b162 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/readableStreamLikeToAsyncGenerator.md @@ -0,0 +1,19 @@ +[API](../../../index.md) / [@rxjs/observable](../index.md) / readableStreamLikeToAsyncGenerator + +# Function: readableStreamLikeToAsyncGenerator() + +```ts +function readableStreamLikeToAsyncGenerator<>(readableStream: ReadableStreamLike): AsyncGenerator; +``` + +Defined in: [observable/src/observable.ts:1281](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L1281) + +## Parameters + +| Parameter | Type | +| ---------------- | --------------------------- | +| `readableStream` | `ReadableStreamLike`\<`T`\> | + +## Returns + +`AsyncGenerator`\<`T`\> diff --git a/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/subscribeToArray.md b/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/subscribeToArray.md new file mode 100644 index 0000000000..59130c5d4c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/@rxjs/observable/functions/subscribeToArray.md @@ -0,0 +1,22 @@ +[API](../../../index.md) / [@rxjs/observable](../index.md) / subscribeToArray + +# Function: subscribeToArray() + +```ts +function subscribeToArray<>(array: ArrayLike, subscriber: Subscriber): void; +``` + +Defined in: [observable/src/observable.ts:1210](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L1210) + +Subscribes to an ArrayLike with a subscriber + +## Parameters + +| Parameter | Type | Description | +| ------------ | ---------------------------------------------------------- | --------------------------------------- | +| `array` | `ArrayLike`\<`T`\> | The array or array-like to subscribe to | +| `subscriber` | [`Subscriber`](../../../rxjs/classes/Subscriber.md)\<`T`\> | | + +## Returns + +`void` diff --git a/apps/rxjs.dev-next/docs/api/@rxjs/observable/index.md b/apps/rxjs.dev-next/docs/api/@rxjs/observable/index.md new file mode 100644 index 0000000000..7816935082 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/@rxjs/observable/index.md @@ -0,0 +1,59 @@ +[API](../../index.md) / @rxjs/observable + +# @rxjs/observable + +## Enumerations + +- [ObservableInputType](enumerations/ObservableInputType.md) + +## Functions + +- [fromArrayLike](functions/fromArrayLike.md) +- [getObservableInputType](functions/getObservableInputType.md) +- [isArrayLike](functions/isArrayLike.md) +- [isFunction](functions/isFunction.md) +- [isPromise](functions/isPromise.md) +- [readableStreamLikeToAsyncGenerator](functions/readableStreamLikeToAsyncGenerator.md) +- [subscribeToArray](functions/subscribeToArray.md) + +## References + +### config + +Re-exports [config](../../rxjs/variables/config.md) + +### from + +Re-exports [from](../../rxjs/functions/from.md) + +### GlobalConfig + +Re-exports [GlobalConfig](../../rxjs/interfaces/GlobalConfig.md) + +### isObservable + +Re-exports [isObservable](../../rxjs/functions/isObservable.md) + +### Observable + +Re-exports [Observable](../../rxjs/classes/Observable.md) + +### operate + +Re-exports [operate](../../rxjs/functions/operate.md) + +### Subscriber + +Re-exports [Subscriber](../../rxjs/classes/Subscriber.md) + +### SubscriberOverrides + +Re-exports [SubscriberOverrides](../../rxjs/interfaces/SubscriberOverrides.md) + +### Subscription + +Re-exports [Subscription](../../rxjs/classes/Subscription.md) + +### UnsubscriptionError + +Re-exports [UnsubscriptionError](../../rxjs/classes/UnsubscriptionError.md) diff --git a/apps/rxjs.dev-next/docs/api/ajax/classes/AjaxError.md b/apps/rxjs.dev-next/docs/api/ajax/classes/AjaxError.md new file mode 100644 index 0000000000..b3a8965def --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/ajax/classes/AjaxError.md @@ -0,0 +1,75 @@ +[API](../../index.md) / [ajax](../index.md) / AjaxError + +# Class: AjaxError + +## Description + +Thrown when an error occurs during an AJAX request. +This is only exported because it is useful for checking to see if an error +is an `instanceof AjaxError`. DO NOT create new instances of `AjaxError` with +the constructor. + +Defined in: [rxjs/src/internal/ajax/errors.ts:11](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/ajax/errors.ts#L11) + +Thrown when an error occurs during an AJAX request. +This is only exported because it is useful for checking to see if an error +is an `instanceof AjaxError`. DO NOT create new instances of `AjaxError` with +the constructor. + +## See + +[ajax](../variables/ajax.md) + +## Extends + +- `Error` + +## Extended by + +- [`AjaxTimeoutError`](AjaxTimeoutError.md) + +## Constructors + +### Constructor + +```ts +new AjaxError( + message: string, + xhr: XMLHttpRequest, + request: AjaxRequest): AjaxError; +``` + +Defined in: [rxjs/src/internal/ajax/errors.ts:42](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/ajax/errors.ts#L42) + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------- | +| `message` | `string` | +| `xhr` | `XMLHttpRequest` | +| `request` | [`AjaxRequest`](../interfaces/AjaxRequest.md) | + +#### Returns + +`AjaxError` + +#### Deprecated + +Internal implementation detail. Do not construct error instances. +Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 + +#### Overrides + +```ts +Error.constructor; +``` + +## Properties + +| Property | Type | Description | +| ---------------------------------------- | --------------------------------------------- | ----------------------------------------------------------------------------- | +| `request` | [`AjaxRequest`](../interfaces/AjaxRequest.md) | The AjaxRequest associated with the error. | +| `response` | `any` | The response data. | +| `responseType` | `XMLHttpRequestResponseType` | The responseType (e.g. 'json', 'arraybuffer', or 'xml'). | +| `status` | `number` | The HTTP status code, if the request has completed. If not, it is set to `0`. | +| `xhr` | `XMLHttpRequest` | The XHR instance associated with the error. | diff --git a/apps/rxjs.dev-next/docs/api/ajax/classes/AjaxResponse.md b/apps/rxjs.dev-next/docs/api/ajax/classes/AjaxResponse.md new file mode 100644 index 0000000000..de4922ae57 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/ajax/classes/AjaxResponse.md @@ -0,0 +1,76 @@ +[API](../../index.md) / [ajax](../index.md) / AjaxResponse + +# Class: AjaxResponse + +> A normalized response from an AJAX request. To get the data from the response, +> you will want to read the `response` property. + +## Description + +- DO NOT create instances of this class directly. +- DO NOT subclass this class. + +It is advised not to hold this object in memory, as it has a reference to +the original XHR used to make the request, as well as properties containing +request and response data. + +Defined in: [rxjs/src/internal/ajax/AjaxResponse.ts:17](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/ajax/AjaxResponse.ts#L17) + +## See + +- [ajax](../variables/ajax.md) +- [AjaxConfig](../interfaces/AjaxConfig.md) + +## Constructors + +### Constructor + +```ts +new AjaxResponse<>( + originalEvent: ProgressEvent, + xhr: XMLHttpRequest, + request: AjaxRequest, + type: + | "upload_progress" + | "upload_load" + | "upload_loadstart" + | "download_progress" + | "download_load" +| "download_loadstart"): AjaxResponse; +``` + +Defined in: [rxjs/src/internal/ajax/AjaxResponse.ts:64](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/ajax/AjaxResponse.ts#L64) + +A normalized response from an AJAX request. To get the data from the response, +you will want to read the `response` property. + +- DO NOT create instances of this class directly. +- DO NOT subclass this class. + +#### Parameters + +| Parameter | Type | Default value | Description | +| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------- | +| `originalEvent` | `ProgressEvent` | `undefined` | The original event object from the XHR `onload` event. | +| `xhr` | `XMLHttpRequest` | `undefined` | The `XMLHttpRequest` object used to make the request. This is useful for examining status code, etc. | +| `request` | [`AjaxRequest`](../interfaces/AjaxRequest.md) | `undefined` | The request settings used to make the HTTP request. | +| `type` | \| `"upload_progress"` \| `"upload_load"` \| `"upload_loadstart"` \| `"download_progress"` \| `"download_load"` \| `"download_loadstart"` | `'download_load'` | The type of the event emitted by the [ajax](../variables/ajax.md) Observable | + +#### Returns + +`AjaxResponse`\<`T`\> + +## Properties + +| Property | Type | Default value | Description | +| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `loaded` | `number` | `undefined` | The total number of bytes loaded so far. To be used with [total](#total) while calculating progress. (You will want to set [AjaxConfig.includeDownloadProgress](../interfaces/AjaxConfig.md#includedownloadprogress)} or [AjaxConfig.includeDownloadProgress](../interfaces/AjaxConfig.md#includedownloadprogress)}) | +| `originalEvent` | `ProgressEvent` | `undefined` | The original event object from the raw XHR event. | +| `request` | [`AjaxRequest`](../interfaces/AjaxRequest.md) | `undefined` | The request parameters used to make the HTTP request. | +| `response` | `T` | `undefined` | The response data, if any. Note that this will automatically be converted to the proper type | +| `responseHeaders` | `Record`\<`string`, `string`\> | `undefined` | A dictionary of the response headers. | +| ~~`responseType`~~ | `XMLHttpRequestResponseType` | `undefined` | The responseType set on the request. (For example: `""`, `"arraybuffer"`, `"blob"`, `"document"`, `"json"`, or `"text"`) **Deprecated** There isn't much reason to examine this. It's the same responseType set (or defaulted) on the ajax config. If you really need to examine this value, you can check it on the `request` or the `xhr`. Will be removed in v8. | +| `status` | `number` | `undefined` | The HTTP status code | +| `total` | `number` | `undefined` | The total number of bytes to be loaded. To be used with [loaded](#loaded) while calculating progress. (You will want to set [AjaxConfig.includeDownloadProgress](../interfaces/AjaxConfig.md#includedownloadprogress)} or [AjaxConfig.includeDownloadProgress](../interfaces/AjaxConfig.md#includedownloadprogress)}) | +| `type` | \| `"upload_progress"` \| `"upload_load"` \| `"upload_loadstart"` \| `"download_progress"` \| `"download_load"` \| `"download_loadstart"` | `'download_load'` | The event type. This can be used to discern between different events if you're using progress events with [AjaxConfig.includeDownloadProgress](../interfaces/AjaxConfig.md#includedownloadprogress)} or [AjaxConfig.includeUploadProgress](../interfaces/AjaxConfig.md#includeuploadprogress)} settings in [AjaxConfig](../interfaces/AjaxConfig.md). The event type consists of two parts: the [AjaxDirection](../type-aliases/AjaxDirection.md) and the the event type. Merged with `_`, they form the `type` string. The direction can be an `upload` or a `download` direction, while an event can be `loadstart`, `progress` or `load`. `download_load` is the type of event when download has finished and the response is available. | +| `xhr` | `XMLHttpRequest` | `undefined` | The XMLHttpRequest object used to make the request. NOTE: It is advised not to hold this in memory, as it will retain references to all of it's event handlers and many other things related to the request. | diff --git a/apps/rxjs.dev-next/docs/api/ajax/classes/AjaxTimeoutError.md b/apps/rxjs.dev-next/docs/api/ajax/classes/AjaxTimeoutError.md new file mode 100644 index 0000000000..6cfb6e5675 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/ajax/classes/AjaxTimeoutError.md @@ -0,0 +1,61 @@ +[API](../../index.md) / [ajax](../index.md) / AjaxTimeoutError + +# Class: AjaxTimeoutError + +> Thrown when an AJAX request times out. Not to be confused with [TimeoutError](../../rxjs/classes/TimeoutError.md). + +## Description + +This is exported only because it is useful for checking to see if errors are an +`instanceof AjaxTimeoutError`. DO NOT use the constructor to create an instance of +this type. + +Defined in: [rxjs/src/internal/ajax/errors.ts:62](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/ajax/errors.ts#L62) + +## See + +[ajax](../variables/ajax.md) + +## Extends + +- [`AjaxError`](AjaxError.md) + +## Constructors + +### Constructor + +```ts +new AjaxTimeoutError(xhr: XMLHttpRequest, request: AjaxRequest): AjaxTimeoutError; +``` + +Defined in: [rxjs/src/internal/ajax/errors.ts:67](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/ajax/errors.ts#L67) + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------- | +| `xhr` | `XMLHttpRequest` | +| `request` | [`AjaxRequest`](../interfaces/AjaxRequest.md) | + +#### Returns + +`AjaxTimeoutError` + +#### Deprecated + +Internal implementation detail. Do not construct error instances. +Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 + +#### Overrides + +[`AjaxError`](AjaxError.md).[`constructor`](AjaxError.md#constructor) + +## Properties + +| Property | Type | Description | Inherited from | +| ---------------------------------------- | --------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `request` | [`AjaxRequest`](../interfaces/AjaxRequest.md) | The AjaxRequest associated with the error. | [`AjaxError`](AjaxError.md).[`request`](AjaxError.md#request) | +| `response` | `any` | The response data. | [`AjaxError`](AjaxError.md).[`response`](AjaxError.md#response) | +| `responseType` | `XMLHttpRequestResponseType` | The responseType (e.g. 'json', 'arraybuffer', or 'xml'). | [`AjaxError`](AjaxError.md).[`responseType`](AjaxError.md#responsetype) | +| `status` | `number` | The HTTP status code, if the request has completed. If not, it is set to `0`. | [`AjaxError`](AjaxError.md).[`status`](AjaxError.md#status) | +| `xhr` | `XMLHttpRequest` | The XHR instance associated with the error. | [`AjaxError`](AjaxError.md).[`xhr`](AjaxError.md#xhr) | diff --git a/apps/rxjs.dev-next/docs/api/ajax/index.md b/apps/rxjs.dev-next/docs/api/ajax/index.md new file mode 100644 index 0000000000..2b64eb55c1 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/ajax/index.md @@ -0,0 +1,22 @@ +[API](../index.md) / ajax + +# ajax + +## Classes + +- [AjaxError](classes/AjaxError.md) +- [AjaxResponse](classes/AjaxResponse.md) +- [AjaxTimeoutError](classes/AjaxTimeoutError.md) + +## Interfaces + +- [AjaxConfig](interfaces/AjaxConfig.md) +- [AjaxRequest](interfaces/AjaxRequest.md) + +## Type Aliases + +- [AjaxDirection](type-aliases/AjaxDirection.md) + +## Variables + +- [ajax](variables/ajax.md) diff --git a/apps/rxjs.dev-next/docs/api/ajax/interfaces/AjaxConfig.md b/apps/rxjs.dev-next/docs/api/ajax/interfaces/AjaxConfig.md new file mode 100644 index 0000000000..7a5757236d --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/ajax/interfaces/AjaxConfig.md @@ -0,0 +1,34 @@ +[API](../../index.md) / [ajax](../index.md) / AjaxConfig + +# Interface: AjaxConfig + +## Description + +Configuration for the [ajax](../variables/ajax.md) creation function. + +Defined in: [rxjs/src/internal/ajax/types.ts:82](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/ajax/types.ts#L82) + +Configuration for the [ajax](../variables/ajax.md) creation function. + +## Properties + +| Property | Type | Description | +| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `async?` | `boolean` | Whether or not to send the request asynchronously. Defaults to `true`. If set to `false`, this will block the thread until the AJAX request responds. | +| `body?` | `any` | The body of the HTTP request to send. This is serialized, by default, based off of the value of the `"content-type"` header. For example, if the `"content-type"` is `"application/json"`, the body will be serialized as JSON. If the `"content-type"` is `"application/x-www-form-urlencoded"`, whatever object passed to the body will be serialized as URL, using key-value pairs based off of the keys and values of the object. In all other cases, the body will be passed directly. | +| `createXHR?` | () => `XMLHttpRequest` | An optional factory used to create the XMLHttpRequest object used to make the AJAX request. This is useful in environments that lack `XMLHttpRequest`, or in situations where you wish to override the default `XMLHttpRequest` for some reason. If not provided, the `XMLHttpRequest` in global scope will be used. NOTE: This AJAX implementation relies on the built-in serialization and setting of Content-Type headers that is provided by standards-compliant XMLHttpRequest implementations, be sure any implementation you use meets that standard. | +| ~~`crossDomain?`~~ | `boolean` | Whether or not to send the HTTP request as a CORS request. Defaults to `false`. **Deprecated** Will be removed in version 8. Cross domain requests and what creates a cross domain request, are dictated by the browser, and a boolean that forces it to be cross domain does not make sense. If you need to force cross domain, make sure you're making a secure request, then add a custom header to the request or use `withCredentials`. For more information on what triggers a cross domain request, see the [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials). In particular, the section on [Simple Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Simple_requests) is useful for understanding when CORS will not be used. | +| `headers?` | `Readonly`\<`Record`\<`string`, `any`\>\> | The HTTP headers to apply. Note that, by default, RxJS will add the following headers under certain conditions: 1. If the `"content-type"` header is **NOT** set, and the `body` is [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData), a `"content-type"` of `"application/x-www-form-urlencoded; charset=UTF-8"` will be set automatically. 2. If the `"x-requested-with"` header is **NOT** set, and the `crossDomain` configuration property is **NOT** explicitly set to `true`, (meaning it is not a CORS request), a `"x-requested-with"` header with a value of `"XMLHttpRequest"` will be set automatically. This header is generally meaningless, and is set by libraries and frameworks using `XMLHttpRequest` to make HTTP requests. | +| `includeDownloadProgress?` | `boolean` | If `true`, will emit all download progress and load complete events as [AjaxResponse](../classes/AjaxResponse.md) from the observable. The final download event will also be emitted as a [AjaxResponse](../classes/AjaxResponse.md). If both this and [includeUploadProgress](#includeuploadprogress) are `false`, then only the [AjaxResponse](../classes/AjaxResponse.md) will be emitted from the resulting observable. | +| `includeUploadProgress?` | `boolean` | If `true`, will emit all upload progress and load complete events as [AjaxResponse](../classes/AjaxResponse.md) from the observable. The final download event will also be emitted as a [AjaxResponse](../classes/AjaxResponse.md). If both this and [AjaxConfig.includeDownloadProgress](#includedownloadprogress)} are `false`, then only the [AjaxResponse](../classes/AjaxResponse.md) will be emitted from the resulting observable. | +| `method?` | `string` | The HTTP Method to use for the request. Defaults to "GET". | +| `password?` | `string` | The user credentials password to send with the HTTP request | +| ~~`progressSubscriber?`~~ | [`PartialObserver`](../../rxjs/type-aliases/PartialObserver.md)\<`ProgressEvent`\<`EventTarget`\>\> | An observer for watching the upload progress of an HTTP request. Will emit progress events, and completes on the final upload load event, will error for any XHR error or timeout. This will **not** error for errored status codes. Rather, it will always _complete_ when the HTTP response comes back. **Deprecated** If you're looking for progress events, use [AjaxConfig.includeDownloadProgress](#includedownloadprogress)} and [includeUploadProgress](#includeuploadprogress) instead. Will be removed in v8. | +| `queryParams?` | \| `string` \| `URLSearchParams` \| `Record`\<`string`, `string` \| `number` \| `boolean` \| `string`[] \| `number`[] \| `boolean`[]\> \| \[`string`, `string` \| `number` \| `boolean` \| `string`[] \| `number`[] \| `boolean`[]\][] | Query string parameters to add to the URL in the request. This will require a polyfill for `URL` and `URLSearchParams` in Internet Explorer! Accepts either a query string, a `URLSearchParams` object, a dictionary of key/value pairs, or an array of key/value entry tuples. (Essentially, it takes anything that `new URLSearchParams` would normally take). If, for some reason you have a query string in the `url` argument, this will append to the query string in the url, but it will also overwrite the value of any keys that are an exact match. In other words, a url of `/test?a=1&b=2`, with queryParams of `{ b: 5, c: 6 }` will result in a url of roughly `/test?a=1&b=5&c=6`. | +| `responseType?` | `XMLHttpRequestResponseType` | Can be set to change the response type. Valid values are `"arraybuffer"`, `"blob"`, `"document"`, `"json"`, and `"text"`. Note that the type of `"document"` (such as an XML document) is ignored if the global context is not `Window`. Defaults to `"json"`. | +| `timeout?` | `number` | The time to wait before causing the underlying XMLHttpRequest to timeout. This is only honored if the `async` configuration setting is unset or set to `true`. Defaults to `0`, which is idiomatic for "never timeout". | +| `url` | `string` | The address of the resource to request via HTTP. | +| `user?` | `string` | The user credentials user name to send with the HTTP request | +| `withCredentials?` | `boolean` | To send user credentials in a CORS request, set to `true`. To exclude user credentials from a CORS request, _OR_ when cookies are to be ignored by the CORS response, set to `false`. Defaults to `false`. | +| `xsrfCookieName?` | `string` | The name of your site's XSRF cookie. | +| `xsrfHeaderName?` | `string` | The name of a custom header that you can use to send your XSRF cookie. | diff --git a/apps/rxjs.dev-next/docs/api/ajax/interfaces/AjaxRequest.md b/apps/rxjs.dev-next/docs/api/ajax/interfaces/AjaxRequest.md new file mode 100644 index 0000000000..4225ad406e --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/ajax/interfaces/AjaxRequest.md @@ -0,0 +1,28 @@ +[API](../../index.md) / [ajax](../index.md) / AjaxRequest + +# Interface: AjaxRequest + +> The object containing values RxJS used to make the HTTP request. + +## Description + +This is provided in [AjaxError](../classes/AjaxError.md) instances as the `request` +object. + +Defined in: [rxjs/src/internal/ajax/types.ts:20](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/ajax/types.ts#L20) + +## Properties + +| Property | Type | Description | +| ---------------------------------------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `async` | `boolean` | Whether or not the request was made asynchronously. | +| `body?` | `any` | The body to send over the HTTP request. | +| `crossDomain` | `boolean` | Whether or not the request was a CORS request. | +| `headers` | `Readonly`\<`Record`\<`string`, `any`\>\> | The headers sent over the HTTP request. | +| `method` | `string` | The HTTP method used to make the HTTP request. | +| `password?` | `string` | The user credentials password sent with the HTTP request. | +| `responseType` | `XMLHttpRequestResponseType` | The [`responseType`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseType) set before sending the request. | +| `timeout` | `number` | The timeout value used for the HTTP request. Note: this is only honored if the request is asynchronous (`async` is `true`). | +| `url` | `string` | The URL requested. | +| `user?` | `string` | The user credentials user name sent with the HTTP request. | +| `withCredentials` | `boolean` | Whether or not a CORS request was sent with credentials. If `false`, will also ignore cookies in the CORS response. | diff --git a/apps/rxjs.dev-next/docs/api/ajax/type-aliases/AjaxDirection.md b/apps/rxjs.dev-next/docs/api/ajax/type-aliases/AjaxDirection.md new file mode 100644 index 0000000000..c3efc1beef --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/ajax/type-aliases/AjaxDirection.md @@ -0,0 +1,19 @@ +[API](../../index.md) / [ajax](../index.md) / AjaxDirection + +# Type Alias: AjaxDirection + +## Description + +Valid Ajax direction types. Prefixes the event `type` in the +[AjaxResponse](../classes/AjaxResponse.md) object with "upload*" for events related +to uploading and "download*" for events related to downloading. + +```ts +type AjaxDirection = 'upload' | 'download'; +``` + +Defined in: [rxjs/src/internal/ajax/types.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/ajax/types.ts#L8) + +Valid Ajax direction types. Prefixes the event `type` in the +[AjaxResponse](../classes/AjaxResponse.md) object with "upload*" for events related +to uploading and "download*" for events related to downloading. diff --git a/apps/rxjs.dev-next/docs/api/ajax/variables/ajax.md b/apps/rxjs.dev-next/docs/api/ajax/variables/ajax.md new file mode 100644 index 0000000000..ede4db24a9 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/ajax/variables/ajax.md @@ -0,0 +1,108 @@ +[API](../../index.md) / [ajax](../index.md) / ajax + +# Variable: ajax + +> There is an ajax operator on the Rx object. + +## Description + +It creates an observable for an Ajax request with either a request object with +url, headers, etc or a string for a URL. + +```ts +const ajax: AjaxCreationMethod; +``` + +Defined in: [rxjs/src/internal/ajax/ajax.ts:268](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/ajax/ajax.ts#L268) + +## Example + +Using `ajax()` to fetch the response object that is being returned from API + +```ts +import { ajax } from 'rxjs/ajax'; +import { map, catchError, of } from 'rxjs'; + +const obs$ = ajax('https://api.github.com/users?per_page=5').pipe( + map((userResponse) => console.log('users: ', userResponse)), + catchError((error) => { + console.log('error: ', error); + return of(error); + }) +); + +obs$.subscribe({ + next: (value) => console.log(value), + error: (err) => console.log(err), +}); +``` + +Using `ajax.getJSON()` to fetch data from API + +```ts +import { ajax } from 'rxjs/ajax'; +import { map, catchError, of } from 'rxjs'; + +const obs$ = ajax.getJSON('https://api.github.com/users?per_page=5').pipe( + map((userResponse) => console.log('users: ', userResponse)), + catchError((error) => { + console.log('error: ', error); + return of(error); + }) +); + +obs$.subscribe({ + next: (value) => console.log(value), + error: (err) => console.log(err), +}); +``` + +Using `ajax()` with object as argument and method POST with a two seconds delay + +```ts +import { ajax } from 'rxjs/ajax'; +import { map, catchError, of } from 'rxjs'; + +const users = ajax({ + url: 'https://httpbin.org/delay/2', + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'rxjs-custom-header': 'Rxjs', + }, + body: { + rxjs: 'Hello World!', + }, +}).pipe( + map((response) => console.log('response: ', response)), + catchError((error) => { + console.log('error: ', error); + return of(error); + }) +); + +users.subscribe({ + next: (value) => console.log(value), + error: (err) => console.log(err), +}); +``` + +Using `ajax()` to fetch. An error object that is being returned from the request + +```ts +import { ajax } from 'rxjs/ajax'; +import { map, catchError, of } from 'rxjs'; + +const obs$ = ajax('https://api.github.com/404').pipe( + map((userResponse) => console.log('users: ', userResponse)), + catchError((error) => { + console.log('error: ', error); + return of(error); + }) +); + +obs$.subscribe({ + next: (value) => console.log(value), + error: (err) => console.log(err), +}); +``` diff --git a/apps/rxjs.dev-next/docs/api/fetch/functions/fromFetch.md b/apps/rxjs.dev-next/docs/api/fetch/functions/fromFetch.md new file mode 100644 index 0000000000..b3c83bea65 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/fetch/functions/fromFetch.md @@ -0,0 +1,140 @@ +[API](../../index.md) / [fetch](../index.md) / fromFetch + +# Function: fromFetch() + +> Uses [the Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to +> make an HTTP request. + +## Description + +:::warning +Parts of the fetch API are still experimental. `AbortController` is +required for this implementation to work and use cancellation appropriately. +::: + +Will automatically set up an internal [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) +in order to finalize the internal `fetch` when the subscription tears down. + +If a `signal` is provided via the `init` argument, it will behave like it usually does with +`fetch`. If the provided `signal` aborts, the error that `fetch` normally rejects with +in that scenario will be emitted as an error from the observable. + +## Examples + +### Basic use + +```ts +import { fromFetch } from 'rxjs/fetch'; +import { switchMap, of, catchError } from 'rxjs'; + +const data$ = fromFetch('https://api.github.com/users?per_page=5').pipe( + switchMap((response) => { + if (response.ok) { + // OK return data + return response.json(); + } else { + // Server is returning a status requiring the client to try something else. + return of({ error: true, message: `Error ${response.status}` }); + } + }), + catchError((err) => { + // Network or other error, handle appropriately + console.error(err); + return of({ error: true, message: err.message }); + }) +); + +data$.subscribe({ + next: (result) => console.log(result), + complete: () => console.log('done'), +}); +``` + +### Use with Chunked Transfer Encoding + +With HTTP responses that use [chunked transfer encoding](https://tools.ietf.org/html/rfc7230#section-3.3.1), +the promise returned by `fetch` will resolve as soon as the response's headers are +received. + +That means the `fromFetch` observable will emit a `Response` - and will +then complete - before the body is received. When one of the methods on the +`Response` - like `text()` or `json()` - is called, the returned promise will not +resolve until the entire body has been received. Unsubscribing from any observable +that uses the promise as an observable input will not abort the request. + +To facilitate aborting the retrieval of responses that use chunked transfer encoding, +a `selector` can be specified via the `init` parameter: + +```ts +import { of } from 'rxjs'; +import { fromFetch } from 'rxjs/fetch'; + +const data$ = fromFetch('https://api.github.com/users?per_page=5', { + selector: (response) => response.json(), +}); + +data$.subscribe({ + next: (result) => console.log(result), + complete: () => console.log('done'), +}); +``` + +## Parameters + +### `input` + +The resource you would like to fetch. Can be a url or a request object. + +### `initWithSelector` + +A configuration object for the fetch. [See MDN for more details](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters) + +## Returns + +`Observable` + +An Observable, that when subscribed to, performs an HTTP request using the native +function. The Subscription is tied to an for the fetch. + +## Call Signature + +```ts +function fromFetch<>( + input: string | Request, + init: RequestInit & { + selector: (response: Response) => ObservableInput; + } +): Observable; +``` + +Defined in: [rxjs/src/internal/observable/dom/fetch.ts:4](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/dom/fetch.ts#L4) + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | `string` \| `Request` | +| `init` | `RequestInit` & \{ `selector`: (`response`: `Response`) => [`ObservableInput`](../../rxjs/type-aliases/ObservableInput.md)\<`T`\>; \} | + +### Returns + +[`Observable`](../../rxjs/classes/Observable.md)\<`T`\> + +## Call Signature + +```ts +function fromFetch(input: string | Request, init?: RequestInit): Observable; +``` + +Defined in: [rxjs/src/internal/observable/dom/fetch.ts:11](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/dom/fetch.ts#L11) + +### Parameters + +| Parameter | Type | +| --------- | --------------------- | +| `input` | `string` \| `Request` | +| `init?` | `RequestInit` | + +### Returns + +[`Observable`](../../rxjs/classes/Observable.md)\<`Response`\> diff --git a/apps/rxjs.dev-next/docs/api/fetch/index.md b/apps/rxjs.dev-next/docs/api/fetch/index.md new file mode 100644 index 0000000000..bbe73eecb2 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/fetch/index.md @@ -0,0 +1,35 @@ +[API](../index.md) / fetch + +# fetch + +The module for the RxJS DOM Fetch API. + +This is exported separately from the RxJS core API to avoid bringing DOM types into Node.js projects. + +## Example + +```ts +import { fromFetch } from 'rxjs/fetch'; +import { switchMap, of, catchError } from 'rxjs'; + +const data$ = fromFetch('https://api.github.com/users?per_page=5').pipe( + switchMap((response) => { + if (response.ok) { + return response.json(); + } + }), + catchError((err) => { + console.error(err); + return of({ error: true, message: err.message }); + }) +); + +data$.subscribe((result) => console.log(result)); + +// Output: +// { name: 'John Doe', email: 'john.doe@example.com' } +``` + +## Functions + +- [fromFetch](functions/fromFetch.md) diff --git a/apps/rxjs.dev-next/docs/api/index.md b/apps/rxjs.dev-next/docs/api/index.md new file mode 100644 index 0000000000..faaffaa48f --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/index.md @@ -0,0 +1,83 @@ + + +# RxJS API Explorer + +## All Modules + +- [@rxjs/observable](@rxjs/observable/index.md) +- [ajax](ajax/index.md) +- [fetch](fetch/index.md) +- [operators](operators/index.md) +- [rxjs](rxjs/index.md) +- [testing](testing/index.md) +- [webSocket](webSocket/index.md) + +## Explorer + + + +### RxJS (index) + + + +### @rxjs/observable + + + +### Ajax + + + +### Fetch + + + +### Operators + + + +### Testing + + + +### Web Socket + + diff --git a/apps/rxjs.dev-next/docs/api/operators/functions/partition.md b/apps/rxjs.dev-next/docs/api/operators/functions/partition.md new file mode 100644 index 0000000000..243e1c3750 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/operators/functions/partition.md @@ -0,0 +1,70 @@ +[API](../../index.md) / [operators](../index.md) / partition + +# ~~Function: partition()~~ + +```ts +function partition<>( + predicate: (value: T, index: number) => boolean, + thisArg?: any +): UnaryFunction, [Observable, Observable]>; +``` + +Defined in: [rxjs/src/internal/operators/partition.ts:56](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/partition.ts#L56) + +Splits the source Observable into two, one with values that satisfy a +predicate, and another with values that don't satisfy the predicate. + +It's like [filter](../../rxjs/functions/filter.md), but returns two Observables: +one like the output of [filter](../../rxjs/functions/filter.md), and the other with values that did not +pass the condition. + +![](/images/marble-diagrams/partition.png) + +`partition` outputs an array with two Observables that partition the values +from the source Observable through the given `predicate` function. The first +Observable in that array emits source values for which the predicate argument +returns true. The second Observable emits source values for which the +predicate returns false. The first behaves like [filter](../../rxjs/functions/filter.md) and the second +behaves like [filter](../../rxjs/functions/filter.md) with the predicate negated. + +## Parameters + +| Parameter | Type | Description | +| ----------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `predicate` | (`value`: `T`, `index`: `number`) => `boolean` | A function that evaluates each value emitted by the source Observable. If it returns `true`, the value is emitted on the first Observable in the returned array, if `false` the value is emitted on the second Observable in the array. The `index` parameter is the number `i` for the i-th source emission that has happened since the subscription, starting from the number `0`. | +| `thisArg?` | `any` | An optional argument to determine the value of `this` in the `predicate` function. | + +## Returns + +[`UnaryFunction`](../../rxjs/interfaces/UnaryFunction.md)\<[`Observable`](../../rxjs/classes/Observable.md)\<`T`\>, \[[`Observable`](../../rxjs/classes/Observable.md)\<`T`\>, [`Observable`](../../rxjs/classes/Observable.md)\<`T`\>\]\> + +A function that returns an array with two Observables: one with +values that passed the predicate, and another with values that did not pass +the predicate. + +## Example + +Partition click events into those on DIV elements and those elsewhere + +```ts +import { fromEvent } from 'rxjs'; +import { partition } from 'rxjs/operators'; + +const div = document.createElement('div'); +div.style.cssText = 'width: 200px; height: 200px; background: #09c;'; +document.body.appendChild(div); + +const clicks = fromEvent(document, 'click'); +const [clicksOnDivs, clicksElsewhere] = clicks.pipe(partition((ev) => (ev.target).tagName === 'DIV')); + +clicksOnDivs.subscribe((x) => console.log('DIV clicked: ', x)); +clicksElsewhere.subscribe((x) => console.log('Other clicked: ', x)); +``` + +## See + +[filter](../../rxjs/functions/filter.md) + +## Deprecated + +Replaced with the partition static creation function. Will be removed in v8. diff --git a/apps/rxjs.dev-next/docs/api/operators/index.md b/apps/rxjs.dev-next/docs/api/operators/index.md new file mode 100644 index 0000000000..c5e1fce68e --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/operators/index.md @@ -0,0 +1,445 @@ +[API](../index.md) / operators + +# operators + +:::info +This module is available as a nested import; however all of its methods are re-exports and all documentation can be found within the [rxjs#functions](/api/rxjs#functions) section. +::: + +## Functions + +- [~~partition~~](functions/partition.md) + +## References + +### audit + +Re-exports [audit](../rxjs/functions/audit.md) + +### auditTime + +Re-exports [auditTime](../rxjs/functions/auditTime.md) + +### BasicGroupByOptions + +Re-exports [BasicGroupByOptions](../rxjs/interfaces/BasicGroupByOptions.md) + +### buffer + +Re-exports [buffer](../rxjs/functions/buffer.md) + +### bufferCount + +Re-exports [bufferCount](../rxjs/functions/bufferCount.md) + +### bufferTime + +Re-exports [bufferTime](../rxjs/functions/bufferTime.md) + +### bufferToggle + +Re-exports [bufferToggle](../rxjs/functions/bufferToggle.md) + +### bufferWhen + +Re-exports [bufferWhen](../rxjs/functions/bufferWhen.md) + +### catchError + +Re-exports [catchError](../rxjs/functions/catchError.md) + +### combineLatestAll + +Re-exports [combineLatestAll](../rxjs/functions/combineLatestAll.md) + +### combineLatestWith + +Re-exports [combineLatestWith](../rxjs/functions/combineLatestWith.md) + +### concatAll + +Re-exports [concatAll](../rxjs/functions/concatAll.md) + +### concatMap + +Re-exports [concatMap](../rxjs/functions/concatMap.md) + +### concatMapTo + +Re-exports [concatMapTo](../rxjs/functions/concatMapTo.md) + +### concatWith + +Re-exports [concatWith](../rxjs/functions/concatWith.md) + +### connect + +Re-exports [connect](../rxjs/functions/connect.md) + +### ConnectConfig + +Re-exports [ConnectConfig](../rxjs/interfaces/ConnectConfig.md) + +### count + +Re-exports [count](../rxjs/functions/count.md) + +### debounce + +Re-exports [debounce](../rxjs/functions/debounce.md) + +### debounceTime + +Re-exports [debounceTime](../rxjs/functions/debounceTime.md) + +### defaultIfEmpty + +Re-exports [defaultIfEmpty](../rxjs/functions/defaultIfEmpty.md) + +### delay + +Re-exports [delay](../rxjs/functions/delay.md) + +### delayWhen + +Re-exports [delayWhen](../rxjs/functions/delayWhen.md) + +### dematerialize + +Re-exports [dematerialize](../rxjs/functions/dematerialize.md) + +### distinct + +Re-exports [distinct](../rxjs/functions/distinct.md) + +### distinctUntilChanged + +Re-exports [distinctUntilChanged](../rxjs/functions/distinctUntilChanged.md) + +### distinctUntilKeyChanged + +Re-exports [distinctUntilKeyChanged](../rxjs/functions/distinctUntilKeyChanged.md) + +### elementAt + +Re-exports [elementAt](../rxjs/functions/elementAt.md) + +### endWith + +Re-exports [endWith](../rxjs/functions/endWith.md) + +### every + +Re-exports [every](../rxjs/functions/every.md) + +### exhaustAll + +Re-exports [exhaustAll](../rxjs/functions/exhaustAll.md) + +### exhaustMap + +Re-exports [exhaustMap](../rxjs/functions/exhaustMap.md) + +### expand + +Re-exports [expand](../rxjs/functions/expand.md) + +### filter + +Re-exports [filter](../rxjs/functions/filter.md) + +### finalize + +Re-exports [finalize](../rxjs/functions/finalize.md) + +### find + +Re-exports [find](../rxjs/functions/find.md) + +### findIndex + +Re-exports [findIndex](../rxjs/functions/findIndex.md) + +### first + +Re-exports [first](../rxjs/functions/first.md) + +### groupBy + +Re-exports [groupBy](../rxjs/functions/groupBy.md) + +### GroupByOptionsWithElement + +Re-exports [GroupByOptionsWithElement](../rxjs/interfaces/GroupByOptionsWithElement.md) + +### ignoreElements + +Re-exports [ignoreElements](../rxjs/functions/ignoreElements.md) + +### isEmpty + +Re-exports [isEmpty](../rxjs/functions/isEmpty.md) + +### last + +Re-exports [last](../rxjs/functions/last.md) + +### map + +Re-exports [map](../rxjs/functions/map.md) + +### mapTo + +Re-exports [mapTo](../rxjs/functions/mapTo.md) + +### materialize + +Re-exports [materialize](../rxjs/functions/materialize.md) + +### max + +Re-exports [max](../rxjs/functions/max.md) + +### mergeAll + +Re-exports [mergeAll](../rxjs/functions/mergeAll.md) + +### mergeMap + +Re-exports [mergeMap](../rxjs/functions/mergeMap.md) + +### mergeMapTo + +Re-exports [mergeMapTo](../rxjs/functions/mergeMapTo.md) + +### mergeScan + +Re-exports [mergeScan](../rxjs/functions/mergeScan.md) + +### mergeWith + +Re-exports [mergeWith](../rxjs/functions/mergeWith.md) + +### min + +Re-exports [min](../rxjs/functions/min.md) + +### observeOn + +Re-exports [observeOn](../rxjs/functions/observeOn.md) + +### onErrorResumeNextWith + +Re-exports [onErrorResumeNextWith](../rxjs/functions/onErrorResumeNextWith.md) + +### pairwise + +Re-exports [pairwise](../rxjs/functions/pairwise.md) + +### raceWith + +Re-exports [raceWith](../rxjs/functions/raceWith.md) + +### reduce + +Re-exports [reduce](../rxjs/functions/reduce.md) + +### repeat + +Re-exports [repeat](../rxjs/functions/repeat.md) + +### RepeatConfig + +Re-exports [RepeatConfig](../rxjs/interfaces/RepeatConfig.md) + +### repeatWhen + +Re-exports [repeatWhen](../rxjs/functions/repeatWhen.md) + +### retry + +Re-exports [retry](../rxjs/functions/retry.md) + +### RetryConfig + +Re-exports [RetryConfig](../rxjs/interfaces/RetryConfig.md) + +### retryWhen + +Re-exports [retryWhen](../rxjs/functions/retryWhen.md) + +### sample + +Re-exports [sample](../rxjs/functions/sample.md) + +### sampleTime + +Re-exports [sampleTime](../rxjs/functions/sampleTime.md) + +### scan + +Re-exports [scan](../rxjs/functions/scan.md) + +### sequenceEqual + +Re-exports [sequenceEqual](../rxjs/functions/sequenceEqual.md) + +### share + +Re-exports [share](../rxjs/functions/share.md) + +### ShareConfig + +Re-exports [ShareConfig](../rxjs/interfaces/ShareConfig.md) + +### shareReplay + +Re-exports [shareReplay](../rxjs/functions/shareReplay.md) + +### ShareReplayConfig + +Re-exports [ShareReplayConfig](../rxjs/interfaces/ShareReplayConfig.md) + +### single + +Re-exports [single](../rxjs/functions/single.md) + +### skip + +Re-exports [skip](../rxjs/functions/skip.md) + +### skipLast + +Re-exports [skipLast](../rxjs/functions/skipLast.md) + +### skipUntil + +Re-exports [skipUntil](../rxjs/functions/skipUntil.md) + +### skipWhile + +Re-exports [skipWhile](../rxjs/functions/skipWhile.md) + +### startWith + +Re-exports [startWith](../rxjs/functions/startWith.md) + +### subscribeOn + +Re-exports [subscribeOn](../rxjs/functions/subscribeOn.md) + +### switchAll + +Re-exports [switchAll](../rxjs/functions/switchAll.md) + +### switchMap + +Re-exports [switchMap](../rxjs/functions/switchMap.md) + +### switchMapTo + +Re-exports [switchMapTo](../rxjs/functions/switchMapTo.md) + +### switchScan + +Re-exports [switchScan](../rxjs/functions/switchScan.md) + +### take + +Re-exports [take](../rxjs/functions/take.md) + +### takeLast + +Re-exports [takeLast](../rxjs/functions/takeLast.md) + +### takeUntil + +Re-exports [takeUntil](../rxjs/functions/takeUntil.md) + +### takeWhile + +Re-exports [takeWhile](../rxjs/functions/takeWhile.md) + +### tap + +Re-exports [tap](../rxjs/functions/tap.md) + +### TapObserver + +Re-exports [TapObserver](../rxjs/interfaces/TapObserver.md) + +### throttle + +Re-exports [throttle](../rxjs/functions/throttle.md) + +### ThrottleConfig + +Re-exports [ThrottleConfig](../rxjs/interfaces/ThrottleConfig.md) + +### throttleTime + +Re-exports [throttleTime](../rxjs/functions/throttleTime.md) + +### throwIfEmpty + +Re-exports [throwIfEmpty](../rxjs/functions/throwIfEmpty.md) + +### timeInterval + +Re-exports [timeInterval](../rxjs/functions/timeInterval.md) + +### timeout + +Re-exports [timeout](../rxjs/functions/timeout.md) + +### TimeoutConfig + +Re-exports [TimeoutConfig](../rxjs/interfaces/TimeoutConfig.md) + +### TimeoutInfo + +Re-exports [TimeoutInfo](../rxjs/interfaces/TimeoutInfo.md) + +### timeoutWith + +Re-exports [timeoutWith](../rxjs/functions/timeoutWith.md) + +### timestamp + +Re-exports [timestamp](../rxjs/functions/timestamp.md) + +### toArray + +Re-exports [toArray](../rxjs/functions/toArray.md) + +### window + +Re-exports [window](../rxjs/functions/window.md) + +### windowCount + +Re-exports [windowCount](../rxjs/functions/windowCount.md) + +### windowTime + +Re-exports [windowTime](../rxjs/functions/windowTime.md) + +### windowToggle + +Re-exports [windowToggle](../rxjs/functions/windowToggle.md) + +### windowWhen + +Re-exports [windowWhen](../rxjs/functions/windowWhen.md) + +### withLatestFrom + +Re-exports [withLatestFrom](../rxjs/functions/withLatestFrom.md) + +### zipAll + +Re-exports [zipAll](../rxjs/functions/zipAll.md) + +### zipWith + +Re-exports [zipWith](../rxjs/functions/zipWith.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/ArgumentOutOfRangeError.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/ArgumentOutOfRangeError.md new file mode 100644 index 0000000000..b4c39f95e6 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/ArgumentOutOfRangeError.md @@ -0,0 +1,48 @@ +[API](../../index.md) / [rxjs](../index.md) / ArgumentOutOfRangeError + +# Class: ArgumentOutOfRangeError + +## Description + +An error thrown when an element was queried at a certain index of an +Observable, but no such index or position exists in that sequence. + +Defined in: [rxjs/src/internal/util/ArgumentOutOfRangeError.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/ArgumentOutOfRangeError.ts#L9) + +An error thrown when an element was queried at a certain index of an +Observable, but no such index or position exists in that sequence. + +## See + +- [elementAt](../functions/elementAt.md) +- [take](../functions/take.md) +- [takeLast](../functions/takeLast.md) + +## Extends + +- `Error` + +## Constructors + +### Constructor + +```ts +new ArgumentOutOfRangeError(): ArgumentOutOfRangeError; +``` + +Defined in: [rxjs/src/internal/util/ArgumentOutOfRangeError.ts:14](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/ArgumentOutOfRangeError.ts#L14) + +#### Returns + +`ArgumentOutOfRangeError` + +#### Deprecated + +Internal implementation detail. Do not construct error instances. +Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 + +#### Overrides + +```ts +Error.constructor; +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/AsyncSubject.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/AsyncSubject.md new file mode 100644 index 0000000000..dadb1a1946 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/AsyncSubject.md @@ -0,0 +1,755 @@ +[API](../../index.md) / [rxjs](../index.md) / AsyncSubject + +# Class: AsyncSubject + +## Description + +A variant of Subject that only emits a value when it completes. It will emit +its latest value to all its observers on completion. + +Defined in: [rxjs/src/internal/AsyncSubject.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/AsyncSubject.ts#L8) + +A variant of Subject that only emits a value when it completes. It will emit +its latest value to all its observers on completion. + +## Extends + +- [`Subject`](Subject.md)\<`T`\> + +## Constructors + +### Constructor + +```ts +new AsyncSubject<>(): AsyncSubject; +``` + +Defined in: [rxjs/src/internal/Subject.ts:44](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L44) + +#### Returns + +`AsyncSubject`\<`T`\> + +#### Inherited from + +[`Subject`](Subject.md).[`constructor`](Subject.md#constructor) + +## Properties + +| Property | Type | Default value | Description | Inherited from | +| ------------------------------------------ | --------- | ------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------- | +| ~~`hasError`~~ | `boolean` | `false` | **Deprecated** Internal implementation detail, do not use directly. Will be made internal in v8. | [`Subject`](Subject.md).[`hasError`](Subject.md#haserror) | +| ~~`thrownError`~~ | `any` | `null` | **Deprecated** Internal implementation detail, do not use directly. Will be made internal in v8. | [`Subject`](Subject.md).[`thrownError`](Subject.md#thrownerror) | + +## Accessors + +### closed + +#### Get Signature + +```ts +get closed(): boolean; +``` + +Defined in: [rxjs/src/internal/Subject.ts:19](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L19) + +Will return true if this subject has been closed and is no longer accepting new values. + +##### Returns + +`boolean` + +#### Inherited from + +[`Subject`](Subject.md).[`closed`](Subject.md#closed) + +### observed + +#### Get Signature + +```ts +get observed(): boolean; +``` + +Defined in: [rxjs/src/internal/Subject.ts:94](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L94) + +##### Returns + +`boolean` + +#### Inherited from + +[`Subject`](Subject.md).[`observed`](Subject.md#observed) + +## Methods + +### \[asyncIterator\]() + +```ts +asyncIterator: AsyncGenerator; +``` + +Defined in: [observable/src/observable.ts:922](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L922) + +Observable is async iterable, so it can be used in `for await` loop. This method +of subscription is cancellable by breaking the for await loop. Although it's not +recommended to use Observable's AsyncIterable contract outside of `for await`, if +you're consuming the Observable as an AsyncIterable, and you're _not_ using `for await`, +you can use the `throw` or `return` methods on the `AsyncGenerator` we return to +cancel the subscription. Note that the subscription to the observable does not start +until the first value is requested from the AsyncIterable. + +Functionally, this is equivalent to using a [concatMap](../functions/concatMap.md) with an `async` function. +That means that while the body of the `for await` loop is executing, any values that arrive +from the observable source will be queued up, so they can be processed by the `for await` +loop in order. So, like [concatMap](../functions/concatMap.md) it's important to understand the speed your +source emits at, and the speed of the body of your `for await` loop. + +#### Returns + +`AsyncGenerator`\<`T`, `void`, `void`\> + +#### Example + +```ts +import { interval } from 'rxjs'; + +async function main() { + // Subscribe to the observable using for await. + for await (const value of interval(1000)) { + console.log(value); + + if (value > 5) { + // Unsubscribe from the interval if we get a value greater than 5 + break; + } + } +} + +main(); +``` + +#### Inherited from + +[`Subject`](Subject.md).[`[asyncIterator]`](Subject.md#asynciterator) + +### asObservable() + +```ts +asObservable(): Observable; +``` + +Defined in: [rxjs/src/internal/Subject.ts:137](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L137) + +Creates a new Observable with this Subject as the source. You can do this +to create custom Observer-side logic of the Subject and conceal it from +code that uses the Observable. + +#### Returns + +[`Observable`](Observable.md)\<`T`\> + +Observable that this Subject casts to. + +#### Inherited from + +[`Subject`](Subject.md).[`asObservable`](Subject.md#asobservable) + +### complete() + +```ts +complete(): void; +``` + +Defined in: [rxjs/src/internal/AsyncSubject.ts:31](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/AsyncSubject.ts#L31) + +#### Returns + +`void` + +#### Overrides + +[`Subject`](Subject.md).[`complete`](Subject.md#complete) + +### error() + +```ts +error(err: any): void; +``` + +Defined in: [rxjs/src/internal/Subject.ts:64](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L64) + +#### Parameters + +| Parameter | Type | +| --------- | ----- | +| `err` | `any` | + +#### Returns + +`void` + +#### Inherited from + +[`Subject`](Subject.md).[`error`](Subject.md#error) + +### forEach() + +```ts +forEach(next: (value: T) => void): Promise; +``` + +Defined in: [observable/src/observable.ts:757](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L757) + +Used as a NON-CANCELLABLE means of subscribing to an observable, for use with +APIs that expect promises, like `async/await`. You cannot unsubscribe from this. + +**WARNING**: Only use this with observables you _know_ will complete. If the source +observable does not complete, you will end up with a promise that is hung up, and +potentially all of the state of an async function hanging out in memory. To avoid +this situation, look into adding something like [timeout](../functions/timeout.md), [take](../functions/take.md), +[takeWhile](../functions/takeWhile.md), or [takeUntil](../functions/takeUntil.md) amongst others. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ------------------------ | --------------------------------------------------- | +| `next` | (`value`: `T`) => `void` | A handler for each value emitted by the observable. | + +#### Returns + +`Promise`\<`void`\> + +A promise that either resolves on observable completion or +rejects with the handled error. + +#### Example + +```ts +import { interval, take } from 'rxjs'; + +const source$ = interval(1000).pipe(take(4)); + +async function getTotal() { + let total = 0; + + await source$.forEach((value) => { + total += value; + console.log('observable -> ' + value); + }); + + return total; +} + +getTotal().then((total) => console.log('Total: ' + total)); + +// Expected: +// 'observable -> 0' +// 'observable -> 1' +// 'observable -> 2' +// 'observable -> 3' +// 'Total: 6' +``` + +#### Inherited from + +[`Subject`](Subject.md).[`forEach`](Subject.md#foreach) + +### next() + +```ts +next(value: T): void; +``` + +Defined in: [rxjs/src/internal/AsyncSubject.ts:24](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/AsyncSubject.ts#L24) + +#### Parameters + +| Parameter | Type | +| --------- | ---- | +| `value` | `T` | + +#### Returns + +`void` + +#### Overrides + +[`Subject`](Subject.md).[`next`](Subject.md#next) + +### pipe() + +Used to stitch together functional operators into a chain. + +#### Example + +```ts +import { interval, filter, map, scan } from 'rxjs'; + +interval(1000) + .pipe( + filter((x) => x % 2 === 0), + map((x) => x + x), + scan((acc, x) => acc + x) + ) + .subscribe((x) => console.log(x)); +``` + +#### Call Signature + +```ts +pipe(): Observable; +``` + +Defined in: [observable/src/observable.ts:788](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L788) + +##### Returns + +[`Observable`](Observable.md)\<`T`\> + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>): A; +``` + +Defined in: [observable/src/observable.ts:789](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L789) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | + +##### Returns + +`A` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>, op2: UnaryFunction): B; +``` + +Defined in: [observable/src/observable.ts:790](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L790) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | + +##### Returns + +`B` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction): C; +``` + +Defined in: [observable/src/observable.ts:791](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L791) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | + +##### Returns + +`C` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction): D; +``` + +Defined in: [observable/src/observable.ts:792](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L792) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | + +##### Returns + +`D` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction): E; +``` + +Defined in: [observable/src/observable.ts:793](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L793) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | + +##### Returns + +`E` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction): F; +``` + +Defined in: [observable/src/observable.ts:800](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L800) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | + +##### Returns + +`F` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction): G; +``` + +Defined in: [observable/src/observable.ts:808](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L808) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | + +##### Returns + +`G` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction): H; +``` + +Defined in: [observable/src/observable.ts:817](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L817) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | + +##### Returns + +`H` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction): I; +``` + +Defined in: [observable/src/observable.ts:827](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L827) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | + +##### Returns + +`I` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... +operations: OperatorFunction[]): Observable; +``` + +Defined in: [observable/src/observable.ts:838](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L838) + +##### Parameters + +| Parameter | Type | +| --------------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `OperatorFunction`\<`any`, `any`\>[] | + +##### Returns + +[`Observable`](Observable.md)\<`unknown`\> + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... + operations: UnaryFunction[]): unknown; +``` + +Defined in: [observable/src/observable.ts:850](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L850) + +##### Parameters + +| Parameter | Type | +| --------------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `UnaryFunction`\<`any`, `any`\>[] | + +##### Returns + +`unknown` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +### subscribe() + +```ts +subscribe(observerOrNext?: Partial> | (value: T) => void | null): Subscription; +``` + +Defined in: [observable/src/observable.ts:695](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L695) + +Invokes an execution of an Observable and registers Observer handlers for notifications it will emit. + +Use it when you have all these Observables, but still nothing is happening. + +`subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It +might be for example a function that you passed to Observable's constructor, but most of the time it is +a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means +that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often +the thought. + +Apart from starting the execution of an Observable, this method allows you to listen for values +that an Observable emits, as well as for when it completes or errors. You can achieve this in two +of the following ways. + +The first way is creating an object that implements [Observer](../interfaces/Observer.md) interface. It should have methods +defined by that interface, but note that it should be just a regular JavaScript object, which you can create +yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do +not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also +that your object does not have to implement all methods. If you find yourself creating a method that doesn't +do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens, +it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead, +use the [onUnhandledError](../interfaces/GlobalConfig.md#onunhandlederror) configuration option or use a runtime handler (like `window.onerror` or +`process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide +an `error` method to avoid missing thrown errors. + +The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods. +This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent +of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer, +if you do not need to listen for something, you can omit a function by passing `undefined` or `null`, +since `subscribe` recognizes these functions by where they were placed in function call. When it comes +to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously. + +You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events +and you also handled emissions internally by using operators (e.g. using `tap`). + +Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object. +This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean +up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback +provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable. + +Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously. +It is an Observable itself that decides when these functions will be called. For example [of](../functions/of.md) +by default emits all its values synchronously. Always check documentation for how given Observable +will behave when subscribed and if its default behavior can be modified with a `scheduler`. + +#### Parameters + +| Parameter | Type | Description | +| ----------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `observerOrNext?` | `Partial`\<`Observer`\<`T`\>\> \| (`value`: `T`) => `void` \| `null` | Either an [Observer](../interfaces/Observer.md) with some or all callback methods, or the `next` handler that is called for each value emitted from the subscribed Observable. | + +#### Returns + +[`Subscription`](Subscription.md) + +A subscription reference to the registered handlers. + +#### Inherited from + +[`Subject`](Subject.md).[`subscribe`](Subject.md#subscribe) + +### unsubscribe() + +```ts +unsubscribe(): void; +``` + +Defined in: [rxjs/src/internal/Subject.ts:89](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L89) + +#### Returns + +`void` + +#### Inherited from + +[`Subject`](Subject.md).[`unsubscribe`](Subject.md#unsubscribe) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/BehaviorSubject.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/BehaviorSubject.md new file mode 100644 index 0000000000..0e374a294b --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/BehaviorSubject.md @@ -0,0 +1,787 @@ +[API](../../index.md) / [rxjs](../index.md) / BehaviorSubject + +# Class: BehaviorSubject + +## Description + +A variant of Subject that requires an initial value and emits its current +value whenever it is subscribed to. + +Defined in: [rxjs/src/internal/BehaviorSubject.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/BehaviorSubject.ts#L8) + +A variant of Subject that requires an initial value and emits its current +value whenever it is subscribed to. + +## Extends + +- [`Subject`](Subject.md)\<`T`\> + +## Constructors + +### Constructor + +```ts +new BehaviorSubject<>(_value: T): BehaviorSubject; +``` + +Defined in: [rxjs/src/internal/BehaviorSubject.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/BehaviorSubject.ts#L9) + +#### Parameters + +| Parameter | Type | +| --------- | ---- | +| `_value` | `T` | + +#### Returns + +`BehaviorSubject`\<`T`\> + +#### Overrides + +[`Subject`](Subject.md).[`constructor`](Subject.md#constructor) + +## Properties + +| Property | Type | Default value | Description | Inherited from | +| ------------------------------------------ | --------- | ------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------- | +| ~~`hasError`~~ | `boolean` | `false` | **Deprecated** Internal implementation detail, do not use directly. Will be made internal in v8. | [`Subject`](Subject.md).[`hasError`](Subject.md#haserror) | +| ~~`thrownError`~~ | `any` | `null` | **Deprecated** Internal implementation detail, do not use directly. Will be made internal in v8. | [`Subject`](Subject.md).[`thrownError`](Subject.md#thrownerror) | + +## Accessors + +### closed + +#### Get Signature + +```ts +get closed(): boolean; +``` + +Defined in: [rxjs/src/internal/Subject.ts:19](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L19) + +Will return true if this subject has been closed and is no longer accepting new values. + +##### Returns + +`boolean` + +#### Inherited from + +[`Subject`](Subject.md).[`closed`](Subject.md#closed) + +### observed + +#### Get Signature + +```ts +get observed(): boolean; +``` + +Defined in: [rxjs/src/internal/Subject.ts:94](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L94) + +##### Returns + +`boolean` + +#### Inherited from + +[`Subject`](Subject.md).[`observed`](Subject.md#observed) + +### value + +#### Get Signature + +```ts +get value(): T; +``` + +Defined in: [rxjs/src/internal/BehaviorSubject.ts:13](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/BehaviorSubject.ts#L13) + +##### Returns + +`T` + +## Methods + +### \[asyncIterator\]() + +```ts +asyncIterator: AsyncGenerator; +``` + +Defined in: [observable/src/observable.ts:922](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L922) + +Observable is async iterable, so it can be used in `for await` loop. This method +of subscription is cancellable by breaking the for await loop. Although it's not +recommended to use Observable's AsyncIterable contract outside of `for await`, if +you're consuming the Observable as an AsyncIterable, and you're _not_ using `for await`, +you can use the `throw` or `return` methods on the `AsyncGenerator` we return to +cancel the subscription. Note that the subscription to the observable does not start +until the first value is requested from the AsyncIterable. + +Functionally, this is equivalent to using a [concatMap](../functions/concatMap.md) with an `async` function. +That means that while the body of the `for await` loop is executing, any values that arrive +from the observable source will be queued up, so they can be processed by the `for await` +loop in order. So, like [concatMap](../functions/concatMap.md) it's important to understand the speed your +source emits at, and the speed of the body of your `for await` loop. + +#### Returns + +`AsyncGenerator`\<`T`, `void`, `void`\> + +#### Example + +```ts +import { interval } from 'rxjs'; + +async function main() { + // Subscribe to the observable using for await. + for await (const value of interval(1000)) { + console.log(value); + + if (value > 5) { + // Unsubscribe from the interval if we get a value greater than 5 + break; + } + } +} + +main(); +``` + +#### Inherited from + +[`Subject`](Subject.md).[`[asyncIterator]`](Subject.md#asynciterator) + +### asObservable() + +```ts +asObservable(): Observable; +``` + +Defined in: [rxjs/src/internal/Subject.ts:137](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L137) + +Creates a new Observable with this Subject as the source. You can do this +to create custom Observer-side logic of the Subject and conceal it from +code that uses the Observable. + +#### Returns + +[`Observable`](Observable.md)\<`T`\> + +Observable that this Subject casts to. + +#### Inherited from + +[`Subject`](Subject.md).[`asObservable`](Subject.md#asobservable) + +### complete() + +```ts +complete(): void; +``` + +Defined in: [rxjs/src/internal/Subject.ts:77](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L77) + +#### Returns + +`void` + +#### Inherited from + +[`Subject`](Subject.md).[`complete`](Subject.md#complete) + +### error() + +```ts +error(err: any): void; +``` + +Defined in: [rxjs/src/internal/Subject.ts:64](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L64) + +#### Parameters + +| Parameter | Type | +| --------- | ----- | +| `err` | `any` | + +#### Returns + +`void` + +#### Inherited from + +[`Subject`](Subject.md).[`error`](Subject.md#error) + +### forEach() + +```ts +forEach(next: (value: T) => void): Promise; +``` + +Defined in: [observable/src/observable.ts:757](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L757) + +Used as a NON-CANCELLABLE means of subscribing to an observable, for use with +APIs that expect promises, like `async/await`. You cannot unsubscribe from this. + +**WARNING**: Only use this with observables you _know_ will complete. If the source +observable does not complete, you will end up with a promise that is hung up, and +potentially all of the state of an async function hanging out in memory. To avoid +this situation, look into adding something like [timeout](../functions/timeout.md), [take](../functions/take.md), +[takeWhile](../functions/takeWhile.md), or [takeUntil](../functions/takeUntil.md) amongst others. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ------------------------ | --------------------------------------------------- | +| `next` | (`value`: `T`) => `void` | A handler for each value emitted by the observable. | + +#### Returns + +`Promise`\<`void`\> + +A promise that either resolves on observable completion or +rejects with the handled error. + +#### Example + +```ts +import { interval, take } from 'rxjs'; + +const source$ = interval(1000).pipe(take(4)); + +async function getTotal() { + let total = 0; + + await source$.forEach((value) => { + total += value; + console.log('observable -> ' + value); + }); + + return total; +} + +getTotal().then((total) => console.log('Total: ' + total)); + +// Expected: +// 'observable -> 0' +// 'observable -> 1' +// 'observable -> 2' +// 'observable -> 3' +// 'Total: 6' +``` + +#### Inherited from + +[`Subject`](Subject.md).[`forEach`](Subject.md#foreach) + +### getValue() + +```ts +getValue(): T; +``` + +Defined in: [rxjs/src/internal/BehaviorSubject.ts:24](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/BehaviorSubject.ts#L24) + +#### Returns + +`T` + +### next() + +```ts +next(value: T): void; +``` + +Defined in: [rxjs/src/internal/BehaviorSubject.ts:32](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/BehaviorSubject.ts#L32) + +#### Parameters + +| Parameter | Type | +| --------- | ---- | +| `value` | `T` | + +#### Returns + +`void` + +#### Overrides + +[`Subject`](Subject.md).[`next`](Subject.md#next) + +### pipe() + +Used to stitch together functional operators into a chain. + +#### Example + +```ts +import { interval, filter, map, scan } from 'rxjs'; + +interval(1000) + .pipe( + filter((x) => x % 2 === 0), + map((x) => x + x), + scan((acc, x) => acc + x) + ) + .subscribe((x) => console.log(x)); +``` + +#### Call Signature + +```ts +pipe(): Observable; +``` + +Defined in: [observable/src/observable.ts:788](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L788) + +##### Returns + +[`Observable`](Observable.md)\<`T`\> + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>): A; +``` + +Defined in: [observable/src/observable.ts:789](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L789) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | + +##### Returns + +`A` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>, op2: UnaryFunction): B; +``` + +Defined in: [observable/src/observable.ts:790](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L790) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | + +##### Returns + +`B` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction): C; +``` + +Defined in: [observable/src/observable.ts:791](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L791) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | + +##### Returns + +`C` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction): D; +``` + +Defined in: [observable/src/observable.ts:792](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L792) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | + +##### Returns + +`D` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction): E; +``` + +Defined in: [observable/src/observable.ts:793](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L793) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | + +##### Returns + +`E` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction): F; +``` + +Defined in: [observable/src/observable.ts:800](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L800) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | + +##### Returns + +`F` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction): G; +``` + +Defined in: [observable/src/observable.ts:808](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L808) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | + +##### Returns + +`G` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction): H; +``` + +Defined in: [observable/src/observable.ts:817](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L817) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | + +##### Returns + +`H` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction): I; +``` + +Defined in: [observable/src/observable.ts:827](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L827) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | + +##### Returns + +`I` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... +operations: OperatorFunction[]): Observable; +``` + +Defined in: [observable/src/observable.ts:838](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L838) + +##### Parameters + +| Parameter | Type | +| --------------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `OperatorFunction`\<`any`, `any`\>[] | + +##### Returns + +[`Observable`](Observable.md)\<`unknown`\> + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... + operations: UnaryFunction[]): unknown; +``` + +Defined in: [observable/src/observable.ts:850](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L850) + +##### Parameters + +| Parameter | Type | +| --------------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `UnaryFunction`\<`any`, `any`\>[] | + +##### Returns + +`unknown` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +### subscribe() + +```ts +subscribe(observerOrNext?: Partial> | (value: T) => void | null): Subscription; +``` + +Defined in: [observable/src/observable.ts:695](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L695) + +Invokes an execution of an Observable and registers Observer handlers for notifications it will emit. + +Use it when you have all these Observables, but still nothing is happening. + +`subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It +might be for example a function that you passed to Observable's constructor, but most of the time it is +a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means +that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often +the thought. + +Apart from starting the execution of an Observable, this method allows you to listen for values +that an Observable emits, as well as for when it completes or errors. You can achieve this in two +of the following ways. + +The first way is creating an object that implements [Observer](../interfaces/Observer.md) interface. It should have methods +defined by that interface, but note that it should be just a regular JavaScript object, which you can create +yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do +not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also +that your object does not have to implement all methods. If you find yourself creating a method that doesn't +do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens, +it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead, +use the [onUnhandledError](../interfaces/GlobalConfig.md#onunhandlederror) configuration option or use a runtime handler (like `window.onerror` or +`process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide +an `error` method to avoid missing thrown errors. + +The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods. +This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent +of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer, +if you do not need to listen for something, you can omit a function by passing `undefined` or `null`, +since `subscribe` recognizes these functions by where they were placed in function call. When it comes +to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously. + +You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events +and you also handled emissions internally by using operators (e.g. using `tap`). + +Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object. +This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean +up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback +provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable. + +Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously. +It is an Observable itself that decides when these functions will be called. For example [of](../functions/of.md) +by default emits all its values synchronously. Always check documentation for how given Observable +will behave when subscribed and if its default behavior can be modified with a `scheduler`. + +#### Parameters + +| Parameter | Type | Description | +| ----------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `observerOrNext?` | `Partial`\<`Observer`\<`T`\>\> \| (`value`: `T`) => `void` \| `null` | Either an [Observer](../interfaces/Observer.md) with some or all callback methods, or the `next` handler that is called for each value emitted from the subscribed Observable. | + +#### Returns + +[`Subscription`](Subscription.md) + +A subscription reference to the registered handlers. + +#### Inherited from + +[`Subject`](Subject.md).[`subscribe`](Subject.md#subscribe) + +### unsubscribe() + +```ts +unsubscribe(): void; +``` + +Defined in: [rxjs/src/internal/Subject.ts:89](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L89) + +#### Returns + +`void` + +#### Inherited from + +[`Subject`](Subject.md).[`unsubscribe`](Subject.md#unsubscribe) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/EmptyError.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/EmptyError.md new file mode 100644 index 0000000000..493c51e493 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/EmptyError.md @@ -0,0 +1,50 @@ +[API](../../index.md) / [rxjs](../index.md) / EmptyError + +# Class: EmptyError + +## Description + +An error thrown when an Observable or a sequence was queried but has no +elements. + +Defined in: [rxjs/src/internal/util/EmptyError.ts:11](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/EmptyError.ts#L11) + +An error thrown when an Observable or a sequence was queried but has no +elements. + +## See + +- [first](../functions/first.md) +- [last](../functions/last.md) +- [single](../functions/single.md) +- [firstValueFrom](../functions/firstValueFrom.md) +- [lastValueFrom](../functions/lastValueFrom.md) + +## Extends + +- `Error` + +## Constructors + +### Constructor + +```ts +new EmptyError(): EmptyError; +``` + +Defined in: [rxjs/src/internal/util/EmptyError.ts:16](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/EmptyError.ts#L16) + +#### Returns + +`EmptyError` + +#### Deprecated + +Internal implementation detail. Do not construct error instances. +Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 + +#### Overrides + +```ts +Error.constructor; +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/NotFoundError.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/NotFoundError.md new file mode 100644 index 0000000000..6dd31e221b --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/NotFoundError.md @@ -0,0 +1,52 @@ +[API](../../index.md) / [rxjs](../index.md) / NotFoundError + +# Class: NotFoundError + +## Description + +An error thrown when a value or values are missing from an +observable sequence. + +Defined in: [rxjs/src/internal/util/NotFoundError.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/NotFoundError.ts#L7) + +An error thrown when a value or values are missing from an +observable sequence. + +## See + +[single](../functions/single.md) + +## Extends + +- `Error` + +## Constructors + +### Constructor + +```ts +new NotFoundError(message: string): NotFoundError; +``` + +Defined in: [rxjs/src/internal/util/NotFoundError.ts:12](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/NotFoundError.ts#L12) + +#### Parameters + +| Parameter | Type | +| --------- | -------- | +| `message` | `string` | + +#### Returns + +`NotFoundError` + +#### Deprecated + +Internal implementation detail. Do not construct error instances. +Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 + +#### Overrides + +```ts +Error.constructor; +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/Observable.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/Observable.md new file mode 100644 index 0000000000..28307ab05f --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/Observable.md @@ -0,0 +1,646 @@ +[API](../../index.md) / [rxjs](../index.md) / Observable + +# Class: Observable + +## Description + +A representation of any set of values over any amount of time. This is the most basic building block +of RxJS. + +Defined in: [observable/src/observable.ts:632](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L632) + +A representation of any set of values over any amount of time. This is the most basic building block +of RxJS. + +## Example + +Subscribe with an [Observer](https://rxjs.dev/guide/observer) + +```ts +import { of } from 'rxjs'; + +const sumObserver = { + sum: 0, + next(value) { + console.log('Adding: ' + value); + this.sum = this.sum + value; + }, + error() { + // We actually could just remove this method, + // since we do not really care about errors right now. + }, + complete() { + console.log('Sum equals: ' + this.sum); + }, +}; + +of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes. + .subscribe(sumObserver); + +// Logs: +// 'Adding: 1' +// 'Adding: 2' +// 'Adding: 3' +// 'Sum equals: 6' +``` + +Subscribe with functions ([deprecated](https://rxjs.dev/deprecations/subscribe-arguments)) + +```ts +import { of } from 'rxjs'; + +let sum = 0; + +of(1, 2, 3).subscribe( + (value) => { + console.log('Adding: ' + value); + sum = sum + value; + }, + undefined, + () => console.log('Sum equals: ' + sum) +); + +// Logs: +// 'Adding: 1' +// 'Adding: 2' +// 'Adding: 3' +// 'Sum equals: 6' +``` + +Cancel a subscription + +```ts +import { interval } from 'rxjs'; + +const subscription = interval(1000).subscribe({ + next(num) { + console.log(num); + }, + complete() { + // Will not be called, even when cancelling subscription. + console.log('completed!'); + }, +}); + +setTimeout(() => { + subscription.unsubscribe(); + console.log('unsubscribed!'); +}, 2500); + +// Logs: +// 0 after 1s +// 1 after 2s +// 'unsubscribed!' after 2.5s +``` + +## Extended by + +- [`Connectable`](../interfaces/Connectable.md) +- [`GroupedObservable`](../interfaces/GroupedObservable.md) +- [`Subject`](Subject.md) +- [`WebSocketSubject`](../../webSocket/classes/WebSocketSubject.md) + +## Implements + +- `Subscribable`\<`T`\> + +## Constructors + +### Constructor + +```ts +new Observable<>(subscribe?: (this: Observable, subscriber: Subscriber) => TeardownLogic): Observable; +``` + +Defined in: [observable/src/observable.ts:639](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L639) + +#### Parameters + +| Parameter | Type | Description | +| ------------ | ---------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `subscribe?` | (`this`: `Observable`\<`T`\>, `subscriber`: [`Subscriber`](Subscriber.md)\<`T`\>) => `TeardownLogic` | The function that is called when the Observable is initially subscribed to. This function is given a Subscriber, to which new values can be `next`ed, or an `error` method can be called to raise an error, or `complete` can be called to notify of a successful completion. | + +#### Returns + +`Observable`\<`T`\> + +## Methods + +### \[asyncIterator\]() + +```ts +asyncIterator: AsyncGenerator; +``` + +Defined in: [observable/src/observable.ts:922](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L922) + +Observable is async iterable, so it can be used in `for await` loop. This method +of subscription is cancellable by breaking the for await loop. Although it's not +recommended to use Observable's AsyncIterable contract outside of `for await`, if +you're consuming the Observable as an AsyncIterable, and you're _not_ using `for await`, +you can use the `throw` or `return` methods on the `AsyncGenerator` we return to +cancel the subscription. Note that the subscription to the observable does not start +until the first value is requested from the AsyncIterable. + +Functionally, this is equivalent to using a [concatMap](../functions/concatMap.md) with an `async` function. +That means that while the body of the `for await` loop is executing, any values that arrive +from the observable source will be queued up, so they can be processed by the `for await` +loop in order. So, like [concatMap](../functions/concatMap.md) it's important to understand the speed your +source emits at, and the speed of the body of your `for await` loop. + +#### Returns + +`AsyncGenerator`\<`T`, `void`, `void`\> + +#### Example + +```ts +import { interval } from 'rxjs'; + +async function main() { + // Subscribe to the observable using for await. + for await (const value of interval(1000)) { + console.log(value); + + if (value > 5) { + // Unsubscribe from the interval if we get a value greater than 5 + break; + } + } +} + +main(); +``` + +### forEach() + +```ts +forEach(next: (value: T) => void): Promise; +``` + +Defined in: [observable/src/observable.ts:757](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L757) + +Used as a NON-CANCELLABLE means of subscribing to an observable, for use with +APIs that expect promises, like `async/await`. You cannot unsubscribe from this. + +**WARNING**: Only use this with observables you _know_ will complete. If the source +observable does not complete, you will end up with a promise that is hung up, and +potentially all of the state of an async function hanging out in memory. To avoid +this situation, look into adding something like [timeout](../functions/timeout.md), [take](../functions/take.md), +[takeWhile](../functions/takeWhile.md), or [takeUntil](../functions/takeUntil.md) amongst others. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ------------------------ | --------------------------------------------------- | +| `next` | (`value`: `T`) => `void` | A handler for each value emitted by the observable. | + +#### Returns + +`Promise`\<`void`\> + +A promise that either resolves on observable completion or +rejects with the handled error. + +#### Example + +```ts +import { interval, take } from 'rxjs'; + +const source$ = interval(1000).pipe(take(4)); + +async function getTotal() { + let total = 0; + + await source$.forEach((value) => { + total += value; + console.log('observable -> ' + value); + }); + + return total; +} + +getTotal().then((total) => console.log('Total: ' + total)); + +// Expected: +// 'observable -> 0' +// 'observable -> 1' +// 'observable -> 2' +// 'observable -> 3' +// 'Total: 6' +``` + +### pipe() + +Used to stitch together functional operators into a chain. + +#### Example + +```ts +import { interval, filter, map, scan } from 'rxjs'; + +interval(1000) + .pipe( + filter((x) => x % 2 === 0), + map((x) => x + x), + scan((acc, x) => acc + x) + ) + .subscribe((x) => console.log(x)); +``` + +#### Call Signature + +```ts +pipe(): Observable; +``` + +Defined in: [observable/src/observable.ts:788](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L788) + +##### Returns + +`Observable`\<`T`\> + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>): A; +``` + +Defined in: [observable/src/observable.ts:789](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L789) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------- | +| `op1` | `UnaryFunction`\<`Observable`\<`T`\>, `A`\> | + +##### Returns + +`A` + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>, op2: UnaryFunction): B; +``` + +Defined in: [observable/src/observable.ts:790](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L790) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------- | +| `op1` | `UnaryFunction`\<`Observable`\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | + +##### Returns + +`B` + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction): C; +``` + +Defined in: [observable/src/observable.ts:791](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L791) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------- | +| `op1` | `UnaryFunction`\<`Observable`\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | + +##### Returns + +`C` + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction): D; +``` + +Defined in: [observable/src/observable.ts:792](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L792) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------- | +| `op1` | `UnaryFunction`\<`Observable`\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | + +##### Returns + +`D` + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction): E; +``` + +Defined in: [observable/src/observable.ts:793](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L793) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------- | +| `op1` | `UnaryFunction`\<`Observable`\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | + +##### Returns + +`E` + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction): F; +``` + +Defined in: [observable/src/observable.ts:800](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L800) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------- | +| `op1` | `UnaryFunction`\<`Observable`\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | + +##### Returns + +`F` + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction): G; +``` + +Defined in: [observable/src/observable.ts:808](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L808) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------- | +| `op1` | `UnaryFunction`\<`Observable`\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | + +##### Returns + +`G` + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction): H; +``` + +Defined in: [observable/src/observable.ts:817](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L817) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------- | +| `op1` | `UnaryFunction`\<`Observable`\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | + +##### Returns + +`H` + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction): I; +``` + +Defined in: [observable/src/observable.ts:827](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L827) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------- | +| `op1` | `UnaryFunction`\<`Observable`\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | + +##### Returns + +`I` + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... +operations: OperatorFunction[]): Observable; +``` + +Defined in: [observable/src/observable.ts:838](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L838) + +##### Parameters + +| Parameter | Type | +| --------------- | ------------------------------------------- | +| `op1` | `UnaryFunction`\<`Observable`\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `OperatorFunction`\<`any`, `any`\>[] | + +##### Returns + +`Observable`\<`unknown`\> + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... + operations: UnaryFunction[]): unknown; +``` + +Defined in: [observable/src/observable.ts:850](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L850) + +##### Parameters + +| Parameter | Type | +| --------------- | ------------------------------------------- | +| `op1` | `UnaryFunction`\<`Observable`\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `UnaryFunction`\<`any`, `any`\>[] | + +##### Returns + +`unknown` + +### subscribe() + +```ts +subscribe(observerOrNext?: Partial> | (value: T) => void | null): Subscription; +``` + +Defined in: [observable/src/observable.ts:695](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L695) + +Invokes an execution of an Observable and registers Observer handlers for notifications it will emit. + +Use it when you have all these Observables, but still nothing is happening. + +`subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It +might be for example a function that you passed to Observable's constructor, but most of the time it is +a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means +that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often +the thought. + +Apart from starting the execution of an Observable, this method allows you to listen for values +that an Observable emits, as well as for when it completes or errors. You can achieve this in two +of the following ways. + +The first way is creating an object that implements [Observer](../interfaces/Observer.md) interface. It should have methods +defined by that interface, but note that it should be just a regular JavaScript object, which you can create +yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do +not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also +that your object does not have to implement all methods. If you find yourself creating a method that doesn't +do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens, +it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead, +use the [onUnhandledError](../interfaces/GlobalConfig.md#onunhandlederror) configuration option or use a runtime handler (like `window.onerror` or +`process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide +an `error` method to avoid missing thrown errors. + +The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods. +This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent +of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer, +if you do not need to listen for something, you can omit a function by passing `undefined` or `null`, +since `subscribe` recognizes these functions by where they were placed in function call. When it comes +to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously. + +You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events +and you also handled emissions internally by using operators (e.g. using `tap`). + +Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object. +This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean +up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback +provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable. + +Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously. +It is an Observable itself that decides when these functions will be called. For example [of](../functions/of.md) +by default emits all its values synchronously. Always check documentation for how given Observable +will behave when subscribed and if its default behavior can be modified with a `scheduler`. + +#### Parameters + +| Parameter | Type | Description | +| ----------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `observerOrNext?` | `Partial`\<`Observer`\<`T`\>\> \| (`value`: `T`) => `void` \| `null` | Either an [Observer](../interfaces/Observer.md) with some or all callback methods, or the `next` handler that is called for each value emitted from the subscribed Observable. | + +#### Returns + +[`Subscription`](Subscription.md) + +A subscription reference to the registered handlers. + +#### Implementation of + +```ts +Subscribable.subscribe; +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/ReplaySubject.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/ReplaySubject.md new file mode 100644 index 0000000000..5f6179fed3 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/ReplaySubject.md @@ -0,0 +1,791 @@ +[API](../../index.md) / [rxjs](../index.md) / ReplaySubject + +# Class: ReplaySubject + +> A variant of [Subject](Subject.md) that "replays" old values to new subscribers by emitting them when they first subscribe. + +## Description + +`ReplaySubject` has an internal buffer that will store a specified number of values that it has observed. Like `Subject`, +`ReplaySubject` "observes" values by having them passed to its `next` method. When it observes a value, it will store that +value for a time determined by the configuration of the `ReplaySubject`, as passed to its constructor. + +When a new subscriber subscribes to the `ReplaySubject` instance, it will synchronously emit all values in its buffer in +a First-In-First-Out (FIFO) manner. The `ReplaySubject` will also complete, if it has observed completion; and it will +error if it has observed an error. + +There are two main configuration items to be concerned with: + +1. `bufferSize` - This will determine how many items are stored in the buffer, defaults to infinite. +2. `windowTime` - The amount of time to hold a value in the buffer before removing it from the buffer. + +Both configurations may exist simultaneously. So if you would like to buffer a maximum of 3 values, as long as the values +are less than 2 seconds old, you could do so with a `new ReplaySubject(3, 2000)`. + +### Differences with BehaviorSubject + +`BehaviorSubject` is similar to `new ReplaySubject(1)`, with a couple of exceptions: + +1. `BehaviorSubject` comes "primed" with a single value upon construction. +2. `ReplaySubject` will replay values, even after observing an error, where `BehaviorSubject` will not. + +Defined in: [rxjs/src/internal/ReplaySubject.ts:36](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/ReplaySubject.ts#L36) + +## See + +- [Subject](Subject.md) +- [BehaviorSubject](BehaviorSubject.md) +- [shareReplay](../functions/shareReplay.md) + +## Extends + +- [`Subject`](Subject.md)\<`T`\> + +## Constructors + +### Constructor + +```ts +new ReplaySubject<>( + _bufferSize: number, + _windowTime: number, +_timestampProvider: TimestampProvider): ReplaySubject; +``` + +Defined in: [rxjs/src/internal/ReplaySubject.ts:46](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/ReplaySubject.ts#L46) + +#### Parameters + +| Parameter | Type | Default value | Description | +| -------------------- | --------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `_bufferSize` | `number` | `Infinity` | The size of the buffer to replay on subscription | +| `_windowTime` | `number` | `Infinity` | The amount of time the buffered items will stay buffered | +| `_timestampProvider` | [`TimestampProvider`](../interfaces/TimestampProvider.md) | `dateTimestampProvider` | An object with a `now()` method that provides the current timestamp. This is used to calculate the amount of time something has been buffered. | + +#### Returns + +`ReplaySubject`\<`T`\> + +#### Overrides + +[`Subject`](Subject.md).[`constructor`](Subject.md#constructor) + +## Properties + +| Property | Type | Default value | Description | Inherited from | +| ------------------------------------------ | --------- | ------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------- | +| ~~`hasError`~~ | `boolean` | `false` | **Deprecated** Internal implementation detail, do not use directly. Will be made internal in v8. | [`Subject`](Subject.md).[`hasError`](Subject.md#haserror) | +| ~~`thrownError`~~ | `any` | `null` | **Deprecated** Internal implementation detail, do not use directly. Will be made internal in v8. | [`Subject`](Subject.md).[`thrownError`](Subject.md#thrownerror) | + +## Accessors + +### closed + +#### Get Signature + +```ts +get closed(): boolean; +``` + +Defined in: [rxjs/src/internal/Subject.ts:19](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L19) + +Will return true if this subject has been closed and is no longer accepting new values. + +##### Returns + +`boolean` + +#### Inherited from + +[`Subject`](Subject.md).[`closed`](Subject.md#closed) + +### observed + +#### Get Signature + +```ts +get observed(): boolean; +``` + +Defined in: [rxjs/src/internal/Subject.ts:94](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L94) + +##### Returns + +`boolean` + +#### Inherited from + +[`Subject`](Subject.md).[`observed`](Subject.md#observed) + +## Methods + +### \[asyncIterator\]() + +```ts +asyncIterator: AsyncGenerator; +``` + +Defined in: [observable/src/observable.ts:922](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L922) + +Observable is async iterable, so it can be used in `for await` loop. This method +of subscription is cancellable by breaking the for await loop. Although it's not +recommended to use Observable's AsyncIterable contract outside of `for await`, if +you're consuming the Observable as an AsyncIterable, and you're _not_ using `for await`, +you can use the `throw` or `return` methods on the `AsyncGenerator` we return to +cancel the subscription. Note that the subscription to the observable does not start +until the first value is requested from the AsyncIterable. + +Functionally, this is equivalent to using a [concatMap](../functions/concatMap.md) with an `async` function. +That means that while the body of the `for await` loop is executing, any values that arrive +from the observable source will be queued up, so they can be processed by the `for await` +loop in order. So, like [concatMap](../functions/concatMap.md) it's important to understand the speed your +source emits at, and the speed of the body of your `for await` loop. + +#### Returns + +`AsyncGenerator`\<`T`, `void`, `void`\> + +#### Example + +```ts +import { interval } from 'rxjs'; + +async function main() { + // Subscribe to the observable using for await. + for await (const value of interval(1000)) { + console.log(value); + + if (value > 5) { + // Unsubscribe from the interval if we get a value greater than 5 + break; + } + } +} + +main(); +``` + +#### Inherited from + +[`Subject`](Subject.md).[`[asyncIterator]`](Subject.md#asynciterator) + +### asObservable() + +```ts +asObservable(): Observable; +``` + +Defined in: [rxjs/src/internal/Subject.ts:137](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L137) + +Creates a new Observable with this Subject as the source. You can do this +to create custom Observer-side logic of the Subject and conceal it from +code that uses the Observable. + +#### Returns + +[`Observable`](Observable.md)\<`T`\> + +Observable that this Subject casts to. + +#### Inherited from + +[`Subject`](Subject.md).[`asObservable`](Subject.md#asobservable) + +### complete() + +```ts +complete(): void; +``` + +Defined in: [rxjs/src/internal/Subject.ts:77](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L77) + +#### Returns + +`void` + +#### Inherited from + +[`Subject`](Subject.md).[`complete`](Subject.md#complete) + +### error() + +```ts +error(err: any): void; +``` + +Defined in: [rxjs/src/internal/Subject.ts:64](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L64) + +#### Parameters + +| Parameter | Type | +| --------- | ----- | +| `err` | `any` | + +#### Returns + +`void` + +#### Inherited from + +[`Subject`](Subject.md).[`error`](Subject.md#error) + +### forEach() + +```ts +forEach(next: (value: T) => void): Promise; +``` + +Defined in: [observable/src/observable.ts:757](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L757) + +Used as a NON-CANCELLABLE means of subscribing to an observable, for use with +APIs that expect promises, like `async/await`. You cannot unsubscribe from this. + +**WARNING**: Only use this with observables you _know_ will complete. If the source +observable does not complete, you will end up with a promise that is hung up, and +potentially all of the state of an async function hanging out in memory. To avoid +this situation, look into adding something like [timeout](../functions/timeout.md), [take](../functions/take.md), +[takeWhile](../functions/takeWhile.md), or [takeUntil](../functions/takeUntil.md) amongst others. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ------------------------ | --------------------------------------------------- | +| `next` | (`value`: `T`) => `void` | A handler for each value emitted by the observable. | + +#### Returns + +`Promise`\<`void`\> + +A promise that either resolves on observable completion or +rejects with the handled error. + +#### Example + +```ts +import { interval, take } from 'rxjs'; + +const source$ = interval(1000).pipe(take(4)); + +async function getTotal() { + let total = 0; + + await source$.forEach((value) => { + total += value; + console.log('observable -> ' + value); + }); + + return total; +} + +getTotal().then((total) => console.log('Total: ' + total)); + +// Expected: +// 'observable -> 0' +// 'observable -> 1' +// 'observable -> 2' +// 'observable -> 3' +// 'Total: 6' +``` + +#### Inherited from + +[`Subject`](Subject.md).[`forEach`](Subject.md#foreach) + +### next() + +```ts +next(value: T): void; +``` + +Defined in: [rxjs/src/internal/ReplaySubject.ts:57](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/ReplaySubject.ts#L57) + +#### Parameters + +| Parameter | Type | +| --------- | ---- | +| `value` | `T` | + +#### Returns + +`void` + +#### Overrides + +[`Subject`](Subject.md).[`next`](Subject.md#next) + +### pipe() + +Used to stitch together functional operators into a chain. + +#### Example + +```ts +import { interval, filter, map, scan } from 'rxjs'; + +interval(1000) + .pipe( + filter((x) => x % 2 === 0), + map((x) => x + x), + scan((acc, x) => acc + x) + ) + .subscribe((x) => console.log(x)); +``` + +#### Call Signature + +```ts +pipe(): Observable; +``` + +Defined in: [observable/src/observable.ts:788](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L788) + +##### Returns + +[`Observable`](Observable.md)\<`T`\> + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>): A; +``` + +Defined in: [observable/src/observable.ts:789](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L789) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | + +##### Returns + +`A` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>, op2: UnaryFunction): B; +``` + +Defined in: [observable/src/observable.ts:790](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L790) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | + +##### Returns + +`B` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction): C; +``` + +Defined in: [observable/src/observable.ts:791](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L791) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | + +##### Returns + +`C` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction): D; +``` + +Defined in: [observable/src/observable.ts:792](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L792) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | + +##### Returns + +`D` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction): E; +``` + +Defined in: [observable/src/observable.ts:793](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L793) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | + +##### Returns + +`E` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction): F; +``` + +Defined in: [observable/src/observable.ts:800](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L800) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | + +##### Returns + +`F` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction): G; +``` + +Defined in: [observable/src/observable.ts:808](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L808) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | + +##### Returns + +`G` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction): H; +``` + +Defined in: [observable/src/observable.ts:817](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L817) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | + +##### Returns + +`H` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction): I; +``` + +Defined in: [observable/src/observable.ts:827](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L827) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | + +##### Returns + +`I` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... +operations: OperatorFunction[]): Observable; +``` + +Defined in: [observable/src/observable.ts:838](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L838) + +##### Parameters + +| Parameter | Type | +| --------------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `OperatorFunction`\<`any`, `any`\>[] | + +##### Returns + +[`Observable`](Observable.md)\<`unknown`\> + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... + operations: UnaryFunction[]): unknown; +``` + +Defined in: [observable/src/observable.ts:850](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L850) + +##### Parameters + +| Parameter | Type | +| --------------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `UnaryFunction`\<`any`, `any`\>[] | + +##### Returns + +`unknown` + +##### Inherited from + +[`Subject`](Subject.md).[`pipe`](Subject.md#pipe) + +### subscribe() + +```ts +subscribe(observerOrNext?: Partial> | (value: T) => void | null): Subscription; +``` + +Defined in: [observable/src/observable.ts:695](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L695) + +Invokes an execution of an Observable and registers Observer handlers for notifications it will emit. + +Use it when you have all these Observables, but still nothing is happening. + +`subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It +might be for example a function that you passed to Observable's constructor, but most of the time it is +a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means +that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often +the thought. + +Apart from starting the execution of an Observable, this method allows you to listen for values +that an Observable emits, as well as for when it completes or errors. You can achieve this in two +of the following ways. + +The first way is creating an object that implements [Observer](../interfaces/Observer.md) interface. It should have methods +defined by that interface, but note that it should be just a regular JavaScript object, which you can create +yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do +not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also +that your object does not have to implement all methods. If you find yourself creating a method that doesn't +do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens, +it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead, +use the [onUnhandledError](../interfaces/GlobalConfig.md#onunhandlederror) configuration option or use a runtime handler (like `window.onerror` or +`process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide +an `error` method to avoid missing thrown errors. + +The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods. +This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent +of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer, +if you do not need to listen for something, you can omit a function by passing `undefined` or `null`, +since `subscribe` recognizes these functions by where they were placed in function call. When it comes +to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously. + +You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events +and you also handled emissions internally by using operators (e.g. using `tap`). + +Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object. +This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean +up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback +provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable. + +Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously. +It is an Observable itself that decides when these functions will be called. For example [of](../functions/of.md) +by default emits all its values synchronously. Always check documentation for how given Observable +will behave when subscribed and if its default behavior can be modified with a `scheduler`. + +#### Parameters + +| Parameter | Type | Description | +| ----------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `observerOrNext?` | `Partial`\<`Observer`\<`T`\>\> \| (`value`: `T`) => `void` \| `null` | Either an [Observer](../interfaces/Observer.md) with some or all callback methods, or the `next` handler that is called for each value emitted from the subscribed Observable. | + +#### Returns + +[`Subscription`](Subscription.md) + +A subscription reference to the registered handlers. + +#### Inherited from + +[`Subject`](Subject.md).[`subscribe`](Subject.md#subscribe) + +### unsubscribe() + +```ts +unsubscribe(): void; +``` + +Defined in: [rxjs/src/internal/Subject.ts:89](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L89) + +#### Returns + +`void` + +#### Inherited from + +[`Subject`](Subject.md).[`unsubscribe`](Subject.md#unsubscribe) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/Scheduler.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/Scheduler.md new file mode 100644 index 0000000000..90a7e54950 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/Scheduler.md @@ -0,0 +1,100 @@ +[API](../../index.md) / [rxjs](../index.md) / Scheduler + +# ~~Class: Scheduler~~ + +> An execution context and a data structure to order tasks and schedule their +> execution. Provides a notion of (potentially virtual) time, through the +> `now()` getter method. + +## Description + +Each unit of work in a Scheduler is called an `Action`. + +```ts +class Scheduler { + now(): number; + schedule(work, delay?, state?): Subscription; +} +``` + +**deprecated**: Scheduler is an internal implementation detail of RxJS, and +should not be used directly. Rather, create your own class and implement +[SchedulerLike](../interfaces/SchedulerLike.md). Will be made internal in v8. + +Defined in: [rxjs/src/internal/Scheduler.ts:24](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Scheduler.ts#L24) + +## Deprecated + +Scheduler is an internal implementation detail of RxJS, and +should not be used directly. Rather, create your own class and implement +[SchedulerLike](../interfaces/SchedulerLike.md). Will be made internal in v8. + +## Implements + +- [`SchedulerLike`](../interfaces/SchedulerLike.md) + +## Constructors + +### Constructor + +```ts +new Scheduler(schedulerActionCtor: typeof Action, now: () => number): Scheduler; +``` + +Defined in: [rxjs/src/internal/Scheduler.ts:27](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Scheduler.ts#L27) + +#### Parameters + +| Parameter | Type | Default value | +| --------------------- | ----------------- | --------------- | +| `schedulerActionCtor` | _typeof_ `Action` | `undefined` | +| `now` | () => `number` | `Scheduler.now` | + +#### Returns + +`Scheduler` + +## Properties + +| Property | Type | Default value | Description | +| ---------------------------- | -------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ~~`now`~~ | () => `number` | `undefined` | A getter method that returns a number representing the current time (at the time this function was called) according to the scheduler's own internal clock. | +| ~~`now`~~ | () => `number` | `dateTimestampProvider.now` | - | + +## Methods + +### ~~schedule()~~ + +```ts +schedule<>( + work: (this: SchedulerAction, state?: T) => void, + delay: number, + state?: T): Subscription; +``` + +Defined in: [rxjs/src/internal/Scheduler.ts:57](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Scheduler.ts#L57) + +Schedules a function, `work`, for execution. May happen at some point in +the future, according to the `delay` parameter, if specified. May be passed +some context object, `state`, which will be passed to the `work` function. + +The given arguments will be processed an stored as an Action object in a +queue of actions. + +#### Parameters + +| Parameter | Type | Default value | Description | +| --------- | ----------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ | +| `work` | (`this`: [`SchedulerAction`](../interfaces/SchedulerAction.md)\<`T`\>, `state?`: `T`) => `void` | `undefined` | A function representing a task, or some unit of work to be executed by the Scheduler. | +| `delay` | `number` | `0` | Time to wait before executing the work, where the time unit is implicit and defined by the Scheduler itself. | +| `state?` | `T` | `undefined` | Some contextual data that the `work` function uses when called by the Scheduler. | + +#### Returns + +[`Subscription`](Subscription.md) + +A subscription in order to be able to unsubscribe the scheduled work. + +#### Implementation of + +[`SchedulerLike`](../interfaces/SchedulerLike.md).[`schedule`](../interfaces/SchedulerLike.md#schedule) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/SequenceError.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/SequenceError.md new file mode 100644 index 0000000000..96a07272e4 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/SequenceError.md @@ -0,0 +1,52 @@ +[API](../../index.md) / [rxjs](../index.md) / SequenceError + +# Class: SequenceError + +## Description + +An error thrown when something is wrong with the sequence of +values arriving on the observable. + +Defined in: [rxjs/src/internal/util/SequenceError.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/SequenceError.ts#L7) + +An error thrown when something is wrong with the sequence of +values arriving on the observable. + +## See + +[single](../functions/single.md) + +## Extends + +- `Error` + +## Constructors + +### Constructor + +```ts +new SequenceError(message: string): SequenceError; +``` + +Defined in: [rxjs/src/internal/util/SequenceError.ts:12](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/SequenceError.ts#L12) + +#### Parameters + +| Parameter | Type | +| --------- | -------- | +| `message` | `string` | + +#### Returns + +`SequenceError` + +#### Deprecated + +Internal implementation detail. Do not construct error instances. +Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 + +#### Overrides + +```ts +Error.constructor; +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/Subject.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/Subject.md new file mode 100644 index 0000000000..d2b2dcc92f --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/Subject.md @@ -0,0 +1,745 @@ +[API](../../index.md) / [rxjs](../index.md) / Subject + +# Class: Subject + +> A Subject is a special type of Observable that allows values to be +> multicasted to many Observers. Subjects are like EventEmitters. + +## Description + +Every Subject is an Observable and an Observer. You can subscribe to a +Subject, and you can call next to feed values as well as error and complete. + +Defined in: [rxjs/src/internal/Subject.ts:12](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L12) + +## Extends + +- [`Observable`](Observable.md)\<`T`\> + +## Extended by + +- [`BehaviorSubject`](BehaviorSubject.md) +- [`ReplaySubject`](ReplaySubject.md) +- [`AsyncSubject`](AsyncSubject.md) + +## Implements + +- [`SubscriptionLike`](../interfaces/SubscriptionLike.md) + +## Constructors + +### Constructor + +```ts +new Subject<>(): Subject; +``` + +Defined in: [rxjs/src/internal/Subject.ts:44](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L44) + +#### Returns + +`Subject`\<`T`\> + +#### Overrides + +[`Observable`](Observable.md).[`constructor`](Observable.md#constructor) + +## Properties + +| Property | Type | Default value | Description | +| ------------------------------------------ | --------- | ------------- | ------------------------------------------------------------------------------------------------ | +| ~~`hasError`~~ | `boolean` | `false` | **Deprecated** Internal implementation detail, do not use directly. Will be made internal in v8. | +| ~~`thrownError`~~ | `any` | `null` | **Deprecated** Internal implementation detail, do not use directly. Will be made internal in v8. | + +## Accessors + +### closed + +#### Get Signature + +```ts +get closed(): boolean; +``` + +Defined in: [rxjs/src/internal/Subject.ts:19](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L19) + +Will return true if this subject has been closed and is no longer accepting new values. + +##### Returns + +`boolean` + +#### Implementation of + +[`SubscriptionLike`](../interfaces/SubscriptionLike.md).[`closed`](../interfaces/SubscriptionLike.md#closed) + +### observed + +#### Get Signature + +```ts +get observed(): boolean; +``` + +Defined in: [rxjs/src/internal/Subject.ts:94](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L94) + +##### Returns + +`boolean` + +## Methods + +### \[asyncIterator\]() + +```ts +asyncIterator: AsyncGenerator; +``` + +Defined in: [observable/src/observable.ts:922](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L922) + +Observable is async iterable, so it can be used in `for await` loop. This method +of subscription is cancellable by breaking the for await loop. Although it's not +recommended to use Observable's AsyncIterable contract outside of `for await`, if +you're consuming the Observable as an AsyncIterable, and you're _not_ using `for await`, +you can use the `throw` or `return` methods on the `AsyncGenerator` we return to +cancel the subscription. Note that the subscription to the observable does not start +until the first value is requested from the AsyncIterable. + +Functionally, this is equivalent to using a [concatMap](../functions/concatMap.md) with an `async` function. +That means that while the body of the `for await` loop is executing, any values that arrive +from the observable source will be queued up, so they can be processed by the `for await` +loop in order. So, like [concatMap](../functions/concatMap.md) it's important to understand the speed your +source emits at, and the speed of the body of your `for await` loop. + +#### Returns + +`AsyncGenerator`\<`T`, `void`, `void`\> + +#### Example + +```ts +import { interval } from 'rxjs'; + +async function main() { + // Subscribe to the observable using for await. + for await (const value of interval(1000)) { + console.log(value); + + if (value > 5) { + // Unsubscribe from the interval if we get a value greater than 5 + break; + } + } +} + +main(); +``` + +#### Inherited from + +[`Observable`](Observable.md).[`[asyncIterator]`](Observable.md#asynciterator) + +### asObservable() + +```ts +asObservable(): Observable; +``` + +Defined in: [rxjs/src/internal/Subject.ts:137](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L137) + +Creates a new Observable with this Subject as the source. You can do this +to create custom Observer-side logic of the Subject and conceal it from +code that uses the Observable. + +#### Returns + +[`Observable`](Observable.md)\<`T`\> + +Observable that this Subject casts to. + +### complete() + +```ts +complete(): void; +``` + +Defined in: [rxjs/src/internal/Subject.ts:77](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L77) + +#### Returns + +`void` + +### error() + +```ts +error(err: any): void; +``` + +Defined in: [rxjs/src/internal/Subject.ts:64](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L64) + +#### Parameters + +| Parameter | Type | +| --------- | ----- | +| `err` | `any` | + +#### Returns + +`void` + +### forEach() + +```ts +forEach(next: (value: T) => void): Promise; +``` + +Defined in: [observable/src/observable.ts:757](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L757) + +Used as a NON-CANCELLABLE means of subscribing to an observable, for use with +APIs that expect promises, like `async/await`. You cannot unsubscribe from this. + +**WARNING**: Only use this with observables you _know_ will complete. If the source +observable does not complete, you will end up with a promise that is hung up, and +potentially all of the state of an async function hanging out in memory. To avoid +this situation, look into adding something like [timeout](../functions/timeout.md), [take](../functions/take.md), +[takeWhile](../functions/takeWhile.md), or [takeUntil](../functions/takeUntil.md) amongst others. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ------------------------ | --------------------------------------------------- | +| `next` | (`value`: `T`) => `void` | A handler for each value emitted by the observable. | + +#### Returns + +`Promise`\<`void`\> + +A promise that either resolves on observable completion or +rejects with the handled error. + +#### Example + +```ts +import { interval, take } from 'rxjs'; + +const source$ = interval(1000).pipe(take(4)); + +async function getTotal() { + let total = 0; + + await source$.forEach((value) => { + total += value; + console.log('observable -> ' + value); + }); + + return total; +} + +getTotal().then((total) => console.log('Total: ' + total)); + +// Expected: +// 'observable -> 0' +// 'observable -> 1' +// 'observable -> 2' +// 'observable -> 3' +// 'Total: 6' +``` + +#### Inherited from + +[`Observable`](Observable.md).[`forEach`](Observable.md#foreach) + +### next() + +```ts +next(value: T): void; +``` + +Defined in: [rxjs/src/internal/Subject.ts:54](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L54) + +#### Parameters + +| Parameter | Type | +| --------- | ---- | +| `value` | `T` | + +#### Returns + +`void` + +### pipe() + +Used to stitch together functional operators into a chain. + +#### Example + +```ts +import { interval, filter, map, scan } from 'rxjs'; + +interval(1000) + .pipe( + filter((x) => x % 2 === 0), + map((x) => x + x), + scan((acc, x) => acc + x) + ) + .subscribe((x) => console.log(x)); +``` + +#### Call Signature + +```ts +pipe(): Observable; +``` + +Defined in: [observable/src/observable.ts:788](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L788) + +##### Returns + +[`Observable`](Observable.md)\<`T`\> + +##### Inherited from + +[`Observable`](Observable.md).[`pipe`](Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>): A; +``` + +Defined in: [observable/src/observable.ts:789](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L789) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | + +##### Returns + +`A` + +##### Inherited from + +[`Observable`](Observable.md).[`pipe`](Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>, op2: UnaryFunction): B; +``` + +Defined in: [observable/src/observable.ts:790](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L790) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | + +##### Returns + +`B` + +##### Inherited from + +[`Observable`](Observable.md).[`pipe`](Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction): C; +``` + +Defined in: [observable/src/observable.ts:791](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L791) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | + +##### Returns + +`C` + +##### Inherited from + +[`Observable`](Observable.md).[`pipe`](Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction): D; +``` + +Defined in: [observable/src/observable.ts:792](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L792) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | + +##### Returns + +`D` + +##### Inherited from + +[`Observable`](Observable.md).[`pipe`](Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction): E; +``` + +Defined in: [observable/src/observable.ts:793](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L793) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | + +##### Returns + +`E` + +##### Inherited from + +[`Observable`](Observable.md).[`pipe`](Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction): F; +``` + +Defined in: [observable/src/observable.ts:800](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L800) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | + +##### Returns + +`F` + +##### Inherited from + +[`Observable`](Observable.md).[`pipe`](Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction): G; +``` + +Defined in: [observable/src/observable.ts:808](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L808) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | + +##### Returns + +`G` + +##### Inherited from + +[`Observable`](Observable.md).[`pipe`](Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction): H; +``` + +Defined in: [observable/src/observable.ts:817](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L817) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | + +##### Returns + +`H` + +##### Inherited from + +[`Observable`](Observable.md).[`pipe`](Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction): I; +``` + +Defined in: [observable/src/observable.ts:827](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L827) + +##### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | + +##### Returns + +`I` + +##### Inherited from + +[`Observable`](Observable.md).[`pipe`](Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... +operations: OperatorFunction[]): Observable; +``` + +Defined in: [observable/src/observable.ts:838](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L838) + +##### Parameters + +| Parameter | Type | +| --------------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `OperatorFunction`\<`any`, `any`\>[] | + +##### Returns + +[`Observable`](Observable.md)\<`unknown`\> + +##### Inherited from + +[`Observable`](Observable.md).[`pipe`](Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... + operations: UnaryFunction[]): unknown; +``` + +Defined in: [observable/src/observable.ts:850](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L850) + +##### Parameters + +| Parameter | Type | +| --------------- | ------------------------------------------------------------ | +| `op1` | `UnaryFunction`\<[`Observable`](Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `UnaryFunction`\<`any`, `any`\>[] | + +##### Returns + +`unknown` + +##### Inherited from + +[`Observable`](Observable.md).[`pipe`](Observable.md#pipe) + +### subscribe() + +```ts +subscribe(observerOrNext?: Partial> | (value: T) => void | null): Subscription; +``` + +Defined in: [observable/src/observable.ts:695](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L695) + +Invokes an execution of an Observable and registers Observer handlers for notifications it will emit. + +Use it when you have all these Observables, but still nothing is happening. + +`subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It +might be for example a function that you passed to Observable's constructor, but most of the time it is +a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means +that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often +the thought. + +Apart from starting the execution of an Observable, this method allows you to listen for values +that an Observable emits, as well as for when it completes or errors. You can achieve this in two +of the following ways. + +The first way is creating an object that implements [Observer](../interfaces/Observer.md) interface. It should have methods +defined by that interface, but note that it should be just a regular JavaScript object, which you can create +yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do +not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also +that your object does not have to implement all methods. If you find yourself creating a method that doesn't +do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens, +it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead, +use the [onUnhandledError](../interfaces/GlobalConfig.md#onunhandlederror) configuration option or use a runtime handler (like `window.onerror` or +`process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide +an `error` method to avoid missing thrown errors. + +The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods. +This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent +of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer, +if you do not need to listen for something, you can omit a function by passing `undefined` or `null`, +since `subscribe` recognizes these functions by where they were placed in function call. When it comes +to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously. + +You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events +and you also handled emissions internally by using operators (e.g. using `tap`). + +Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object. +This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean +up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback +provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable. + +Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously. +It is an Observable itself that decides when these functions will be called. For example [of](../functions/of.md) +by default emits all its values synchronously. Always check documentation for how given Observable +will behave when subscribed and if its default behavior can be modified with a `scheduler`. + +#### Parameters + +| Parameter | Type | Description | +| ----------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `observerOrNext?` | `Partial`\<`Observer`\<`T`\>\> \| (`value`: `T`) => `void` \| `null` | Either an [Observer](../interfaces/Observer.md) with some or all callback methods, or the `next` handler that is called for each value emitted from the subscribed Observable. | + +#### Returns + +[`Subscription`](Subscription.md) + +A subscription reference to the registered handlers. + +#### Inherited from + +[`Observable`](Observable.md).[`subscribe`](Observable.md#subscribe) + +### unsubscribe() + +```ts +unsubscribe(): void; +``` + +Defined in: [rxjs/src/internal/Subject.ts:89](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Subject.ts#L89) + +#### Returns + +`void` + +#### Implementation of + +[`SubscriptionLike`](../interfaces/SubscriptionLike.md).[`unsubscribe`](../interfaces/SubscriptionLike.md#unsubscribe) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/Subscriber.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/Subscriber.md new file mode 100644 index 0000000000..a7f8bd0f81 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/Subscriber.md @@ -0,0 +1,259 @@ +[API](../../index.md) / [rxjs](../index.md) / Subscriber + +# Class: Subscriber + +## Description + +Implements the [Observer](../interfaces/Observer.md) interface and extends the +[Subscription](Subscription.md) class. While the [Observer](../interfaces/Observer.md) is the public API for +consuming the values of an [Observable](Observable.md), all Observers get converted to +a Subscriber, in order to provide Subscription-like capabilities such as +`unsubscribe`. Subscriber is a common type in RxJS, and crucial for +implementing operators, but it is rarely used as a public API. + +Defined in: [observable/src/observable.ts:239](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L239) + +Implements the [Observer](../interfaces/Observer.md) interface and extends the +[Subscription](Subscription.md) class. While the [Observer](../interfaces/Observer.md) is the public API for +consuming the values of an [Observable](Observable.md), all Observers get converted to +a Subscriber, in order to provide Subscription-like capabilities such as +`unsubscribe`. Subscriber is a common type in RxJS, and crucial for +implementing operators, but it is rarely used as a public API. + +## Extends + +- [`Subscription`](Subscription.md) + +## Implements + +- `Observer`\<`T`\> + +## Constructors + +### Constructor + +```ts +new Subscriber<>(destination?: + | Subscriber + | Partial> + | (value: T) => void +| null): Subscriber; +``` + +Defined in: [observable/src/observable.ts:257](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L257) + +#### Parameters + +| Parameter | Type | +| -------------- | ---------------------------------------------------------------------------------------------- | +| `destination?` | \| `Subscriber`\<`T`\> \| `Partial`\<`Observer`\<`T`\>\> \| (`value`: `T`) => `void` \| `null` | + +#### Returns + +`Subscriber`\<`T`\> + +#### Deprecated + +Do not create instances of `Subscriber` directly. Use [operate](../functions/operate.md) instead. + +#### Overrides + +[`Subscription`](Subscription.md).[`constructor`](Subscription.md#constructor) + +## Properties + +| Property | Type | Default value | Description | Inherited from | +| ---------------------------- | --------------------------------- | ------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `closed` | `boolean` | `false` | A flag to indicate whether this Subscription has already been unsubscribed. | [`Subscription`](Subscription.md).[`closed`](Subscription.md#closed) | +| `EMPTY` | [`Subscription`](Subscription.md) | `undefined` | - | [`Subscription`](Subscription.md).[`EMPTY`](Subscription.md#empty) | + +## Methods + +### \[dispose\]() + +```ts +dispose: void; +``` + +Defined in: [observable/src/observable.ts:185](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L185) + +#### Returns + +`void` + +#### Inherited from + +[`Subscription`](Subscription.md).[`[dispose]`](Subscription.md#dispose) + +### add() + +```ts +add(teardown: TeardownLogic): void; +``` + +Defined in: [observable/src/observable.ts:134](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L134) + +Adds a finalizer to this subscription, so that finalization will be unsubscribed/called +when this subscription is unsubscribed. If this subscription is already [closed](Subscription.md#closed), +because it has already been unsubscribed, then whatever finalizer is passed to it +will automatically be executed (unless the finalizer itself is also a closed subscription). + +Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed +subscription to a any subscription will result in no operation. (A noop). + +Adding a subscription to itself, or adding `null` or `undefined` will not perform any +operation at all. (A noop). + +`Subscription` instances that are added to this instance will automatically remove themselves +if they are unsubscribed. Functions and [Unsubscribable](../interfaces/Unsubscribable.md) objects that you wish to remove +will need to be removed manually with [remove](Subscription.md#remove) + +#### Parameters + +| Parameter | Type | Description | +| ---------- | --------------- | --------------------------------------------------- | +| `teardown` | `TeardownLogic` | The finalization logic to add to this subscription. | + +#### Returns + +`void` + +#### Inherited from + +[`Subscription`](Subscription.md).[`add`](Subscription.md#add) + +### complete() + +```ts +complete(): void; +``` + +Defined in: [observable/src/observable.ts:345](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L345) + +The [Observer](../interfaces/Observer.md) callback to receive a valueless notification of type +`complete` from the Observable. Notifies the Observer that the Observable +has finished sending push-based notifications. + +#### Returns + +`void` + +#### Implementation of + +```ts +Observer.complete; +``` + +### error() + +```ts +error(err?: any): void; +``` + +Defined in: [observable/src/observable.ts:331](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L331) + +The [Observer](../interfaces/Observer.md) callback to receive notifications of type `error` from +the Observable, with an attached `Error`. Notifies the Observer that +the Observable has experienced an error condition. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ----- | ---------------------- | +| `err?` | `any` | The `error` exception. | + +#### Returns + +`void` + +#### Implementation of + +```ts +Observer.error; +``` + +### next() + +```ts +next(value: T): void; +``` + +Defined in: [observable/src/observable.ts:317](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L317) + +The [Observer](../interfaces/Observer.md) callback to receive notifications of type `next` from +the Observable, with a value. The Observable may call this method 0 or more +times. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ---- | ----------------- | +| `value` | `T` | The `next` value. | + +#### Returns + +`void` + +#### Implementation of + +```ts +Observer.next; +``` + +### remove() + +```ts +remove(teardown: Unsubscribable | Subscription | () => void): void; +``` + +Defined in: [observable/src/observable.ts:176](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L176) + +Removes a finalizer from this subscription that was previously added with the [add](Subscription.md#add) method. + +Note that `Subscription` instances, when unsubscribed, will automatically remove themselves +from every other `Subscription` they have been added to. This means that using the `remove` method +is not a common thing and should be used thoughtfully. + +If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance +more than once, you will need to call `remove` the same number of times to remove all instances. + +All finalizer instances are removed to free up memory upon unsubscription. + +TIP: In instances you're adding and removing _Subscriptions from other Subscriptions_, you should +be sure to unsubscribe or otherwise get rid of the child subscription reference as soon as you remove it. +The child subscription has a reference to the parent it was added to via closure. In most cases, this +a non-issue, as child subscriptions are rarely long-lived. + +#### Parameters + +| Parameter | Type | Description | +| ---------- | --------------------------------------------------------------------- | ---------------------------------------------- | +| `teardown` | `Unsubscribable` \| [`Subscription`](Subscription.md) \| () => `void` | The finalizer to remove from this subscription | + +#### Returns + +`void` + +#### Inherited from + +[`Subscription`](Subscription.md).[`remove`](Subscription.md#remove) + +### unsubscribe() + +```ts +unsubscribe(): void; +``` + +Defined in: [observable/src/observable.ts:354](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L354) + +Disposes the resources held by the subscription. May, for instance, cancel +an ongoing Observable execution or cancel any other type of work that +started when the Subscription was created. + +#### Returns + +`void` + +#### Overrides + +[`Subscription`](Subscription.md).[`unsubscribe`](Subscription.md#unsubscribe) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/Subscription.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/Subscription.md new file mode 100644 index 0000000000..febda2d705 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/Subscription.md @@ -0,0 +1,155 @@ +[API](../../index.md) / [rxjs](../index.md) / Subscription + +# Class: Subscription + +> Represents a disposable resource, such as the execution of an Observable. A +> Subscription has one important method, `unsubscribe`, that takes no argument +> and just disposes the resource held by the subscription. + +## Description + +Additionally, subscriptions may be grouped together through the `add()` +method, which will attach a child Subscription to the current Subscription. +When a Subscription is unsubscribed, all its children (and its grandchildren) +will be unsubscribed as well. + +Defined in: [observable/src/observable.ts:49](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L49) + +## Extended by + +- [`SchedulerAction`](../interfaces/SchedulerAction.md) +- [`Subscriber`](Subscriber.md) + +## Implements + +- `SubscriptionLike` + +## Constructors + +### Constructor + +```ts +new Subscription(initialTeardown?: () => void): Subscription; +``` + +Defined in: [observable/src/observable.ts:71](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L71) + +#### Parameters + +| Parameter | Type | Description | +| ------------------ | ------------ | ---------------------------------------------------------------------------------------------------------------------------- | +| `initialTeardown?` | () => `void` | A function executed first as part of the finalization process that is kicked off when [unsubscribe](#unsubscribe) is called. | + +#### Returns + +`Subscription` + +## Properties + +| Property | Type | Default value | Description | +| ---------------------------- | -------------- | ------------- | --------------------------------------------------------------------------- | +| `closed` | `boolean` | `false` | A flag to indicate whether this Subscription has already been unsubscribed. | +| `EMPTY` | `Subscription` | `undefined` | - | + +## Methods + +### \[dispose\]() + +```ts +dispose: void; +``` + +Defined in: [observable/src/observable.ts:185](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L185) + +#### Returns + +`void` + +### add() + +```ts +add(teardown: TeardownLogic): void; +``` + +Defined in: [observable/src/observable.ts:134](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L134) + +Adds a finalizer to this subscription, so that finalization will be unsubscribed/called +when this subscription is unsubscribed. If this subscription is already [closed](#closed), +because it has already been unsubscribed, then whatever finalizer is passed to it +will automatically be executed (unless the finalizer itself is also a closed subscription). + +Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed +subscription to a any subscription will result in no operation. (A noop). + +Adding a subscription to itself, or adding `null` or `undefined` will not perform any +operation at all. (A noop). + +`Subscription` instances that are added to this instance will automatically remove themselves +if they are unsubscribed. Functions and [Unsubscribable](../interfaces/Unsubscribable.md) objects that you wish to remove +will need to be removed manually with [remove](#remove) + +#### Parameters + +| Parameter | Type | Description | +| ---------- | --------------- | --------------------------------------------------- | +| `teardown` | `TeardownLogic` | The finalization logic to add to this subscription. | + +#### Returns + +`void` + +### remove() + +```ts +remove(teardown: Unsubscribable | Subscription | () => void): void; +``` + +Defined in: [observable/src/observable.ts:176](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L176) + +Removes a finalizer from this subscription that was previously added with the [add](#add) method. + +Note that `Subscription` instances, when unsubscribed, will automatically remove themselves +from every other `Subscription` they have been added to. This means that using the `remove` method +is not a common thing and should be used thoughtfully. + +If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance +more than once, you will need to call `remove` the same number of times to remove all instances. + +All finalizer instances are removed to free up memory upon unsubscription. + +TIP: In instances you're adding and removing _Subscriptions from other Subscriptions_, you should +be sure to unsubscribe or otherwise get rid of the child subscription reference as soon as you remove it. +The child subscription has a reference to the parent it was added to via closure. In most cases, this +a non-issue, as child subscriptions are rarely long-lived. + +#### Parameters + +| Parameter | Type | Description | +| ---------- | -------------------------------------------------- | ---------------------------------------------- | +| `teardown` | `Unsubscribable` \| `Subscription` \| () => `void` | The finalizer to remove from this subscription | + +#### Returns + +`void` + +### unsubscribe() + +```ts +unsubscribe(): void; +``` + +Defined in: [observable/src/observable.ts:78](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L78) + +Disposes the resources held by the subscription. May, for instance, cancel +an ongoing Observable execution or cancel any other type of work that +started when the Subscription was created. + +#### Returns + +`void` + +#### Implementation of + +```ts +SubscriptionLike.unsubscribe; +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/TimeoutError.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/TimeoutError.md new file mode 100644 index 0000000000..3d1f4fdb92 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/TimeoutError.md @@ -0,0 +1,59 @@ +[API](../../index.md) / [rxjs](../index.md) / TimeoutError + +# Class: TimeoutError + +> An error thrown by the [timeout](../functions/timeout.md) operator. + +## Description + +Provided so users can use as a type and do quality comparisons. +We recommend you do not subclass this or create instances of this class directly. +If you have need of a error representing a timeout, you should +create your own error class and use that. + +Defined in: [rxjs/src/internal/operators/timeout.ts:60](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/timeout.ts#L60) + +## See + +[timeout](../functions/timeout.md) + +## Extends + +- `Error` + +## Constructors + +### Constructor + +```ts +new TimeoutError<>(info: TimeoutInfo | null): TimeoutError; +``` + +Defined in: [rxjs/src/internal/operators/timeout.ts:70](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/timeout.ts#L70) + +#### Parameters + +| Parameter | Type | Default value | Description | +| --------- | ------------------------------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `info` | [`TimeoutInfo`](../interfaces/TimeoutInfo.md)\<`T`, `M`\> \| `null` | `null` | The information provided to the error by the timeout operation that created the error. Will be `null` if used directly in non-RxJS code with an empty constructor. (Note that using this constructor directly is not recommended, you should create your own errors) | + +#### Returns + +`TimeoutError`\<`T`, `M`\> + +#### Deprecated + +Internal implementation detail. Do not construct error instances. +Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 + +#### Overrides + +```ts +Error.constructor; +``` + +## Properties + +| Property | Type | Default value | Description | +| ------------------------ | ------------------------------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `info` | [`TimeoutInfo`](../interfaces/TimeoutInfo.md)\<`T`, `M`\> \| `null` | `null` | The information provided to the error by the timeout operation that created the error. Will be `null` if used directly in non-RxJS code with an empty constructor. (Note that using this constructor directly is not recommended, you should create your own errors) | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/UnsubscriptionError.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/UnsubscriptionError.md new file mode 100644 index 0000000000..b2ac124b6f --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/UnsubscriptionError.md @@ -0,0 +1,54 @@ +[API](../../index.md) / [rxjs](../index.md) / UnsubscriptionError + +# Class: UnsubscriptionError + +## Description + +An error thrown when one or more errors have occurred during the +`unsubscribe` of a [Subscription](Subscription.md). + +Defined in: [observable/src/observable.ts:23](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L23) + +An error thrown when one or more errors have occurred during the +`unsubscribe` of a [Subscription](Subscription.md). + +## Extends + +- `Error` + +## Constructors + +### Constructor + +```ts +new UnsubscriptionError(errors: any[]): UnsubscriptionError; +``` + +Defined in: [observable/src/observable.ts:28](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L28) + +#### Parameters + +| Parameter | Type | +| --------- | ------- | +| `errors` | `any`[] | + +#### Returns + +`UnsubscriptionError` + +#### Deprecated + +Internal implementation detail. Do not construct error instances. +Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 + +#### Overrides + +```ts +Error.constructor; +``` + +## Properties + +| Property | Type | +| ---------------------------- | ------- | +| `errors` | `any`[] | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/VirtualAction.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/VirtualAction.md new file mode 100644 index 0000000000..15d9508023 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/VirtualAction.md @@ -0,0 +1,223 @@ +[API](../../index.md) / [rxjs](../index.md) / VirtualAction + +# Class: VirtualAction + +Defined in: [rxjs/src/internal/scheduler/VirtualTimeScheduler.ts:63](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/scheduler/VirtualTimeScheduler.ts#L63) + +## Extends + +- `AsyncAction`\<`T`\> + +## Constructors + +### Constructor + +```ts +new VirtualAction<>( + scheduler: VirtualTimeScheduler, + work: (this: SchedulerAction, state?: T) => void, +index: number): VirtualAction; +``` + +Defined in: [rxjs/src/internal/scheduler/VirtualTimeScheduler.ts:66](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/scheduler/VirtualTimeScheduler.ts#L66) + +#### Parameters + +| Parameter | Type | +| ----------- | ----------------------------------------------------------------------------------------------- | +| `scheduler` | [`VirtualTimeScheduler`](VirtualTimeScheduler.md) | +| `work` | (`this`: [`SchedulerAction`](../interfaces/SchedulerAction.md)\<`T`\>, `state?`: `T`) => `void` | +| `index` | `number` | + +#### Returns + +`VirtualAction`\<`T`\> + +#### Overrides + +```ts +AsyncAction.constructor +``` + +## Properties + +| Property | Type | Default value | Description | Inherited from | +| ---------------------------- | --------------------------------- | ------------- | --------------------------------------------------------------------------- | -------------------- | +| `closed` | `boolean` | `false` | A flag to indicate whether this Subscription has already been unsubscribed. | `AsyncAction.closed` | +| `delay` | `number` | `undefined` | - | `AsyncAction.delay` | +| `id` | `TimerHandle` \| `undefined` | `undefined` | - | `AsyncAction.id` | +| `state?` | `T` | `undefined` | - | `AsyncAction.state` | +| `EMPTY` | [`Subscription`](Subscription.md) | `undefined` | - | `AsyncAction.EMPTY` | + +## Methods + +### \[dispose\]() + +```ts +dispose: void; +``` + +Defined in: [observable/src/observable.ts:185](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L185) + +#### Returns + +`void` + +#### Inherited from + +```ts +AsyncAction.[dispose] +``` + +### add() + +```ts +add(teardown: TeardownLogic): void; +``` + +Defined in: [observable/src/observable.ts:134](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L134) + +Adds a finalizer to this subscription, so that finalization will be unsubscribed/called +when this subscription is unsubscribed. If this subscription is already [closed](Subscription.md#closed), +because it has already been unsubscribed, then whatever finalizer is passed to it +will automatically be executed (unless the finalizer itself is also a closed subscription). + +Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed +subscription to a any subscription will result in no operation. (A noop). + +Adding a subscription to itself, or adding `null` or `undefined` will not perform any +operation at all. (A noop). + +`Subscription` instances that are added to this instance will automatically remove themselves +if they are unsubscribed. Functions and [Unsubscribable](../interfaces/Unsubscribable.md) objects that you wish to remove +will need to be removed manually with [remove](Subscription.md#remove) + +#### Parameters + +| Parameter | Type | Description | +| ---------- | --------------- | --------------------------------------------------- | +| `teardown` | `TeardownLogic` | The finalization logic to add to this subscription. | + +#### Returns + +`void` + +#### Inherited from + +```ts +AsyncAction.add; +``` + +### execute() + +```ts +execute(state: T, delay: number): any; +``` + +Defined in: [rxjs/src/internal/scheduler/AsyncAction.ts:87](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/scheduler/AsyncAction.ts#L87) + +Immediately executes this action and the `work` it contains. + +#### Parameters + +| Parameter | Type | +| --------- | -------- | +| `state` | `T` | +| `delay` | `number` | + +#### Returns + +`any` + +#### Inherited from + +```ts +AsyncAction.execute; +``` + +### remove() + +```ts +remove(teardown: Unsubscribable | Subscription | () => void): void; +``` + +Defined in: [observable/src/observable.ts:176](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L176) + +Removes a finalizer from this subscription that was previously added with the [add](Subscription.md#add) method. + +Note that `Subscription` instances, when unsubscribed, will automatically remove themselves +from every other `Subscription` they have been added to. This means that using the `remove` method +is not a common thing and should be used thoughtfully. + +If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance +more than once, you will need to call `remove` the same number of times to remove all instances. + +All finalizer instances are removed to free up memory upon unsubscription. + +TIP: In instances you're adding and removing _Subscriptions from other Subscriptions_, you should +be sure to unsubscribe or otherwise get rid of the child subscription reference as soon as you remove it. +The child subscription has a reference to the parent it was added to via closure. In most cases, this +a non-issue, as child subscriptions are rarely long-lived. + +#### Parameters + +| Parameter | Type | Description | +| ---------- | --------------------------------------------------------------------- | ---------------------------------------------- | +| `teardown` | `Unsubscribable` \| [`Subscription`](Subscription.md) \| () => `void` | The finalizer to remove from this subscription | + +#### Returns + +`void` + +#### Inherited from + +```ts +AsyncAction.remove; +``` + +### schedule() + +```ts +schedule(state?: T, delay?: number): Subscription; +``` + +Defined in: [rxjs/src/internal/scheduler/VirtualTimeScheduler.ts:75](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/scheduler/VirtualTimeScheduler.ts#L75) + +#### Parameters + +| Parameter | Type | Default value | +| --------- | -------- | ------------- | +| `state?` | `T` | `undefined` | +| `delay?` | `number` | `0` | + +#### Returns + +[`Subscription`](Subscription.md) + +#### Overrides + +```ts +AsyncAction.schedule; +``` + +### unsubscribe() + +```ts +unsubscribe(): void; +``` + +Defined in: [rxjs/src/internal/scheduler/AsyncAction.ts:132](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/scheduler/AsyncAction.ts#L132) + +Disposes the resources held by the subscription. May, for instance, cancel +an ongoing Observable execution or cancel any other type of work that +started when the Subscription was created. + +#### Returns + +`void` + +#### Inherited from + +```ts +AsyncAction.unsubscribe; +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/classes/VirtualTimeScheduler.md b/apps/rxjs.dev-next/docs/api/rxjs/classes/VirtualTimeScheduler.md new file mode 100644 index 0000000000..33975a4058 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/classes/VirtualTimeScheduler.md @@ -0,0 +1,116 @@ +[API](../../index.md) / [rxjs](../index.md) / VirtualTimeScheduler + +# Class: VirtualTimeScheduler + +Defined in: [rxjs/src/internal/scheduler/VirtualTimeScheduler.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/scheduler/VirtualTimeScheduler.ts#L7) + +## Extends + +- `AsyncScheduler` + +## Extended by + +- [`TestScheduler`](../../testing/classes/TestScheduler.md) + +## Constructors + +### Constructor + +```ts +new VirtualTimeScheduler(schedulerActionCtor: typeof AsyncAction, maxFrames: number): VirtualTimeScheduler; +``` + +Defined in: [rxjs/src/internal/scheduler/VirtualTimeScheduler.ts:32](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/scheduler/VirtualTimeScheduler.ts#L32) + +This creates an instance of a `VirtualTimeScheduler`. Experts only. The signature of +this constructor is likely to change in the long run. + +#### Parameters + +| Parameter | Type | Default value | Description | +| --------------------- | ---------------------- | ------------- | ---------------------------------------------------------------------------------------------- | +| `schedulerActionCtor` | _typeof_ `AsyncAction` | `...` | The type of Action to initialize when initializing actions during scheduling. | +| `maxFrames` | `number` | `Infinity` | The maximum number of frames to process before stopping. Used to prevent endless flush cycles. | + +#### Returns + +`VirtualTimeScheduler` + +#### Overrides + +```ts +AsyncScheduler.constructor; +``` + +## Properties + +| Property | Type | Default value | Description | Inherited from | +| -------------------------------------------------- | ------------------------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | +| `actions` | `AsyncAction`\<`any`\>[] | `[]` | - | `AsyncScheduler.actions` | +| `frame` | `number` | `0` | The current frame for the state of the virtual scheduler instance. The difference between two "frames" is synonymous with the passage of "virtual time units". So if you record `scheduler.frame` to be `1`, then later, observe `scheduler.frame` to be at `11`, that means `10` virtual time units have passed. | - | +| ~~`index`~~ | `number` | `-1` | Used internally to examine the current virtual action index being processed. **Deprecated** Internal implementation detail, do not use directly. Will be made internal in v8. | - | +| `maxFrames` | `number` | `Infinity` | The maximum number of frames to process before stopping. Used to prevent endless flush cycles. | - | +| `now` | () => `number` | `undefined` | A getter method that returns a number representing the current time (at the time this function was called) according to the scheduler's own internal clock. | `AsyncScheduler.now` | +| ~~`frameTimeFactor`~~ | `number` | `10` | **Deprecated** Not used in VirtualTimeScheduler directly. Will be removed in v8. | - | +| `now` | () => `number` | `dateTimestampProvider.now` | - | `AsyncScheduler.now` | + +## Methods + +### flush() + +```ts +flush(): void; +``` + +Defined in: [rxjs/src/internal/scheduler/VirtualTimeScheduler.ts:40](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/scheduler/VirtualTimeScheduler.ts#L40) + +Prompt the Scheduler to execute all of its queued actions, therefore +clearing its queue. + +#### Returns + +`void` + +#### Overrides + +```ts +AsyncScheduler.flush; +``` + +### schedule() + +```ts +schedule<>( + work: (this: SchedulerAction, state?: T) => void, + delay: number, + state?: T): Subscription; +``` + +Defined in: [rxjs/src/internal/Scheduler.ts:57](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Scheduler.ts#L57) + +Schedules a function, `work`, for execution. May happen at some point in +the future, according to the `delay` parameter, if specified. May be passed +some context object, `state`, which will be passed to the `work` function. + +The given arguments will be processed an stored as an Action object in a +queue of actions. + +#### Parameters + +| Parameter | Type | Default value | Description | +| --------- | ----------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ | +| `work` | (`this`: [`SchedulerAction`](../interfaces/SchedulerAction.md)\<`T`\>, `state?`: `T`) => `void` | `undefined` | A function representing a task, or some unit of work to be executed by the Scheduler. | +| `delay` | `number` | `0` | Time to wait before executing the work, where the time unit is implicit and defined by the Scheduler itself. | +| `state?` | `T` | `undefined` | Some contextual data that the `work` function uses when called by the Scheduler. | + +#### Returns + +[`Subscription`](Subscription.md) + +A subscription in order to be able to unsubscribe the scheduled work. + +#### Inherited from + +```ts +AsyncScheduler.schedule; +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/animationFrames.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/animationFrames.md new file mode 100644 index 0000000000..be062f0ca3 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/animationFrames.md @@ -0,0 +1,93 @@ +[API](../../index.md) / [rxjs](../index.md) / animationFrames + +# Function: animationFrames() + +```ts +function animationFrames(timestampProvider?: TimestampProvider): Observable<{ + elapsed: number; + timestamp: number; +}>; +``` + +Defined in: [rxjs/src/internal/observable/dom/animationFrames.ts:75](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/dom/animationFrames.ts#L75) + +An observable of animation frames + +Emits the amount of time elapsed since subscription and the timestamp on each animation frame. +Defaults to milliseconds provided to the requestAnimationFrame's callback. Does not end on its own. + +Every subscription will start a separate animation loop. Since animation frames are always scheduled +by the browser to occur directly before a repaint, scheduling more than one animation frame synchronously +should not be much different or have more overhead than looping over an array of events during +a single animation frame. However, if for some reason the developer would like to ensure the +execution of animation-related handlers are all executed during the same task by the engine, +the `share` operator can be used. + +This is useful for setting up animations with RxJS. + +## Parameters + +| Parameter | Type | Description | +| -------------------- | --------------------------------------------------------- | --------------------------------------------------------------- | +| `timestampProvider?` | [`TimestampProvider`](../interfaces/TimestampProvider.md) | An object with a `now` method that provides a numeric timestamp | + +## Returns + +[`Observable`](../classes/Observable.md)\<\{ +`elapsed`: `number`; +`timestamp`: `number`; +\}\> + +## Example + +Tweening a div to move it on the screen + +```ts +import { animationFrames, map, takeWhile, endWith } from 'rxjs'; + +function tween(start: number, end: number, duration: number) { + const diff = end - start; + return animationFrames().pipe( + // Figure out what percentage of time has passed + map(({ elapsed }) => elapsed / duration), + // Take the vector while less than 100% + takeWhile((v) => v < 1), + // Finish with 100% + endWith(1), + // Calculate the distance traveled between start and end + map((v) => v * diff + start) + ); +} + +// Setup a div for us to move around +const div = document.createElement('div'); +document.body.appendChild(div); +div.style.position = 'absolute'; +div.style.width = '40px'; +div.style.height = '40px'; +div.style.backgroundColor = 'lime'; +div.style.transform = 'translate3d(10px, 0, 0)'; + +tween(10, 200, 4000).subscribe((x) => { + div.style.transform = `translate3d(${x}px, 0, 0)`; +}); +``` + +Providing a custom timestamp provider + +```ts +import { animationFrames, TimestampProvider } from 'rxjs'; + +// A custom timestamp provider +let now = 0; +const customTSProvider: TimestampProvider = { + now() { + return now++; + }, +}; + +const source$ = animationFrames(customTSProvider); + +// Log increasing numbers 0...1...2... on every animation frame. +source$.subscribe(({ elapsed }) => console.log(elapsed)); +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/audit.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/audit.md new file mode 100644 index 0000000000..d49c1906a3 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/audit.md @@ -0,0 +1,63 @@ +[API](../../index.md) / [rxjs](../index.md) / audit + +# Function: audit() + +```ts +function audit<>(durationSelector: (value: T) => ObservableInput): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/audit.ts:50](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/audit.ts#L50) + +Ignores source values for a duration determined by another Observable, then +emits the most recent value from the source Observable, then repeats this +process. + +It's like [auditTime](auditTime.md), but the silencing +duration is determined by a second Observable. + +
Marble diagram +Marble diagram
+ +`audit` is similar to `throttle`, but emits the last value from the silenced +time window, instead of the first value. `audit` emits the most recent value +from the source Observable on the output Observable as soon as its internal +timer becomes disabled, and ignores source values while the timer is enabled. +Initially, the timer is disabled. As soon as the first source value arrives, +the timer is enabled by calling the `durationSelector` function with the +source value, which returns the "duration" Observable. When the duration +Observable emits a value, the timer is disabled, then the most +recent source value is emitted on the output Observable, and this process +repeats for the next source value. + +## Parameters + +| Parameter | Type | Description | +| ------------------ | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `durationSelector` | (`value`: `T`) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | A function that receives a value from the source Observable, for computing the silencing duration, returned as an Observable or a Promise. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that performs rate-limiting of +emissions from the source Observable. + +## Example + +Emit clicks at a rate of at most one click per second + +```ts +import { fromEvent, audit, interval } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(audit((ev) => interval(1000))); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [auditTime](auditTime.md) +- [debounce](debounce.md) +- [delayWhen](delayWhen.md) +- [sample](sample.md) +- [throttle](throttle.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/auditTime.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/auditTime.md new file mode 100644 index 0000000000..cca91fec2e --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/auditTime.md @@ -0,0 +1,63 @@ +[API](../../index.md) / [rxjs](../index.md) / auditTime + +# Function: auditTime() + +```ts +function auditTime<>(duration: number, scheduler: SchedulerLike): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/auditTime.ts:53](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/auditTime.ts#L53) + +Ignores source values for `duration` milliseconds, then emits the most recent +value from the source Observable, then repeats this process. + +When it sees a source value, it ignores that plus +the next ones for `duration` milliseconds, and then it emits the most recent +value from the source. + +![](/images/marble-diagrams/auditTime.png) + +`auditTime` is similar to `throttleTime`, but emits the last value from the +silenced time window, instead of the first value. `auditTime` emits the most +recent value from the source Observable on the output Observable as soon as +its internal timer becomes disabled, and ignores source values while the +timer is enabled. Initially, the timer is disabled. As soon as the first +source value arrives, the timer is enabled. After `duration` milliseconds (or +the time unit determined internally by the optional `scheduler`) has passed, +the timer is disabled, then the most recent source value is emitted on the +output Observable, and this process repeats for the next source value. +Optionally takes a [SchedulerLike](../interfaces/SchedulerLike.md) for managing timers. + +## Parameters + +| Parameter | Type | Default value | Description | +| ----------- | ------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `duration` | `number` | `undefined` | Time to wait before emitting the most recent source value, measured in milliseconds or the time unit determined internally by the optional `scheduler`. | +| `scheduler` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | `asyncScheduler` | The [SchedulerLike](../interfaces/SchedulerLike.md) to use for managing the timers that handle the rate-limiting behavior. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that performs rate-limiting of +emissions from the source Observable. + +## Example + +Emit clicks at a rate of at most one click per second + +```ts +import { fromEvent, auditTime } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(auditTime(1000)); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [audit](audit.md) +- [debounceTime](debounceTime.md) +- [delay](delay.md) +- [sampleTime](sampleTime.md) +- [throttleTime](throttleTime.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/bindCallback.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/bindCallback.md new file mode 100644 index 0000000000..2a344c7e3b --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/bindCallback.md @@ -0,0 +1,218 @@ +[API](../../index.md) / [rxjs](../index.md) / bindCallback + +# Function: bindCallback() + +> Converts a callback API to a function that returns an Observable. + +## Description + +Give it a function `f` of type `f(x, callback)` and +it will return a function `g` that when called as `g(x)` will output an +Observable. + +`bindCallback` is not an operator because its input and output are not +Observables. The input is a function `func` with some parameters. The +last parameter must be a callback function that `func` calls when it is +done. + +The output of `bindCallback` is a function that takes the same parameters +as `func`, except the last one (the callback). When the output function +is called with arguments it will return an Observable. If function `func` +calls its callback with one argument, the Observable will emit that value. +If on the other hand the callback is called with multiple values the resulting +Observable will emit an array with said values as arguments. + +It is **very important** to remember that input function `func` is not called +when the output function is, but rather when the Observable returned by the output +function is subscribed. This means if `func` makes an AJAX request, that request +will be made every time someone subscribes to the resulting Observable, but not before. + +The last optional parameter - `scheduler` - can be used to control when the call +to `func` happens after someone subscribes to Observable, as well as when results +passed to callback will be emitted. By default, the subscription to an Observable calls `func` +synchronously, but using [asyncScheduler](../variables/asyncScheduler.md) as the last parameter will defer the call to `func`, +just like wrapping the call in `setTimeout` with a timeout of `0` would. If you were to use the async Scheduler +and call `subscribe` on the output Observable, all function calls that are currently executing +will end before `func` is invoked. + +By default, results passed to the callback are emitted immediately after `func` invokes the callback. +In particular, if the callback is called synchronously, then the subscription of the resulting Observable +will call the `next` function synchronously as well. If you want to defer that call, +you may use [asyncScheduler](../variables/asyncScheduler.md) just as before. This means that by using `Scheduler.async` you can +ensure that `func` always calls its callback asynchronously, thus avoiding terrifying Zalgo. + +Note that the Observable created by the output function will always emit a single value +and then complete immediately. If `func` calls the callback multiple times, values from subsequent +calls will not appear in the stream. If you need to listen for multiple calls, +you probably want to use [fromEvent](fromEvent.md) or [fromEventPattern](fromEventPattern.md) instead. + +If `func` depends on some context (`this` property) and is not already bound, the context of `func` +will be the context that the output function has at call time. In particular, if `func` +is called as a method of some object and if `func` is not already bound, in order to preserve the context +it is recommended that the context of the output function is set to that object as well. + +If the input function calls its callback in the "node style" (i.e. first argument to callback is +optional error parameter signaling whether the call failed or not), [bindNodeCallback](bindNodeCallback.md) +provides convenient error handling and probably is a better choice. +`bindCallback` will treat such functions the same as any other and error parameters +(whether passed or not) will always be interpreted as regular callback argument. + +## Example + +Convert jQuery's getJSON to an Observable API + +```ts +import { bindCallback } from 'rxjs'; +import * as jQuery from 'jquery'; + +// Suppose we have jQuery.getJSON('/my/url', callback) +const getJSONAsObservable = bindCallback(jQuery.getJSON); +const result = getJSONAsObservable('/my/url'); +result.subscribe( + (x) => console.log(x), + (e) => console.error(e) +); +``` + +Receive an array of arguments passed to a callback + +```ts +import { bindCallback } from 'rxjs'; + +const someFunction = (n, s, cb) => { + cb(n, s, { someProperty: 'someValue' }); +}; + +const boundSomeFunction = bindCallback(someFunction); +boundSomeFunction(5, 'some string').subscribe((values) => { + console.log(values); // [5, 'some string', {someProperty: 'someValue'}] +}); +``` + +Compare behaviour with and without `asyncScheduler` + +```ts +import { bindCallback, asyncScheduler } from 'rxjs'; + +function iCallMyCallbackSynchronously(cb) { + cb(); +} + +const boundSyncFn = bindCallback(iCallMyCallbackSynchronously); +const boundAsyncFn = bindCallback(iCallMyCallbackSynchronously, null, asyncScheduler); + +boundSyncFn().subscribe(() => console.log('I was sync!')); +boundAsyncFn().subscribe(() => console.log('I was async!')); +console.log('This happened...'); + +// Logs: +// I was sync! +// This happened... +// I was async! +``` + +Use `bindCallback` on an object method + +```ts +import { bindCallback } from 'rxjs'; + +const boundMethod = bindCallback(someObject.methodWithCallback); +boundMethod + .call(someObject) // make sure methodWithCallback has access to someObject + .subscribe(subscriber); +``` + +## See + +- [bindNodeCallback](bindNodeCallback.md) +- [from](from.md) + +## Parameters + +### `callbackFunc` + +A function with a callback as the last parameter. + +### `resultSelector` + +A mapping function used to transform callback events. + +### `scheduler` + +The scheduler on which to schedule the callbacks. + +## Returns + +`A` + +function which returns the Observable that delivers the same values the callback would deliver. + +## Call Signature + +```ts +function bindCallback( + callbackFunc: (...args: any[]) => void, + resultSelector: (...args: any[]) => any, + scheduler?: SchedulerLike +): (...args: any[]) => Observable; +``` + +Defined in: [rxjs/src/internal/observable/bindCallback.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/bindCallback.ts#L6) + +### Parameters + +| Parameter | Type | +| ---------------- | ------------------------------------------------- | +| `callbackFunc` | (...`args`: `any`[]) => `void` | +| `resultSelector` | (...`args`: `any`[]) => `any` | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +```ts +(...args: any[]): Observable; +``` + +#### Parameters + +| Parameter | Type | +| --------- | ------- | +| ...`args` | `any`[] | + +#### Returns + +[`Observable`](../classes/Observable.md)\<`any`\> + +## Call Signature + +```ts +function bindCallback<>( + callbackFunc: (...args: [...A[], (...res: R) => void]) => void, + schedulerLike?: SchedulerLike +): (...arg: A) => Observable[0] : R>; +``` + +Defined in: [rxjs/src/internal/observable/bindCallback.ts:13](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/bindCallback.ts#L13) + +### Parameters + +| Parameter | Type | +| ---------------- | -------------------------------------------------------------- | +| `callbackFunc` | (...`args`: \[`...A[]`, (...`res`: `R`) => `void`\]) => `void` | +| `schedulerLike?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +```ts +(...arg: A): Observable[0] : R>; +``` + +#### Parameters + +| Parameter | Type | +| --------- | ---- | +| ...`arg` | `A` | + +#### Returns + +[`Observable`](../classes/Observable.md)\<`R` _extends_ \[\] ? `void` : `R` _extends_ \[`any`\] ? `R`\<`R`\>\[`0`\] : `R`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/bindNodeCallback.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/bindNodeCallback.md new file mode 100644 index 0000000000..134d707242 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/bindNodeCallback.md @@ -0,0 +1,199 @@ +[API](../../index.md) / [rxjs](../index.md) / bindNodeCallback + +# Function: bindNodeCallback() + +> Converts a Node.js-style callback API to a function that returns an +> Observable. + +## Description + +It's just like [bindCallback](bindCallback.md), but the +callback is expected to be of type `callback(error, result)`. + +`bindNodeCallback` is not an operator because its input and output are not +Observables. The input is a function `func` with some parameters, but the +last parameter must be a callback function that `func` calls when it is +done. The callback function is expected to follow Node.js conventions, +where the first argument to the callback is an error object, signaling +whether call was successful. If that object is passed to callback, it means +something went wrong. + +The output of `bindNodeCallback` is a function that takes the same +parameters as `func`, except the last one (the callback). When the output +function is called with arguments, it will return an Observable. +If `func` calls its callback with error parameter present, Observable will +error with that value as well. If error parameter is not passed, Observable will emit +second parameter. If there are more parameters (third and so on), +Observable will emit an array with all arguments, except first error argument. + +Note that `func` will not be called at the same time output function is, +but rather whenever resulting Observable is subscribed. By default call to +`func` will happen synchronously after subscription, but that can be changed +with proper `scheduler` provided as optional third parameter. [SchedulerLike](../interfaces/SchedulerLike.md) +can also control when values from callback will be emitted by Observable. +To find out more, check out documentation for [bindCallback](bindCallback.md), where +[SchedulerLike](../interfaces/SchedulerLike.md) works exactly the same. + +As in [bindCallback](bindCallback.md), context (`this` property) of input function will be set to context +of returned function, when it is called. + +After Observable emits value, it will complete immediately. This means +even if `func` calls callback again, values from second and consecutive +calls will never appear on the stream. If you need to handle functions +that call callbacks multiple times, check out [fromEvent](fromEvent.md) or +[fromEventPattern](fromEventPattern.md) instead. + +Note that `bindNodeCallback` can be used in non-Node.js environments as well. +"Node.js-style" callbacks are just a convention, so if you write for +browsers or any other environment and API you use implements that callback style, +`bindNodeCallback` can be safely used on that API functions as well. + +Remember that Error object passed to callback does not have to be an instance +of JavaScript built-in `Error` object. In fact, it does not even have to an object. +Error parameter of callback function is interpreted as "present", when value +of that parameter is truthy. It could be, for example, non-zero number, non-empty +string or boolean `true`. In all of these cases resulting Observable would error +with that value. This means usually regular style callbacks will fail very often when +`bindNodeCallback` is used. If your Observable errors much more often then you +would expect, check if callback really is called in Node.js-style and, if not, +switch to [bindCallback](bindCallback.md) instead. + +Note that even if error parameter is technically present in callback, but its value +is falsy, it still won't appear in array emitted by Observable. + +## Example + +Read a file from the filesystem and get the data as an Observable + +```ts +import * as fs from 'fs'; +const readFileAsObservable = bindNodeCallback(fs.readFile); +const result = readFileAsObservable('./roadNames.txt', 'utf8'); +result.subscribe( + (x) => console.log(x), + (e) => console.error(e) +); +``` + +Use on function calling callback with multiple arguments + +```ts +someFunction((err, a, b) => { + console.log(err); // null + console.log(a); // 5 + console.log(b); // "some string" +}); +const boundSomeFunction = bindNodeCallback(someFunction); +boundSomeFunction().subscribe((value) => { + console.log(value); // [5, "some string"] +}); +``` + +Use on function calling callback in regular style + +```ts +someFunction(a => { + console.log(a); // 5 +}); +const boundSomeFunction = bindNodeCallback(someFunction); +boundSomeFunction() +.subscribe( + value => {} // never gets called + err => console.log(err) // 5 +); +``` + +## See + +- [bindCallback](bindCallback.md) +- [from](from.md) + +## Parameters + +### `callbackFunc` + +Function with a Node.js-style callback as the last parameter. + +### `resultSelector` + +A mapping function used to transform callback events. + +### `scheduler` + +The scheduler on which to schedule the callbacks. + +## Returns + +`A` + +function which returns the Observable that delivers the same values the Node.js callback would deliver. + +## Call Signature + +```ts +function bindNodeCallback( + callbackFunc: (...args: any[]) => void, + resultSelector: (...args: any[]) => any, + scheduler?: SchedulerLike +): (...args: any[]) => Observable; +``` + +Defined in: [rxjs/src/internal/observable/bindNodeCallback.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/bindNodeCallback.ts#L6) + +### Parameters + +| Parameter | Type | +| ---------------- | ------------------------------------------------- | +| `callbackFunc` | (...`args`: `any`[]) => `void` | +| `resultSelector` | (...`args`: `any`[]) => `any` | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +```ts +(...args: any[]): Observable; +``` + +#### Parameters + +| Parameter | Type | +| --------- | ------- | +| ...`args` | `any`[] | + +#### Returns + +[`Observable`](../classes/Observable.md)\<`any`\> + +## Call Signature + +```ts +function bindNodeCallback<>( + callbackFunc: (...args: [...A[], (err: any, ...res: R) => void]) => void, + schedulerLike?: SchedulerLike +): (...arg: A) => Observable[0] : R>; +``` + +Defined in: [rxjs/src/internal/observable/bindNodeCallback.ts:13](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/bindNodeCallback.ts#L13) + +### Parameters + +| Parameter | Type | +| ---------------- | ---------------------------------------------------------------------------- | +| `callbackFunc` | (...`args`: \[`...A[]`, (`err`: `any`, ...`res`: `R`) => `void`\]) => `void` | +| `schedulerLike?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +```ts +(...arg: A): Observable[0] : R>; +``` + +#### Parameters + +| Parameter | Type | +| --------- | ---- | +| ...`arg` | `A` | + +#### Returns + +[`Observable`](../classes/Observable.md)\<`R` _extends_ \[\] ? `void` : `R` _extends_ \[`any`\] ? `R`\<`R`\>\[`0`\] : `R`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/buffer.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/buffer.md new file mode 100644 index 0000000000..bc4cc1c930 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/buffer.md @@ -0,0 +1,56 @@ +[API](../../index.md) / [rxjs](../index.md) / buffer + +# Function: buffer() + +```ts +function buffer<>(closingNotifier: ObservableInput): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/buffer.ts:43](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/buffer.ts#L43) + +Buffers the source Observable values until `closingNotifier` emits. + +Collects values from the past as an array, and emits +that array only when another Observable emits. + +![](/images/marble-diagrams/buffer.png) + +Buffers the incoming Observable values until the given `closingNotifier` +`ObservableInput` (that internally gets converted to an Observable) +emits a value, at which point it emits the buffer on the output +Observable and starts a new buffer internally, awaiting the next time +`closingNotifier` emits. + +## Parameters + +| Parameter | Type | Description | +| ----------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------ | +| `closingNotifier` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | An `ObservableInput` that signals the buffer to be emitted on the output Observable. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T`[]\> + +A function that returns an Observable of buffers, which are arrays +of values. + +## Example + +On every click, emit array of most recent interval events + +```ts +import { fromEvent, interval, buffer } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const intervalEvents = interval(1000); +const buffered = intervalEvents.pipe(buffer(clicks)); +buffered.subscribe((x) => console.log(x)); +``` + +## See + +- [bufferCount](bufferCount.md) +- [bufferTime](bufferTime.md) +- [bufferToggle](bufferToggle.md) +- [bufferWhen](bufferWhen.md) +- [window](window.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/bufferCount.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/bufferCount.md new file mode 100644 index 0000000000..6773003bbd --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/bufferCount.md @@ -0,0 +1,67 @@ +[API](../../index.md) / [rxjs](../index.md) / bufferCount + +# Function: bufferCount() + +```ts +function bufferCount<>(bufferSize: number, startBufferEvery: number | null): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/bufferCount.ts:56](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/bufferCount.ts#L56) + +Buffers the source Observable values until the size hits the maximum +`bufferSize` given. + +Collects values from the past as an array, and emits +that array only when its size reaches `bufferSize`. + +![](/images/marble-diagrams/bufferCount.png) + +Buffers a number of values from the source Observable by `bufferSize` then +emits the buffer and clears it, and starts a new buffer each +`startBufferEvery` values. If `startBufferEvery` is not provided or is +`null`, then new buffers are started immediately at the start of the source +and when each buffer closes and is emitted. + +## Parameters + +| Parameter | Type | Default value | Description | +| ------------------ | ------------------ | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `bufferSize` | `number` | `undefined` | The maximum size of the buffer emitted. | +| `startBufferEvery` | `number` \| `null` | `null` | Interval at which to start a new buffer. For example if `startBufferEvery` is `2`, then a new buffer will be started on every other value from the source. A new buffer is started at the beginning of the source by default. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T`[]\> + +A function that returns an Observable of arrays of buffered values. + +## Example + +Emit the last two click events as an array + +```ts +import { fromEvent, bufferCount } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const buffered = clicks.pipe(bufferCount(2)); +buffered.subscribe((x) => console.log(x)); +``` + +On every click, emit the last two click events as an array + +```ts +import { fromEvent, bufferCount } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const buffered = clicks.pipe(bufferCount(2, 1)); +buffered.subscribe((x) => console.log(x)); +``` + +## See + +- [buffer](buffer.md) +- [bufferTime](bufferTime.md) +- [bufferToggle](bufferToggle.md) +- [bufferWhen](bufferWhen.md) +- [pairwise](pairwise.md) +- [windowCount](windowCount.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/bufferTime.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/bufferTime.md new file mode 100644 index 0000000000..e78c982c73 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/bufferTime.md @@ -0,0 +1,140 @@ +[API](../../index.md) / [rxjs](../index.md) / bufferTime + +# Function: bufferTime() + +> Buffers the source Observable values for a specific time period. + +## Description + +Collects values from the past as an array, and emits +those arrays periodically in time. + +![](/images/marble-diagrams/bufferTime.png) + +Buffers values from the source for a specific time duration `bufferTimeSpan`. +Unless the optional argument `bufferCreationInterval` is given, it emits and +resets the buffer every `bufferTimeSpan` milliseconds. If +`bufferCreationInterval` is given, this operator opens the buffer every +`bufferCreationInterval` milliseconds and closes (emits and resets) the +buffer every `bufferTimeSpan` milliseconds. When the optional argument +`maxBufferSize` is specified, the buffer will be closed either after +`bufferTimeSpan` milliseconds or when it contains `maxBufferSize` elements. + +## Example + +Every second, emit an array of the recent click events + +```ts +import { fromEvent, bufferTime } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const buffered = clicks.pipe(bufferTime(1000)); +buffered.subscribe((x) => console.log(x)); +``` + +Every 5 seconds, emit the click events from the next 2 seconds + +```ts +import { fromEvent, bufferTime } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const buffered = clicks.pipe(bufferTime(2000, 5000)); +buffered.subscribe((x) => console.log(x)); +``` + +## See + +- [buffer](buffer.md) +- [bufferCount](bufferCount.md) +- [bufferToggle](bufferToggle.md) +- [bufferWhen](bufferWhen.md) +- [windowTime](windowTime.md) + +- `bufferCreationInterval` - the interval at which to start new buffers; +- `maxBufferSize` - the maximum buffer size; +- `scheduler` - the scheduler on which to schedule the intervals that determine buffer boundaries. + +## Parameters + +### `bufferTimeSpan` + +The amount of time to fill each buffer array. + +### `otherArgs` + +Other configuration arguments such as: + +## Returns + +`A` + +function that returns an Observable of arrays of buffered values. + +## Call Signature + +```ts +function bufferTime<>(bufferTimeSpan: number, scheduler?: SchedulerLike): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/bufferTime.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/bufferTime.ts#L8) + +### Parameters + +| Parameter | Type | +| ---------------- | ------------------------------------------------- | +| `bufferTimeSpan` | `number` | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T`[]\> + +## Call Signature + +```ts +function bufferTime<>( + bufferTimeSpan: number, + bufferCreationInterval: number | null | undefined, + scheduler?: SchedulerLike +): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/bufferTime.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/bufferTime.ts#L9) + +### Parameters + +| Parameter | Type | +| ------------------------ | ------------------------------------------------- | +| `bufferTimeSpan` | `number` | +| `bufferCreationInterval` | `number` \| `null` \| `undefined` | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T`[]\> + +## Call Signature + +```ts +function bufferTime<>( + bufferTimeSpan: number, + bufferCreationInterval: number | null | undefined, + maxBufferSize: number, + scheduler?: SchedulerLike +): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/bufferTime.ts:14](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/bufferTime.ts#L14) + +### Parameters + +| Parameter | Type | +| ------------------------ | ------------------------------------------------- | +| `bufferTimeSpan` | `number` | +| `bufferCreationInterval` | `number` \| `null` \| `undefined` | +| `maxBufferSize` | `number` | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T`[]\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/bufferToggle.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/bufferToggle.md new file mode 100644 index 0000000000..bcfd44cca7 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/bufferToggle.md @@ -0,0 +1,56 @@ +[API](../../index.md) / [rxjs](../index.md) / bufferToggle + +# Function: bufferToggle() + +```ts +function bufferToggle<>(openings: ObservableInput, closingSelector: (value: O) => ObservableInput): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/bufferToggle.ts:49](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/bufferToggle.ts#L49) + +Buffers the source Observable values starting from an emission from +`openings` and ending when the output of `closingSelector` emits. + +Collects values from the past as an array. Starts +collecting only when `opening` emits, and calls the `closingSelector` +function to get an Observable that tells when to close the buffer. + +![](/images/marble-diagrams/bufferToggle.png) + +Buffers values from the source by opening the buffer via signals from an +Observable provided to `openings`, and closing and sending the buffers when +a Subscribable or Promise returned by the `closingSelector` function emits. + +## Parameters + +| Parameter | Type | Description | +| ----------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `openings` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`O`\> | A Subscribable or Promise of notifications to start new buffers. | +| `closingSelector` | (`value`: `O`) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | A function that takes the value emitted by the `openings` observable and returns a Subscribable or Promise, which, when it emits, signals that the associated buffer should be emitted and cleared. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T`[]\> + +A function that returns an Observable of arrays of buffered values. + +## Example + +Every other second, emit the click events from the next 500ms + +```ts +import { fromEvent, interval, bufferToggle, EMPTY } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const openings = interval(1000); +const buffered = clicks.pipe(bufferToggle(openings, (i) => (i % 2 ? interval(500) : EMPTY))); +buffered.subscribe((x) => console.log(x)); +``` + +## See + +- [buffer](buffer.md) +- [bufferCount](bufferCount.md) +- [bufferTime](bufferTime.md) +- [bufferWhen](bufferWhen.md) +- [windowToggle](windowToggle.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/bufferWhen.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/bufferWhen.md new file mode 100644 index 0000000000..989d6dadb4 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/bufferWhen.md @@ -0,0 +1,55 @@ +[API](../../index.md) / [rxjs](../index.md) / bufferWhen + +# Function: bufferWhen() + +```ts +function bufferWhen<>(closingSelector: () => ObservableInput): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/bufferWhen.ts:44](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/bufferWhen.ts#L44) + +Buffers the source Observable values, using a factory function of closing +Observables to determine when to close, emit, and reset the buffer. + +Collects values from the past as an array. When it +starts collecting values, it calls a function that returns an Observable that +tells when to close the buffer and restart collecting. + +
Marble diagram +Marble diagram
+ +Opens a buffer immediately, then closes the buffer when the observable +returned by calling `closingSelector` function emits a value. When it closes +the buffer, it immediately opens a new buffer and repeats the process. + +## Parameters + +| Parameter | Type | Description | +| ----------------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `closingSelector` | () => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | A function that takes no arguments and returns an Observable that signals buffer closure. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T`[]\> + +A function that returns an Observable of arrays of buffered values. + +## Example + +Emit an array of the last clicks every [1-5] random seconds + +```ts +import { fromEvent, bufferWhen, interval } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const buffered = clicks.pipe(bufferWhen(() => interval(1000 + Math.random() * 4000))); +buffered.subscribe((x) => console.log(x)); +``` + +## See + +- [buffer](buffer.md) +- [bufferCount](bufferCount.md) +- [bufferTime](bufferTime.md) +- [bufferToggle](bufferToggle.md) +- [windowWhen](windowWhen.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/catchError.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/catchError.md new file mode 100644 index 0000000000..c62bb492a2 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/catchError.md @@ -0,0 +1,38 @@ +[API](../../index.md) / [rxjs](../index.md) / catchError + +# Function: catchError() + +> Catches errors on the observable to be handled by returning a new observable or throwing an error. + +## Description + + +It only listens to the error channel and ignores notifications. +Handles errors from the source observable, and maps them to a new observable. +The error may also be rethrown, or a new error can be thrown to emit an error from the result. + + +![](/images/marble-diagrams/catch.png) + +This operator handles errors, but forwards along all other events to the resulting observable. +If the source observable terminates with an error, it will map that error to a new observable, +subscribe to it, and forward all of its events to the resulting observable. + +```ts +function catchError<>(selector: (err: any, caught: Observable) => O): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/catchError.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/catchError.ts#L5) + +## Parameters + +| Parameter | Type | Description | +| ---------- | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `selector` | (`err`: `any`, `caught`: [`Observable`](../classes/Observable.md)\<`T`\>) => `O` | A function that takes as arguments `err`, which is the error, and `caught`, which is the source observable, in case you'd like to "retry" that observable by returning it again. Whatever observable is returned by the `selector` will be used to continue the observable chain. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +A function that returns an Observable that originates from either +the source or the Observable returned by the `selector` function. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/combineLatest.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/combineLatest.md new file mode 100644 index 0000000000..d7748386bc --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/combineLatest.md @@ -0,0 +1,268 @@ +[API](../../index.md) / [rxjs](../index.md) / combineLatest + +# Function: combineLatest() + +> Combines multiple Observables to create an Observable whose values are +> calculated from the latest values of each of its input Observables. + +## Description + +Whenever any input Observable emits a value, it +computes a formula using the latest values from all the inputs, then emits +the output of that formula. + +![](/images/marble-diagrams/combineLatest.png) + +`combineLatest` combines the values from all the Observables passed in the +observables array. This is done by subscribing to each Observable in order and, +whenever any Observable emits, collecting an array of the most recent +values from each Observable. So if you pass `n` Observables to this operator, +the returned Observable will always emit an array of `n` values, in an order +corresponding to the order of the passed Observables (the value from the first Observable +will be at index 0 of the array and so on). + +Static version of `combineLatest` accepts an array of Observables. Note that an array of +Observables is a good choice, if you don't know beforehand how many Observables +you will combine. Passing an empty array will result in an Observable that +completes immediately. + +To ensure the output array always has the same length, `combineLatest` will +actually wait for all input Observables to emit at least once, +before it starts emitting results. This means if some Observable emits +values before other Observables started emitting, all these values but the last +will be lost. On the other hand, if some Observable does not emit a value but +completes, resulting Observable will complete at the same moment without +emitting anything, since it will now be impossible to include a value from the +completed Observable in the resulting array. Also, if some input Observable does +not emit any value and never completes, `combineLatest` will also never emit +and never complete, since, again, it will wait for all streams to emit some +value. + +If at least one Observable was passed to `combineLatest` and all passed Observables +emitted something, the resulting Observable will complete when all combined +streams complete. So even if some Observable completes, the result of +`combineLatest` will still emit values when other Observables do. In case +of a completed Observable, its value from now on will always be the last +emitted value. On the other hand, if any Observable errors, `combineLatest` +will error immediately as well, and all other Observables will be unsubscribed. + +## Example + +Combine two timer Observables + +```ts +import { timer, combineLatest } from 'rxjs'; + +const firstTimer = timer(0, 1000); // emit 0, 1, 2... after every second, starting from now +const secondTimer = timer(500, 1000); // emit 0, 1, 2... after every second, starting 0,5s from now +const combinedTimers = combineLatest([firstTimer, secondTimer]); +combinedTimers.subscribe((value) => console.log(value)); +// Logs +// [0, 0] after 0.5s +// [1, 0] after 1s +// [1, 1] after 1.5s +// [2, 1] after 2s +``` + +Combine a dictionary of Observables + +```ts +import { of, delay, startWith, combineLatest } from 'rxjs'; + +const observables = { + a: of(1).pipe(delay(1000), startWith(0)), + b: of(5).pipe(delay(5000), startWith(0)), + c: of(10).pipe(delay(10000), startWith(0)), +}; +const combined = combineLatest(observables); +combined.subscribe((value) => console.log(value)); +// Logs +// { a: 0, b: 0, c: 0 } immediately +// { a: 1, b: 0, c: 0 } after 1s +// { a: 1, b: 5, c: 0 } after 5s +// { a: 1, b: 5, c: 10 } after 10s +``` + +Combine an array of Observables + +```ts +import { of, delay, startWith, combineLatest } from 'rxjs'; + +const observables = [1, 5, 10].map((n) => + of(n).pipe( + delay(n * 1000), // emit 0 and then emit n after n seconds + startWith(0) + ) +); +const combined = combineLatest(observables); +combined.subscribe((value) => console.log(value)); +// Logs +// [0, 0, 0] immediately +// [1, 0, 0] after 1s +// [1, 5, 0] after 5s +// [1, 5, 10] after 10s +``` + +Use map operator to dynamically calculate the Body-Mass Index + +```ts +import { of, combineLatest, map } from 'rxjs'; + +const weight = of(70, 72, 76, 79, 75); +const height = of(1.76, 1.77, 1.78); +const bmi = combineLatest([weight, height]).pipe(map(([w, h]) => w / (h * h))); +bmi.subscribe((x) => console.log('BMI is ' + x)); + +// With output to console: +// BMI is 24.212293388429753 +// BMI is 23.93948099205209 +// BMI is 23.671253629592222 +``` + +## See + +- [combineLatestAll](combineLatestAll.md) +- [merge](merge.md) +- [withLatestFrom](withLatestFrom.md) + +to combine with each other. If the last parameter is the function, it will be used to project the +values from the combined latest values into a new value on the output Observable. + +## Parameters + +### `args` + +Any number of `ObservableInput`s provided either as an array or as an object + +## Returns + +`An` + +Observable of projected values from the most recent values from each , or an array of the most recent values from each . + +## Call Signature + +```ts +function combineLatest<>(arg: T): Observable; +``` + +Defined in: [rxjs/src/internal/observable/combineLatest.ts:21](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/combineLatest.ts#L21) + +You have passed `any` here, we can't figure out if it is +an array or an object, so you're getting `unknown`. Use better types. + +### Parameters + +| Parameter | Type | Description | +| --------- | ---- | ------------------------ | +| `arg` | `T` | Something typed as `any` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`unknown`\> + +## Call Signature + +```ts +function combineLatest(sources: []): Observable; +``` + +Defined in: [rxjs/src/internal/observable/combineLatest.ts:24](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/combineLatest.ts#L24) + +You have passed `any` here, we can't figure out if it is +an array or an object, so you're getting `unknown`. Use better types. + +### Parameters + +| Parameter | Type | +| --------- | ---- | +| `sources` | \[\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`never`\> + +## Call Signature + +```ts +function combineLatest<>(sources: readonly [ObservableInputTuple]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/combineLatest.ts:25](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/combineLatest.ts#L25) + +You have passed `any` here, we can't figure out if it is +an array or an object, so you're getting `unknown`. Use better types. + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------------------------------- | +| `sources` | readonly \[[`ObservableInputTuple`](../type-aliases/ObservableInputTuple.md)\<`A`\>\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`A`\> + +## Call Signature + +```ts +function combineLatest<>(sources: readonly [ObservableInputTuple], resultSelector: (...values: A) => R): Observable; +``` + +Defined in: [rxjs/src/internal/observable/combineLatest.ts:26](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/combineLatest.ts#L26) + +You have passed `any` here, we can't figure out if it is +an array or an object, so you're getting `unknown`. Use better types. + +### Parameters + +| Parameter | Type | +| ---------------- | ------------------------------------------------------------------------------------- | +| `sources` | readonly \[[`ObservableInputTuple`](../type-aliases/ObservableInputTuple.md)\<`A`\>\] | +| `resultSelector` | (...`values`: `A`) => `R` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`R`\> + +## Call Signature + +```ts +function combineLatest(sourcesObject: { [key: string]: never; [key: number]: never; [key: symbol]: never }): Observable; +``` + +Defined in: [rxjs/src/internal/observable/combineLatest.ts:32](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/combineLatest.ts#L32) + +You have passed `any` here, we can't figure out if it is +an array or an object, so you're getting `unknown`. Use better types. + +### Parameters + +| Parameter | Type | +| --------------- | ----------------------------------------------------------------------------------------------- | +| `sourcesObject` | \{ \[`key`: `string`\]: `never`; \[`key`: `number`\]: `never`; \[`key`: `symbol`\]: `never`; \} | + +### Returns + +[`Observable`](../classes/Observable.md)\<`never`\> + +## Call Signature + +```ts +function combineLatest<>(sourcesObject: T): Observable<{ [K in string | number | symbol]: ObservedValueOf }>; +``` + +Defined in: [rxjs/src/internal/observable/combineLatest.ts:33](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/combineLatest.ts#L33) + +You have passed `any` here, we can't figure out if it is +an array or an object, so you're getting `unknown`. Use better types. + +### Parameters + +| Parameter | Type | +| --------------- | ---- | +| `sourcesObject` | `T` | + +### Returns + +[`Observable`](../classes/Observable.md)\<\{ \[K in string \| number \| symbol\]: ObservedValueOf\ \}\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/combineLatestAll.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/combineLatestAll.md new file mode 100644 index 0000000000..6d7eb8579a --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/combineLatestAll.md @@ -0,0 +1,113 @@ +[API](../../index.md) / [rxjs](../index.md) / combineLatestAll + +# Function: combineLatestAll() + +> Flattens an Observable-of-Observables by applying [combineLatest](combineLatest.md) when the Observable-of-Observables completes. + +## Description + +`combineLatestAll` takes an Observable of Observables, and collects all Observables from it. Once the outer Observable completes, +it subscribes to all collected Observables and combines their values using the [combineLatest](combineLatest.md) strategy, such that: + +- Every time an inner Observable emits, the output Observable emits +- When the returned observable emits, it emits all of the latest values by: + - If a `project` function is provided, it is called with each recent value from each inner Observable in whatever order they + arrived, and the result of the `project` function is what is emitted by the output Observable. + - If there is no `project` function, an array of all the most recent values is emitted by the output Observable. + +## Example + +Map two click events to a finite interval Observable, then apply `combineLatestAll` + +```ts +import { fromEvent, map, interval, take, combineLatestAll } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const higherOrder = clicks.pipe( + map(() => interval(Math.random() * 2000).pipe(take(3))), + take(2) +); +const result = higherOrder.pipe(combineLatestAll()); + +result.subscribe((x) => console.log(x)); +``` + +## See + +- [combineLatest](combineLatest.md) +- [combineLatestWith](combineLatestWith.md) +- [mergeAll](mergeAll.md) + +Takes each of the most recent values from each collected inner Observable as arguments, in order. + +## Parameters + +### `project` + +optional function to map the most recent values from each inner Observable into a new result. + +## Returns + +`A` + +function that returns an Observable that flattens Observables emitted by the source Observable. + +## Call Signature + +```ts +function combineLatestAll<>(): OperatorFunction, T[]>; +``` + +Defined in: [rxjs/src/internal/operators/combineLatestAll.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/combineLatestAll.ts#L5) + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<[`ObservableInput`](../type-aliases/ObservableInput.md)\<`T`\>, `T`[]\> + +## Call Signature + +```ts +function combineLatestAll<>(): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/combineLatestAll.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/combineLatestAll.ts#L6) + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`any`, `T`[]\> + +## Call Signature + +```ts +function combineLatestAll<>(project: (...values: T[]) => R): OperatorFunction, R>; +``` + +Defined in: [rxjs/src/internal/operators/combineLatestAll.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/combineLatestAll.ts#L7) + +### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `project` | (...`values`: `T`[]) => `R` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<[`ObservableInput`](../type-aliases/ObservableInput.md)\<`T`\>, `R`\> + +## Call Signature + +```ts +function combineLatestAll<>(project: (...values: any[]) => R): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/combineLatestAll.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/combineLatestAll.ts#L8) + +### Parameters + +| Parameter | Type | +| --------- | ----------------------------- | +| `project` | (...`values`: `any`[]) => `R` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`any`, `R`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/combineLatestWith.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/combineLatestWith.md new file mode 100644 index 0000000000..fa0313cbe1 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/combineLatestWith.md @@ -0,0 +1,58 @@ +[API](../../index.md) / [rxjs](../index.md) / combineLatestWith + +# Function: combineLatestWith() + +```ts +function combineLatestWith<>(...otherSources: [...ObservableInputTuple[]]): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/combineLatestWith.ts:45](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/combineLatestWith.ts#L45) + +Create an observable that combines the latest values from all passed observables and the source +into arrays and emits them. + +Returns an observable, that when subscribed to, will subscribe to the source observable and all +sources provided as arguments. Once all sources emit at least one value, all of the latest values +will be emitted as an array. After that, every time any source emits a value, all of the latest values +will be emitted as an array. + +This is a useful operator for eagerly calculating values based off of changed inputs. + +## Parameters + +| Parameter | Type | Description | +| ----------------- | ---------------------------------- | ---------------------------------- | +| ...`otherSources` | \[`...ObservableInputTuple[]`\] | the other sources to subscribe to. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, \[`T`, `...rest: A[]`\]\> + +A function that returns an Observable that emits the latest +emissions from both source and provided Observables. + +## Example + +Simple concatenation of values from two inputs + +```ts +import { fromEvent, combineLatestWith, map } from 'rxjs'; + +// Setup: Add two inputs to the page +const input1 = document.createElement('input'); +document.body.appendChild(input1); +const input2 = document.createElement('input'); +document.body.appendChild(input2); + +// Get streams of changes +const input1Changes$ = fromEvent(input1, 'change'); +const input2Changes$ = fromEvent(input2, 'change'); + +// Combine the changes by adding them together +input1Changes$ + .pipe( + combineLatestWith(input2Changes$), + map(([e1, e2]) => (e1.target).value + ' - ' + (e2.target).value) + ) + .subscribe((x) => console.log(x)); +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/concat.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/concat.md new file mode 100644 index 0000000000..badcc342c6 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/concat.md @@ -0,0 +1,147 @@ +[API](../../index.md) / [rxjs](../index.md) / concat + +# Function: concat() + +> Creates an output Observable which sequentially emits all values from the first given +> Observable and then moves on to the next. + +## Description + +Concatenates multiple Observables together by +sequentially emitting their values, one Observable after the other. + +![](/images/marble-diagrams/concat.png) + +`concat` joins multiple Observables together, by subscribing to them one at a time and +merging their results into the output Observable. You can pass either an array of +Observables, or put them directly as arguments. Passing an empty array will result +in Observable that completes immediately. + +`concat` will subscribe to first input Observable and emit all its values, without +changing or affecting them in any way. When that Observable completes, it will +subscribe to then next Observable passed and, again, emit its values. This will be +repeated, until the operator runs out of Observables. When last input Observable completes, +`concat` will complete as well. At any given moment only one Observable passed to operator +emits values. If you would like to emit values from passed Observables concurrently, check out +[merge](merge.md) instead, especially with optional `concurrent` parameter. As a matter of fact, +`concat` is an equivalent of `merge` operator with `concurrent` parameter set to `1`. + +Note that if some input Observable never completes, `concat` will also never complete +and Observables following the one that did not complete will never be subscribed. On the other +hand, if some Observable simply completes immediately after it is subscribed, it will be +invisible for `concat`, which will just move on to the next Observable. + +If any Observable in chain errors, instead of passing control to the next Observable, +`concat` will error immediately as well. Observables that would be subscribed after +the one that emitted error, never will. + +If you pass to `concat` the same Observable many times, its stream of values +will be "replayed" on every subscription, which means you can repeat given Observable +as many times as you like. If passing the same Observable to `concat` 1000 times becomes tedious, +you can always use [repeat](repeat.md). + +## Example + +Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10 + +```ts +import { interval, take, range, concat } from 'rxjs'; + +const timer = interval(1000).pipe(take(4)); +const sequence = range(1, 10); +const result = concat(timer, sequence); +result.subscribe((x) => console.log(x)); + +// results in: +// 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 -immediate-> 1 ... 10 +``` + +Concatenate 3 Observables + +```ts +import { interval, take, concat } from 'rxjs'; + +const timer1 = interval(1000).pipe(take(10)); +const timer2 = interval(2000).pipe(take(6)); +const timer3 = interval(500).pipe(take(10)); + +const result = concat(timer1, timer2, timer3); +result.subscribe((x) => console.log(x)); + +// results in the following: +// (Prints to console sequentially) +// -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9 +// -2000ms-> 0 -2000ms-> 1 -2000ms-> ... 5 +// -500ms-> 0 -500ms-> 1 -500ms-> ... 9 +``` + +Concatenate the same Observable to repeat it + +```ts +import { interval, take, concat } from 'rxjs'; + +const timer = interval(1000).pipe(take(2)); + +concat(timer, timer) // concatenating the same Observable! + .subscribe({ + next: (value) => console.log(value), + complete: () => console.log('...and it is done!'), + }); + +// Logs: +// 0 after 1s +// 1 after 2s +// 0 after 3s +// 1 after 4s +// '...and it is done!' also after 4s +``` + +## See + +- [concatAll](concatAll.md) +- [concatMap](concatMap.md) +- [concatMapTo](concatMapTo.md) +- [startWith](startWith.md) +- [endWith](endWith.md) + +## Parameters + +### `args` + +`ObservableInput`s to concatenate. + +## Call Signature + +```ts +function concat<>(...inputs: [...ObservableInputTuple[]]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/concat.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/concat.ts#L8) + +### Parameters + +| Parameter | Type | +| ----------- | ---------------------------------- | +| ...`inputs` | \[`...ObservableInputTuple[]`\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`T`\[`number`\]\> + +## Call Signature + +```ts +function concat<>(...inputsAndScheduler: [...ObservableInputTuple[], SchedulerLike]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/concat.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/concat.ts#L9) + +### Parameters + +| Parameter | Type | +| ----------------------- | ------------------------------------------------------------------------------------- | +| ...`inputsAndScheduler` | \[`...ObservableInputTuple[]`, [`SchedulerLike`](../interfaces/SchedulerLike.md)\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`T`\[`number`\]\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/concatAll.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/concatAll.md new file mode 100644 index 0000000000..928e64fc30 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/concatAll.md @@ -0,0 +1,69 @@ +[API](../../index.md) / [rxjs](../index.md) / concatAll + +# Function: concatAll() + +```ts +function concatAll<>(): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/concatAll.ts:60](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/concatAll.ts#L60) + +Converts a higher-order Observable into a first-order Observable by +concatenating the inner Observables in order. + +Flattens an Observable-of-Observables by putting one +inner Observable after the other. + +
Marble diagram +Marble diagram
+ +Joins every Observable emitted by the source (a higher-order Observable), in +a serial fashion. It subscribes to each inner Observable only after the +previous inner Observable has completed, and merges all of their values into +the returned observable. + +**Warning:** If the source Observable emits Observables quickly and +endlessly, and the inner Observables it emits generally complete slower than +the source emits, you can run into memory issues as the incoming Observables +collect in an unbounded buffer. + +Note: `concatAll` is equivalent to `mergeAll` with concurrency parameter set +to `1`. + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`O`, [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +A function that returns an Observable emitting values from all the +inner Observables concatenated. + +## Example + +For each click event, tick every second from 0 to 3, with no concurrency + +```ts +import { fromEvent, map, interval, take, concatAll } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const higherOrder = clicks.pipe(map(() => interval(1000).pipe(take(4)))); +const firstOrder = higherOrder.pipe(concatAll()); +firstOrder.subscribe((x) => console.log(x)); + +// Results in the following: +// (results are not concurrent) +// For every click on the "document" it will emit values 0 to 3 spaced +// on a 1000ms interval +// one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 +``` + +## See + +- [combineLatestAll](combineLatestAll.md) +- [concat](concat.md) +- [concatMap](concatMap.md) +- [concatMapTo](concatMapTo.md) +- [exhaustAll](exhaustAll.md) +- [mergeAll](mergeAll.md) +- [switchAll](switchAll.md) +- [switchMap](switchMap.md) +- [zipAll](zipAll.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/concatMap.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/concatMap.md new file mode 100644 index 0000000000..60a48ca15c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/concatMap.md @@ -0,0 +1,72 @@ +[API](../../index.md) / [rxjs](../index.md) / concatMap + +# Function: concatMap() + +```ts +function concatMap<>(project: (value: T, index: number) => O): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/concatMap.ts:60](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/concatMap.ts#L60) + +Projects each source value to an Observable which is merged in the output +Observable, in a serialized fashion waiting for each one to complete before +merging the next. + +Maps each value to an Observable, then flattens all of +these inner Observables using [concatAll](concatAll.md). + +![](/images/marble-diagrams/concatMap.png) + +Returns an Observable that emits items based on applying a function that you +supply to each item emitted by the source Observable, where that function +returns an (so-called "inner") Observable. Each new inner Observable is +concatenated with the previous inner Observable. + +**Warning:** if source values arrive endlessly and faster than their +corresponding inner Observables can complete, it will result in memory issues +as inner Observables amass in an unbounded buffer waiting for their turn to +be subscribed to. + +Note: `concatMap` is equivalent to `mergeMap` with concurrency parameter set +to `1`. + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `project` | (`value`: `T`, `index`: `number`) => `O` | A function that, when applied to an item emitted by the source Observable, returns an Observable. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +A function that returns an Observable that emits the result of +applying the projection function to each item emitted by the source Observable +and taking values from each projected inner Observable sequentially. + +## Example + +For each click event, tick every second from 0 to 3, with no concurrency + +```ts +import { fromEvent, concatMap, interval, take } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(concatMap((ev) => interval(1000).pipe(take(4)))); +result.subscribe((x) => console.log(x)); + +// Results in the following: +// (results are not concurrent) +// For every click on the "document" it will emit values 0 to 3 spaced +// on a 1000ms interval +// one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 +``` + +## See + +- [concat](concat.md) +- [concatAll](concatAll.md) +- [concatMapTo](concatMapTo.md) +- [exhaustMap](exhaustMap.md) +- [mergeMap](mergeMap.md) +- [switchMap](switchMap.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/concatMapTo.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/concatMapTo.md new file mode 100644 index 0000000000..4689fd5755 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/concatMapTo.md @@ -0,0 +1,75 @@ +[API](../../index.md) / [rxjs](../index.md) / concatMapTo + +# ~~Function: concatMapTo()~~ + +```ts +function concatMapTo<>(innerObservable: O): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/concatMapTo.ts:60](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/concatMapTo.ts#L60) + +Projects each source value to the same Observable which is merged multiple +times in a serialized fashion on the output Observable. + +It's like [concatMap](concatMap.md), but maps each value +always to the same inner Observable. + +![](/images/marble-diagrams/concatMapTo.png) + +Maps each source value to the given Observable `innerObservable` regardless +of the source value, and then flattens those resulting Observables into one +single Observable, which is the output Observable. Each new `innerObservable` +instance emitted on the output Observable is concatenated with the previous +`innerObservable` instance. + +**Warning:** if source values arrive endlessly and faster than their +corresponding inner Observables can complete, it will result in memory issues +as inner Observables amass in an unbounded buffer waiting for their turn to +be subscribed to. + +Note: `concatMapTo` is equivalent to `mergeMapTo` with concurrency parameter +set to `1`. + +## Parameters + +| Parameter | Type | Description | +| ----------------- | ---- | ---------------------------------------------------------------------- | +| `innerObservable` | `O` | An `ObservableInput` to replace each value from the source Observable. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`unknown`, [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +A function that returns an Observable of values merged together by +joining the passed Observable with itself, one after the other, for each +value emitted from the source. + +## Example + +For each click event, tick every second from 0 to 3, with no concurrency + +```ts +import { fromEvent, concatMapTo, interval, take } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(concatMapTo(interval(1000).pipe(take(4)))); +result.subscribe((x) => console.log(x)); + +// Results in the following: +// (results are not concurrent) +// For every click on the "document" it will emit values 0 to 3 spaced +// on a 1000ms interval +// one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 +``` + +## See + +- [concat](concat.md) +- [concatAll](concatAll.md) +- [concatMap](concatMap.md) +- [mergeMapTo](mergeMapTo.md) +- [switchMapTo](switchMapTo.md) + +## Deprecated + +Will be removed in v9. Use [concatMap](concatMap.md) instead: `concatMap(() => result)` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/concatWith.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/concatWith.md new file mode 100644 index 0000000000..26df18002f --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/concatWith.md @@ -0,0 +1,54 @@ +[API](../../index.md) / [rxjs](../index.md) / concatWith + +# Function: concatWith() + +```ts +function concatWith<>(...otherSources: [...ObservableInputTuple
[]]): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/concatWith.ts:45](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/concatWith.ts#L45) + +Emits all of the values from the source observable, then, once it completes, subscribes +to each observable source provided, one at a time, emitting all of their values, and not subscribing +to the next one until it completes. + +`concat(a$, b$, c$)` is the same as `a$.pipe(concatWith(b$, c$))`. + +## Parameters + +| Parameter | Type | Description | +| ----------------- | ---------------------------------- | --------------------------------------------------------------------------------------------- | +| ...`otherSources` | \[`...ObservableInputTuple[]`\] | Other observable sources to subscribe to, in sequence, after the original source is complete. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `A`\[`number`\]\> + +A function that returns an Observable that concatenates +subscriptions to the source and provided Observables subscribing to the next +only once the current subscription completes. + +## Example + +Listen for one mouse click, then listen for all mouse moves. + +```ts +import { fromEvent, map, take, concatWith } from 'rxjs'; + +const clicks$ = fromEvent(document, 'click'); +const moves$ = fromEvent(document, 'mousemove'); + +clicks$ + .pipe( + map(() => 'click'), + take(1), + concatWith(moves$.pipe(map(() => 'move'))) + ) + .subscribe((x) => console.log(x)); + +// 'click' +// 'move' +// 'move' +// 'move' +// ... +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/connect.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/connect.md new file mode 100644 index 0000000000..c2cfe52d2a --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/connect.md @@ -0,0 +1,94 @@ +[API](../../index.md) / [rxjs](../index.md) / connect + +# Function: connect() + +```ts +function connect<>(selector: (shared: Observable) => O, config: ConnectConfig): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/connect.ts:97](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/connect.ts#L97) + +Creates an observable by multicasting the source within a function that +allows the developer to define the usage of the multicast prior to connection. + +This is particularly useful if the observable source you wish to multicast could +be synchronous or asynchronous. This sets it apart from [share](share.md), which, in the +case of totally synchronous sources will fail to share a single subscription with +multiple consumers, as by the time the subscription to the result of [share](share.md) +has returned, if the source is synchronous its internal reference count will jump from +0 to 1 back to 0 and reset. + +To use `connect`, you provide a `selector` function that will give you +a multicast observable that is not yet connected. You then use that multicast observable +to create a resulting observable that, when subscribed, will set up your multicast. This is +generally, but not always, accomplished with [merge](merge.md). + +Note that using a [takeUntil](takeUntil.md) inside of `connect`'s `selector` _might_ mean you were looking +to use the [takeWhile](takeWhile.md) operator instead. + +When you subscribe to the result of `connect`, the `selector` function will be called. After +the `selector` function returns, the observable it returns will be subscribed to, _then_ the +multicast will be connected to the source. + +## Parameters + +| Parameter | Type | Default value | Description | +| ---------- | ------------------------------------------------------------------ | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `selector` | (`shared`: [`Observable`](../classes/Observable.md)\<`T`\>) => `O` | `undefined` | A function used to set up the multicast. Gives you a multicast observable that is not yet connected. With that, you're expected to create and return an Observable, that when subscribed to, will utilize the multicast observable. After this function is executed -- and its return value subscribed to -- the operator will subscribe to the source, and the connection will be made. | +| `config` | [`ConnectConfig`](../interfaces/ConnectConfig.md)\<`T`\> | `DEFAULT_CONFIG` | The configuration object for `connect`. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +## Example + +Sharing a totally synchronous observable + +```ts +import { of, tap, connect, merge, map, filter } from 'rxjs'; + +const source$ = of(1, 2, 3, 4, 5).pipe( + tap({ + subscribe: () => console.log('subscription started'), + next: (n) => console.log(`source emitted ${n}`), + }) +); + +source$ + .pipe( + // Notice in here we're merging 3 subscriptions to `shared$`. + connect((shared$) => + merge( + shared$.pipe(map((n) => `all ${n}`)), + shared$.pipe( + filter((n) => n % 2 === 0), + map((n) => `even ${n}`) + ), + shared$.pipe( + filter((n) => n % 2 === 1), + map((n) => `odd ${n}`) + ) + ) + ) + ) + .subscribe(console.log); + +// Expected output: (notice only one subscription) +('subscription started'); +('source emitted 1'); +('all 1'); +('odd 1'); +('source emitted 2'); +('all 2'); +('even 2'); +('source emitted 3'); +('all 3'); +('odd 3'); +('source emitted 4'); +('all 4'); +('even 4'); +('source emitted 5'); +('all 5'); +('odd 5'); +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/connectable.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/connectable.md new file mode 100644 index 0000000000..8b9299ea87 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/connectable.md @@ -0,0 +1,25 @@ +[API](../../index.md) / [rxjs](../index.md) / connectable + +# Function: connectable() + +```ts +function connectable<>(source: ObservableInput, config: ConnectableConfig): Connectable; +``` + +Defined in: [rxjs/src/internal/observable/connectable.ts:40](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/connectable.ts#L40) + +Creates an observable that multicasts once `connect()` is called on it. + +## Parameters + +| Parameter | Type | Default value | Description | +| --------- | -------------------------------------------------------------- | ---------------- | ------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`T`\> | `undefined` | The observable source to make connectable. | +| `config` | `ConnectableConfig`\<`T`\> | `DEFAULT_CONFIG` | The configuration object for `connectable`. | + +## Returns + +[`Connectable`](../interfaces/Connectable.md)\<`T`\> + +A "connectable" observable, that has a `connect()` method, that you must call to +connect the source to all consumers through the subject provided as the connector. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/count.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/count.md new file mode 100644 index 0000000000..d882b343f7 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/count.md @@ -0,0 +1,71 @@ +[API](../../index.md) / [rxjs](../index.md) / count + +# Function: count() + +```ts +function count<>(predicate?: (value: T, index: number) => boolean): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/count.ts:59](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/count.ts#L59) + +Counts the number of emissions on the source and emits that number when the +source completes. + +Tells how many values were emitted, when the source +completes. + +![](/images/marble-diagrams/count.png) + +`count` transforms an Observable that emits values into an Observable that +emits a single value that represents the number of values emitted by the +source Observable. If the source Observable terminates with an error, `count` +will pass this error notification along without emitting a value first. If +the source Observable does not terminate at all, `count` will neither emit +a value nor terminate. This operator takes an optional `predicate` function +as argument, in which case the output emission will represent the number of +source values that matched `true` with the `predicate`. + +## Parameters + +| Parameter | Type | Description | +| ------------ | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `predicate?` | (`value`: `T`, `index`: `number`) => `boolean` | A function that is used to analyze the value and the index and determine whether or not to increment the count. Return `true` to increment the count, and return `false` to keep the count the same. If the predicate is not provided, every value will be counted. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `number`\> + +A function that returns an Observable that emits one number that +represents the count of emissions. + +## Example + +Counts how many seconds have passed before the first click happened + +```ts +import { interval, fromEvent, takeUntil, count } from 'rxjs'; + +const seconds = interval(1000); +const clicks = fromEvent(document, 'click'); +const secondsBeforeClick = seconds.pipe(takeUntil(clicks)); +const result = secondsBeforeClick.pipe(count()); +result.subscribe((x) => console.log(x)); +``` + +Counts how many odd numbers are there between 1 and 7 + +```ts +import { range, count } from 'rxjs'; + +const numbers = range(1, 7); +const result = numbers.pipe(count((i) => i % 2 === 1)); +result.subscribe((x) => console.log(x)); +// Results in: +// 4 +``` + +## See + +- [max](max.md) +- [min](min.md) +- [reduce](reduce.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/debounce.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/debounce.md new file mode 100644 index 0000000000..45ebe040c0 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/debounce.md @@ -0,0 +1,76 @@ +[API](../../index.md) / [rxjs](../index.md) / debounce + +# Function: debounce() + +```ts +function debounce<>(durationSelector: (value: T) => ObservableInput): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/debounce.ts:64](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/debounce.ts#L64) + +Emits a notification from the source Observable only after a particular time span +determined by another Observable has passed without another source emission. + +It's like [debounceTime](debounceTime.md), but the time span of +emission silence is determined by a second Observable. + +
Marble diagram +Marble diagram
+ +`debounce` delays notifications emitted by the source Observable, but drops previous +pending delayed emissions if a new notification arrives on the source Observable. +This operator keeps track of the most recent notification from the source +Observable, and spawns a duration Observable by calling the +`durationSelector` function. The notification is emitted only when the duration +Observable emits a next notification, and if no other notification was emitted on +the source Observable since the duration Observable was spawned. If a new +notification appears before the duration Observable emits, the previous notification will +not be emitted and a new duration is scheduled from `durationSelector` is scheduled. +If the completing event happens during the scheduled duration the last cached notification +is emitted before the completion event is forwarded to the output observable. +If the error event happens during the scheduled duration or after it only the error event is +forwarded to the output observable. The cache notification is not emitted in this case. + +Like [debounceTime](debounceTime.md), this is a rate-limiting operator, and also a +delay-like operator since output emissions do not necessarily occur at the +same time as they did on the source Observable. + +## Parameters + +| Parameter | Type | Description | +| ------------------ | ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `durationSelector` | (`value`: `T`) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | A function that receives a value from the source Observable, for computing the timeout duration for each source value, returned as an Observable or a Promise. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that delays the emissions of +the source Observable by the specified duration Observable returned by +`durationSelector`, and may drop some values if they occur too frequently. + +## Example + +Emit the most recent click after a burst of clicks + +```ts +import { fromEvent, scan, debounce, interval } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe( + scan((i) => ++i, 1), + debounce((i) => interval(200 * i)) +); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [audit](audit.md) +- [auditTime](auditTime.md) +- [debounceTime](debounceTime.md) +- [delay](delay.md) +- [sample](sample.md) +- [sampleTime](sampleTime.md) +- [throttle](throttle.md) +- [throttleTime](throttleTime.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/debounceTime.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/debounceTime.md new file mode 100644 index 0000000000..5f341222dc --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/debounceTime.md @@ -0,0 +1,72 @@ +[API](../../index.md) / [rxjs](../index.md) / debounceTime + +# Function: debounceTime() + +```ts +function debounceTime<>(dueTime: number, scheduler: SchedulerLike): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/debounceTime.ts:63](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/debounceTime.ts#L63) + +Emits a notification from the source Observable only after a particular time span +has passed without another source emission. + +It's like [delay](delay.md), but passes only the most +recent notification from each burst of emissions. + +![](/images/marble-diagrams/debounceTime.png) + +`debounceTime` delays notifications emitted by the source Observable, but drops +previous pending delayed emissions if a new notification arrives on the source +Observable. This operator keeps track of the most recent notification from the +source Observable, and emits that only when `dueTime` has passed +without any other notification appearing on the source Observable. If a new value +appears before `dueTime` silence occurs, the previous notification will be dropped +and will not be emitted and a new `dueTime` is scheduled. +If the completing event happens during `dueTime` the last cached notification +is emitted before the completion event is forwarded to the output observable. +If the error event happens during `dueTime` or after it only the error event is +forwarded to the output observable. The cache notification is not emitted in this case. + +This is a rate-limiting operator, because it is impossible for more than one +notification to be emitted in any time window of duration `dueTime`, but it is also +a delay-like operator since output emissions do not occur at the same time as +they did on the source Observable. Optionally takes a [SchedulerLike](../interfaces/SchedulerLike.md) for +managing timers. + +## Parameters + +| Parameter | Type | Default value | Description | +| ----------- | ------------------------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `dueTime` | `number` | `undefined` | The timeout duration in milliseconds (or the time unit determined internally by the optional `scheduler`) for the window of time required to wait for emission silence before emitting the most recent source value. | +| `scheduler` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | `asyncScheduler` | The [SchedulerLike](../interfaces/SchedulerLike.md) to use for managing the timers that handle the timeout for each value. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that delays the emissions of +the source Observable by the specified `dueTime`, and may drop some values +if they occur too frequently. + +## Example + +Emit the most recent click after a burst of clicks + +```ts +import { fromEvent, debounceTime } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(debounceTime(1000)); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [audit](audit.md) +- [auditTime](auditTime.md) +- [debounce](debounce.md) +- [sample](sample.md) +- [sampleTime](sampleTime.md) +- [throttle](throttle.md) +- [throttleTime](throttleTime.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/defaultIfEmpty.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/defaultIfEmpty.md new file mode 100644 index 0000000000..567313f16c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/defaultIfEmpty.md @@ -0,0 +1,53 @@ +[API](../../index.md) / [rxjs](../index.md) / defaultIfEmpty + +# Function: defaultIfEmpty() + +```ts +function defaultIfEmpty<>(defaultValue: R): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/defaultIfEmpty.ts:39](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/defaultIfEmpty.ts#L39) + +Emits a given value if the source Observable completes without emitting any +`next` value, otherwise mirrors the source Observable. + +If the source Observable turns out to be empty, then +this operator will emit a default value. + +![](/images/marble-diagrams/defaultIfEmpty.png) + +`defaultIfEmpty` emits the values emitted by the source Observable or a +specified default value if the source Observable is empty (completes without +having emitted any `next` value). + +## Parameters + +| Parameter | Type | Description | +| -------------- | ---- | --------------------------------------------------------- | +| `defaultValue` | `R` | The default value used if the source Observable is empty. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `R`\> + +A function that returns an Observable that emits either the +specified `defaultValue` if the source Observable emits no items, or the +values emitted by the source Observable. + +## Example + +If no clicks happen in 5 seconds, then emit 'no clicks' + +```ts +import { fromEvent, takeUntil, interval, defaultIfEmpty } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const clicksBeforeFive = clicks.pipe(takeUntil(interval(5000))); +const result = clicksBeforeFive.pipe(defaultIfEmpty('no clicks')); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [EMPTY](../variables/EMPTY.md) +- [last](last.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/defer.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/defer.md new file mode 100644 index 0000000000..248dd1e8d8 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/defer.md @@ -0,0 +1,61 @@ +[API](../../index.md) / [rxjs](../index.md) / defer + +# Function: defer() + +```ts +function defer<>(observableFactory: () => R): Observable>; +``` + +Defined in: [rxjs/src/internal/observable/defer.ts:50](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/defer.ts#L50) + +Creates an Observable that, on subscribe, calls an Observable factory to +make an Observable for each new Observer. + +Creates the Observable lazily, that is, only when it +is subscribed. + + +![](/images/marble-diagrams/defer.png) + +`defer` allows you to create an Observable only when the Observer +subscribes. It waits until an Observer subscribes to it, calls the given +factory function to get an Observable -- where a factory function typically +generates a new Observable -- and subscribes the Observer to this Observable. +Last but not least, an exception during the factory function call is +transferred to the Observer by calling `error`. + +## Parameters + +| Parameter | Type | Description | +| ------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `observableFactory` | () => `R` | The Observable factory function to invoke for each Observer that subscribes to the output Observable. May also return any `ObservableInput`, which will be converted on the fly to an Observable. | + +## Returns + +[`Observable`](../classes/Observable.md)\<[`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`R`\>\> + +An Observable whose Observers' subscriptions trigger an invocation of the +given Observable factory function. + +## Example + +Subscribe to either an Observable of clicks or an Observable of interval, at random + +```ts +import { defer, fromEvent, interval } from 'rxjs'; + +const clicksOrInterval = defer(() => { + return Math.random() > 0.5 ? fromEvent(document, 'click') : interval(1000); +}); +clicksOrInterval.subscribe((x) => console.log(x)); + +// Results in the following behavior: +// If the result of Math.random() is greater than 0.5 it will listen +// for clicks anywhere on the "document"; when document is clicked it +// will log a MouseEvent object to the console. If the result is less +// than 0.5 it will emit ascending numbers, one every second(1000ms). +``` + +## See + +[Observable](../classes/Observable.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/delay.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/delay.md new file mode 100644 index 0000000000..ec0e6b5aef --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/delay.md @@ -0,0 +1,74 @@ +[API](../../index.md) / [rxjs](../index.md) / delay + +# Function: delay() + +```ts +function delay<>(due: number | Date, scheduler: SchedulerLike): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/delay.ts:62](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/delay.ts#L62) + +Delays the emission of items from the source Observable by a given timeout or +until a given Date. + +Time shifts each item by some specified amount of +milliseconds. + +
Marble diagram +Marble diagram
+ +If the delay argument is a Number, this operator time shifts the source +Observable by that amount of time expressed in milliseconds. The relative +time intervals between the values are preserved. + +If the delay argument is a Date, this operator time shifts the start of the +Observable execution until the given date occurs. + +## Parameters + +| Parameter | Type | Default value | Description | +| ----------- | ------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `due` | `number` \| `Date` | `undefined` | The delay duration in milliseconds (a `number`) or a `Date` until which the emission of the source items is delayed. | +| `scheduler` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | `asyncScheduler` | The [SchedulerLike](../interfaces/SchedulerLike.md) to use for managing the timers that handle the time-shift for each item. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that delays the emissions of +the source Observable by the specified timeout or Date. + +## Example + +Delay each click by one second + +```ts +import { fromEvent, delay } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const delayedClicks = clicks.pipe(delay(1000)); // each click emitted after 1 second +delayedClicks.subscribe((x) => console.log(x)); +``` + +Delay all clicks until a future date happens + +```ts +import { fromEvent, delay } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const date = new Date('March 15, 2050 12:00:00'); // in the future +const delayedClicks = clicks.pipe(delay(date)); // click emitted only after that date +delayedClicks.subscribe((x) => console.log(x)); +``` + +## See + +- [delayWhen](delayWhen.md) +- [throttle](throttle.md) +- [throttleTime](throttleTime.md) +- [debounce](debounce.md) +- [debounceTime](debounceTime.md) +- [sample](sample.md) +- [sampleTime](sampleTime.md) +- [audit](audit.md) +- [auditTime](auditTime.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/delayWhen.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/delayWhen.md new file mode 100644 index 0000000000..428e1705da --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/delayWhen.md @@ -0,0 +1,139 @@ +[API](../../index.md) / [rxjs](../index.md) / delayWhen + +# ~~Function: delayWhen()~~ + +> Delays the emission of items from the source Observable by a given time span +> determined by the emissions of another Observable. + +## Description + +It's like [delay](delay.md), but the time span of the +delay duration is determined by a second Observable. + +![](/images/marble-diagrams/delayWhen.png) + +`delayWhen` operator shifts each emitted value from the source Observable by +a time span determined by another Observable. When the source emits a value, +the `delayDurationSelector` function is called with the value emitted from +the source Observable as the first argument to the `delayDurationSelector`. +The `delayDurationSelector` function should return an [ObservableInput](../type-aliases/ObservableInput.md), +that is internally converted to an Observable that is called the "duration" +Observable. + +The source value is emitted on the output Observable only when the "duration" +Observable emits ([next](https://rxjs.dev/guide/glossary-and-semantics#next)s) any value. +Upon that, the "duration" Observable gets unsubscribed. + +Before RxJS V7, the [completion](https://rxjs.dev/guide/glossary-and-semantics#complete) +of the "duration" Observable would have been triggering the emission of the +source value to the output Observable, but with RxJS V7, this is not the case +anymore. + +Only next notifications (from the "duration" Observable) trigger values from +the source Observable to be passed to the output Observable. If the "duration" +Observable only emits the complete notification (without next), the value +emitted by the source Observable will never get to the output Observable - it +will be swallowed. If the "duration" Observable errors, the error will be +propagated to the output Observable. + +Optionally, `delayWhen` takes a second argument, `subscriptionDelay`, which +is an Observable. When `subscriptionDelay` emits its first value or +completes, the source Observable is subscribed to and starts behaving like +described in the previous paragraph. If `subscriptionDelay` is not provided, +`delayWhen` will subscribe to the source Observable as soon as the output +Observable is subscribed. + +## Example + +Delay each click by a random amount of time, between 0 and 5 seconds + +```ts +import { fromEvent, delayWhen, interval } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const delayedClicks = clicks.pipe(delayWhen(() => interval(Math.random() * 5000))); +delayedClicks.subscribe((x) => console.log(x)); +``` + +## See + +- [delay](delay.md) +- [throttle](throttle.md) +- [throttleTime](throttleTime.md) +- [debounce](debounce.md) +- [debounceTime](debounceTime.md) +- [sample](sample.md) +- [sampleTime](sampleTime.md) +- [audit](audit.md) +- [auditTime](auditTime.md) + +each `value` emitted by the source Observable, which is then used to delay the +emission of that `value` on the output Observable until the `ObservableInput` +returned from this function emits a next value. When called, beside `value`, +this function receives a zero-based `index` of the emission order. + +source Observable once it emits any value. + +## Parameters + +### `delayDurationSelector` + +A function that returns an `ObservableInput` for + +### `subscriptionDelay` + +An Observable that triggers the subscription to the + +## Returns + +`A` + +function that returns an Observable that delays the emissions of the source Observable by an amount of time specified by the Observable returned by . + +## Call Signature + +```ts +function delayWhen<>( + delayDurationSelector: (value: T, index: number) => ObservableInput, + subscriptionDelay: Observable +): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/delayWhen.ts:11](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/delayWhen.ts#L11) + +### Parameters + +| Parameter | Type | +| ----------------------- | ----------------------------------------------------------------------------------------------------- | +| `delayDurationSelector` | (`value`: `T`, `index`: `number`) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | +| `subscriptionDelay` | [`Observable`](../classes/Observable.md)\<`any`\> | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +### Deprecated + +The `subscriptionDelay` parameter will be removed in v8. + +## Call Signature + +```ts +function delayWhen<>(delayDurationSelector: (value: T, index: number) => ObservableInput): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/delayWhen.ts:15](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/delayWhen.ts#L15) + +### Parameters + +| Parameter | Type | +| ----------------------- | ----------------------------------------------------------------------------------------------------- | +| `delayDurationSelector` | (`value`: `T`, `index`: `number`) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +### Deprecated + +The `subscriptionDelay` parameter will be removed in v8. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/dematerialize.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/dematerialize.md new file mode 100644 index 0000000000..be71243012 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/dematerialize.md @@ -0,0 +1,62 @@ +[API](../../index.md) / [rxjs](../index.md) / dematerialize + +# Function: dematerialize() + +```ts +function dematerialize<>(): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/dematerialize.ts:53](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/dematerialize.ts#L53) + +Converts an Observable of [ObservableNotification](../type-aliases/ObservableNotification.md) objects into the emissions +that they represent. + +Unwraps [ObservableNotification](../type-aliases/ObservableNotification.md) objects as actual `next`, +`error` and `complete` emissions. The opposite of [materialize](materialize.md). + +![](/images/marble-diagrams/dematerialize.png) + +`dematerialize` is assumed to operate an Observable that only emits +[ObservableNotification](../type-aliases/ObservableNotification.md) objects as `next` emissions, and does not emit any +`error`. Such Observable is the output of a `materialize` operation. Those +notifications are then unwrapped using the metadata they contain, and emitted +as `next`, `error`, and `complete` on the output Observable. + +Use this operator in conjunction with [materialize](materialize.md). + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`N`, [`ValueFromNotification`](../type-aliases/ValueFromNotification.md)\<`N`\>\> + +A function that returns an Observable that emits items and +notifications embedded in Notification objects emitted by the source +Observable. + +## Example + +Convert an Observable of Notifications to an actual Observable + +```ts +import { NextNotification, ErrorNotification, of, dematerialize } from 'rxjs'; + +const notifA: NextNotification = { kind: 'N', value: 'A' }; +const notifB: NextNotification = { kind: 'N', value: 'B' }; +const notifE: ErrorNotification = { kind: 'E', error: new TypeError('x.toUpperCase is not a function') }; + +const materialized = of(notifA, notifB, notifE); + +const upperCase = materialized.pipe(dematerialize()); +upperCase.subscribe({ + next: (x) => console.log(x), + error: (e) => console.error(e), +}); + +// Results in: +// A +// B +// TypeError: x.toUpperCase is not a function +``` + +## See + +[materialize](materialize.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/distinct.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/distinct.md new file mode 100644 index 0000000000..bd4401001d --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/distinct.md @@ -0,0 +1,73 @@ +[API](../../index.md) / [rxjs](../index.md) / distinct + +# Function: distinct() + +```ts +function distinct<>(keySelector?: (value: T) => K, flushes?: ObservableInput): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/distinct.ts:62](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/distinct.ts#L62) + +Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from previous items. + +If a `keySelector` function is provided, then it will project each value from the source observable into a new value that it will +check for equality with previously projected values. If the `keySelector` function is not provided, it will use each value from the +source observable directly with an equality check against previous values. + +In JavaScript runtimes that support `Set`, this operator will use a `Set` to improve performance of the distinct value checking. + +In other runtimes, this operator will use a minimal implementation of `Set` that relies on an `Array` and `indexOf` under the +hood, so performance will degrade as more values are checked for distinction. Even in newer browsers, a long-running `distinct` +use might result in memory leaks. To help alleviate this in some scenarios, an optional `flushes` parameter is also provided so +that the internal `Set` can be "flushed", basically clearing it of values. + +## Parameters + +| Parameter | Type | Description | +| -------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `keySelector?` | (`value`: `T`) => `K` | Optional `function` to select which value you want to check as distinct. | +| `flushes?` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | Optional `ObservableInput` for flushing the internal HashSet of the operator. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that emits items from the +source Observable with distinct values. + +## Example + +A simple example with numbers + +```ts +import { of, distinct } from 'rxjs'; + +of(1, 1, 2, 2, 2, 1, 2, 3, 4, 3, 2, 1) + .pipe(distinct()) + .subscribe((x) => console.log(x)); + +// Outputs +// 1 +// 2 +// 3 +// 4 +``` + +An example using the `keySelector` function + +```ts +import { of, distinct } from 'rxjs'; + +of({ age: 4, name: 'Foo' }, { age: 7, name: 'Bar' }, { age: 5, name: 'Foo' }) + .pipe(distinct(({ name }) => name)) + .subscribe((x) => console.log(x)); + +// Outputs +// { age: 4, name: 'Foo' } +// { age: 7, name: 'Bar' } +``` + +## See + +- [distinctUntilChanged](distinctUntilChanged.md) +- [distinctUntilKeyChanged](distinctUntilKeyChanged.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/distinctUntilChanged.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/distinctUntilChanged.md new file mode 100644 index 0000000000..1f0a440e33 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/distinctUntilChanged.md @@ -0,0 +1,177 @@ +[API](../../index.md) / [rxjs](../index.md) / distinctUntilChanged + +# Function: distinctUntilChanged() + +> Returns a result [Observable](../classes/Observable.md) that emits all values pushed by the source observable if they +> are distinct in comparison to the last value the result observable emitted. + +## Description + +When provided without parameters or with the first parameter (`{@link distinctUntilChanged#comparator comparator}`), +it behaves like this: + +1. It will always emit the first value from the source. +2. For all subsequent values pushed by the source, they will be compared to the previously emitted values + using the provided `comparator` or an `===` equality check. +3. If the value pushed by the source is determined to be unequal by this check, that value is emitted and + becomes the new "previously emitted value" internally. + +When the second parameter (`{@link distinctUntilChanged#keySelector keySelector}`) is provided, the behavior +changes: + +1. It will always emit the first value from the source. +2. The `keySelector` will be run against all values, including the first value. +3. For all values after the first, the selected key will be compared against the key selected from + the previously emitted value using the `comparator`. +4. If the keys are determined to be unequal by this check, the value (not the key), is emitted + and the selected key from that value is saved for future comparisons against other keys. + +## Example + +A very basic example with no `{@link distinctUntilChanged#comparator comparator}`. Note that `1` is emitted more than once, +because it's distinct in comparison to the _previously emitted_ value, +not in comparison to _all other emitted values_. + +```ts +import { of, distinctUntilChanged } from 'rxjs'; + +of(1, 1, 1, 2, 2, 2, 1, 1, 3, 3).pipe(distinctUntilChanged()).subscribe(console.log); +// Logs: 1, 2, 1, 3 +``` + +With a `{@link distinctUntilChanged#comparator comparator}`, you can do custom comparisons. Let's say +you only want to emit a value when all of its components have +changed: + +```ts +import { of, distinctUntilChanged } from 'rxjs'; + +const totallyDifferentBuilds$ = of( + { engineVersion: '1.1.0', transmissionVersion: '1.2.0' }, + { engineVersion: '1.1.0', transmissionVersion: '1.4.0' }, + { engineVersion: '1.3.0', transmissionVersion: '1.4.0' }, + { engineVersion: '1.3.0', transmissionVersion: '1.5.0' }, + { engineVersion: '2.0.0', transmissionVersion: '1.5.0' } +).pipe( + distinctUntilChanged((prev, curr) => { + return prev.engineVersion === curr.engineVersion || prev.transmissionVersion === curr.transmissionVersion; + }) +); + +totallyDifferentBuilds$.subscribe(console.log); + +// Logs: +// { engineVersion: '1.1.0', transmissionVersion: '1.2.0' } +// { engineVersion: '1.3.0', transmissionVersion: '1.4.0' } +// { engineVersion: '2.0.0', transmissionVersion: '1.5.0' } +``` + +You can also provide a custom `{@link distinctUntilChanged#comparator comparator}` to check that emitted +changes are only in one direction. Let's say you only want to get +the next record temperature: + +```ts +import { of, distinctUntilChanged } from 'rxjs'; + +const temps$ = of(30, 31, 20, 34, 33, 29, 35, 20); + +const recordHighs$ = temps$.pipe( + distinctUntilChanged((prevHigh, temp) => { + // If the current temp is less than + // or the same as the previous record, + // the record hasn't changed. + return temp <= prevHigh; + }) +); + +recordHighs$.subscribe(console.log); +// Logs: 30, 31, 34, 35 +``` + +Selecting update events only when the `updatedBy` field shows +the account changed hands. + +```ts +import { of, distinctUntilChanged } from 'rxjs'; + +// A stream of updates to a given account +const accountUpdates$ = of( + { updatedBy: 'blesh', data: [] }, + { updatedBy: 'blesh', data: [] }, + { updatedBy: 'ncjamieson', data: [] }, + { updatedBy: 'ncjamieson', data: [] }, + { updatedBy: 'blesh', data: [] } +); + +// We only want the events where it changed hands +const changedHands$ = accountUpdates$.pipe(distinctUntilChanged(undefined, (update) => update.updatedBy)); + +changedHands$.subscribe(console.log); +// Logs: +// { updatedBy: 'blesh', data: Array[0] } +// { updatedBy: 'ncjamieson', data: Array[0] } +// { updatedBy: 'blesh', data: Array[0] } +``` + +## See + +- [distinct](distinct.md) +- [distinctUntilKeyChanged](distinctUntilKeyChanged.md) + +equality. Defaults to a `===` check. + +## Parameters + +### `comparator` + +A function used to compare the previous and current keys for + +### `keySelector` + +Used to select a key value to be passed to the `comparator`. + +## Returns + +`A` + +function that returns an Observable that emits items from the source Observable with distinct values. + +## Call Signature + +```ts +function distinctUntilChanged<>(comparator?: (previous: T, current: T) => boolean): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/distinctUntilChanged.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/distinctUntilChanged.ts#L5) + +### Parameters + +| Parameter | Type | +| ------------- | ---------------------------------------------- | +| `comparator?` | (`previous`: `T`, `current`: `T`) => `boolean` | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +## Call Signature + +```ts +function distinctUntilChanged<>( + comparator: (previous: K, current: K) => boolean, + keySelector: (value: T) => K +): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/distinctUntilChanged.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/distinctUntilChanged.ts#L6) + +### Parameters + +| Parameter | Type | +| ------------- | ---------------------------------------------- | +| `comparator` | (`previous`: `K`, `current`: `K`) => `boolean` | +| `keySelector` | (`value`: `T`) => `K` | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/distinctUntilKeyChanged.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/distinctUntilKeyChanged.md new file mode 100644 index 0000000000..3025227d88 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/distinctUntilKeyChanged.md @@ -0,0 +1,106 @@ +[API](../../index.md) / [rxjs](../index.md) / distinctUntilKeyChanged + +# Function: distinctUntilKeyChanged() + +> Returns an Observable that emits all items emitted by the source Observable that +> are distinct by comparison from the previous item, using a property accessed by +> using the key provided to check if the two items are distinct. + +## Description + +If a comparator function is provided, then it will be called for each item to +test for whether that value should be emitted or not. + +If a comparator function is not provided, an equality check is used by default. + +## Example + +An example comparing the name of persons + +```ts +import { of, distinctUntilKeyChanged } from 'rxjs'; + +of({ age: 4, name: 'Foo' }, { age: 7, name: 'Bar' }, { age: 5, name: 'Foo' }, { age: 6, name: 'Foo' }) + .pipe(distinctUntilKeyChanged('name')) + .subscribe((x) => console.log(x)); + +// displays: +// { age: 4, name: 'Foo' } +// { age: 7, name: 'Bar' } +// { age: 5, name: 'Foo' } +``` + +An example comparing the first letters of the name + +```ts +import { of, distinctUntilKeyChanged } from 'rxjs'; + +of({ age: 4, name: 'Foo1' }, { age: 7, name: 'Bar' }, { age: 5, name: 'Foo2' }, { age: 6, name: 'Foo3' }) + .pipe(distinctUntilKeyChanged('name', (x, y) => x.substring(0, 3) === y.substring(0, 3))) + .subscribe((x) => console.log(x)); + +// displays: +// { age: 4, name: 'Foo1' } +// { age: 7, name: 'Bar' } +// { age: 5, name: 'Foo2' } +``` + +## See + +- [distinct](distinct.md) +- [distinctUntilChanged](distinctUntilChanged.md) + +from the previous item in the source. + +## Parameters + +### `key` + +String key for object property lookup on each item. + +### `compare` + +Optional comparison function called to test if an item is distinct + +## Returns + +`A` + +function that returns an Observable that emits items from the source Observable with distinct values based on the key specified. + +## Call Signature + +```ts +function distinctUntilKeyChanged<>(key: keyof T): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/distinctUntilKeyChanged.ts:4](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/distinctUntilKeyChanged.ts#L4) + +### Parameters + +| Parameter | Type | +| --------- | --------- | +| `key` | keyof `T` | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +## Call Signature + +```ts +function distinctUntilKeyChanged<>(key: K, compare: (x: T[K], y: T[K]) => boolean): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/distinctUntilKeyChanged.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/distinctUntilKeyChanged.ts#L5) + +### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------- | +| `key` | `K` | +| `compare` | (`x`: `T`\[`K`\], `y`: `T`\[`K`\]) => `boolean` | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/elementAt.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/elementAt.md new file mode 100644 index 0000000000..2e1a812620 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/elementAt.md @@ -0,0 +1,68 @@ +[API](../../index.md) / [rxjs](../index.md) / elementAt + +# Function: elementAt() + +```ts +function elementAt<>(index: number, defaultValue?: D): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/elementAt.ts:54](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/elementAt.ts#L54) + +Emits the single value at the specified `index` in a sequence of emissions +from the source Observable. + +Emits only the i-th value, then completes. + +![](/images/marble-diagrams/elementAt.png) + +`elementAt` returns an Observable that emits the item at the specified +`index` in the source Observable, or a default value if that `index` is out +of range and the `default` argument is provided. If the `default` argument is +not given and the `index` is out of range, the output Observable will emit an +`ArgumentOutOfRangeError` error. + +## Parameters + +| Parameter | Type | Description | +| --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- | +| `index` | `number` | Is the number `i` for the i-th source emission that has happened since the subscription, starting from the number `0`. | +| `defaultValue?` | `D` | The default value returned for missing indices. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `D`\> + +A function that returns an Observable that emits a single item, if +it is found. Otherwise, it will emit the default value if given. If not, it +emits an error. + +## Example + +Emit only the third click event + +```ts +import { fromEvent, elementAt } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(elementAt(2)); +result.subscribe((x) => console.log(x)); + +// Results in: +// click 1 = nothing +// click 2 = nothing +// click 3 = MouseEvent object logged to console +``` + +## See + +- [first](first.md) +- [last](last.md) +- [skip](skip.md) +- [single](single.md) +- [take](take.md) + +## Throws + +When using `elementAt(i)`, it delivers an +`ArgumentOutOfRangeError` to the Observer's `error` callback if `i < 0` or the +Observable has completed before emitting the i-th `next` notification. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/endWith.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/endWith.md new file mode 100644 index 0000000000..cb525e1f68 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/endWith.md @@ -0,0 +1,61 @@ +[API](../../index.md) / [rxjs](../index.md) / endWith + +# Function: endWith() + +```ts +function endWith<>(...values: A): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/endWith.ts:52](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/endWith.ts#L52) + +Returns an observable that will emit all values from the source, then synchronously emit +the provided value(s) immediately after the source completes. + +This is useful for knowing when an observable ends. Particularly when paired with an +operator like [takeUntil](takeUntil.md) + +![](/images/marble-diagrams/endWith.png) + +## Parameters + +| Parameter | Type | Description | +| ----------- | ---- | ---------------------------------------------------- | +| ...`values` | `A` | Items you want the modified Observable to emit last. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| [`ValueFromArray`](../type-aliases/ValueFromArray.md)\<`A`\>\> + +A function that returns an Observable that emits all values from the +source, then synchronously emits the provided value(s) immediately after the +source completes. + +## Example + +Emit values to know when an interval starts and stops. The interval will +stop when a user clicks anywhere on the document. + +```ts +import { interval, map, fromEvent, startWith, takeUntil, endWith } from 'rxjs'; + +const ticker$ = interval(5000).pipe(map(() => 'tick')); + +const documentClicks$ = fromEvent(document, 'click'); + +ticker$ + .pipe(startWith('interval started'), takeUntil(documentClicks$), endWith('interval ended by click')) + .subscribe((x) => console.log(x)); + +// Result (assuming a user clicks after 15 seconds) +// 'interval started' +// 'tick' +// 'tick' +// 'tick' +// 'interval ended by click' +``` + +## See + +- [startWith](startWith.md) +- [concat](concat.md) +- [takeUntil](takeUntil.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/every.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/every.md new file mode 100644 index 0000000000..4101b7d4f0 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/every.md @@ -0,0 +1,76 @@ +[API](../../index.md) / [rxjs](../index.md) / every + +# Function: every() + +> Returns an Observable that emits whether or not every item of the source satisfies the condition specified. + +## Description + +If all values pass predicate before the source completes, emits true before completion, +otherwise emit false, then complete. + +![](/images/marble-diagrams/every.png) + +## Example + +A simple example emitting true if all elements are less than 5, false otherwise + +```ts +import { of, every } from 'rxjs'; + +of(1, 2, 3, 4, 5, 6) + .pipe(every((x) => x < 5)) + .subscribe((x) => console.log(x)); // -> false +``` + +## Parameters + +### `predicate` + +A function for determining if an item meets a specified condition. + +### `thisArg` + +Optional object to use for `this` in the callback. + +## Returns + +`A` + +function that returns an Observable of booleans that determines if all items of the source Observable meet the condition specified. + +## Call Signature + +```ts +function every<>(predicate: BooleanConstructor): OperatorFunction extends never ? false : boolean>; +``` + +Defined in: [rxjs/src/internal/operators/every.ts:4](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/every.ts#L4) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------- | +| `predicate` | `BooleanConstructor` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `Exclude`\<`T`, [`Falsy`](../type-aliases/Falsy.md)\> _extends_ `never` ? `false` : `boolean`\> + +## Call Signature + +```ts +function every<>(predicate: (value: T, index: number) => boolean): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/every.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/every.ts#L5) + +### Parameters + +| Parameter | Type | +| ----------- | ---------------------------------------------- | +| `predicate` | (`value`: `T`, `index`: `number`) => `boolean` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `boolean`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/exhaustAll.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/exhaustAll.md new file mode 100644 index 0000000000..19e3796c1c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/exhaustAll.md @@ -0,0 +1,57 @@ +[API](../../index.md) / [rxjs](../index.md) / exhaustAll + +# Function: exhaustAll() + +```ts +function exhaustAll<>(): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/exhaustAll.ts:49](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/exhaustAll.ts#L49) + +Converts a higher-order Observable into a first-order Observable by dropping +inner Observables while the previous inner Observable has not yet completed. + +Flattens an Observable-of-Observables by dropping the +next inner Observables while the current inner is still executing. + +
Marble diagram +Marble diagram
+ +`exhaustAll` subscribes to an Observable that emits Observables, also known as a +higher-order Observable. Each time it observes one of these emitted inner +Observables, the output Observable begins emitting the items emitted by that +inner Observable. So far, it behaves like [mergeAll](mergeAll.md). However, +`exhaustAll` ignores every new inner Observable if the previous Observable has +not yet completed. Once that one completes, it will accept and flatten the +next inner Observable and repeat this process. + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`O`, [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +A function that returns an Observable that takes a source of +Observables and propagates the first Observable exclusively until it +completes before subscribing to the next. + +## Example + +Run a finite timer for each click, only if there is no currently active timer + +```ts +import { fromEvent, map, interval, take, exhaustAll } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const higherOrder = clicks.pipe(map(() => interval(1000).pipe(take(5)))); +const result = higherOrder.pipe(exhaustAll()); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [combineLatestAll](combineLatestAll.md) +- [concatAll](concatAll.md) +- [switchAll](switchAll.md) +- [switchMap](switchMap.md) +- [mergeAll](mergeAll.md) +- [exhaustMap](exhaustMap.md) +- [zipAll](zipAll.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/exhaustMap.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/exhaustMap.md new file mode 100644 index 0000000000..4f14ac51a4 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/exhaustMap.md @@ -0,0 +1,59 @@ +[API](../../index.md) / [rxjs](../index.md) / exhaustMap + +# Function: exhaustMap() + +```ts +function exhaustMap<>(project: (value: T, index: number) => O): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/exhaustMap.ts:48](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/exhaustMap.ts#L48) + +Projects each source value to an Observable which is merged in the output +Observable only if the previous projected Observable has completed. + +Maps each value to an Observable, then flattens all of +these inner Observables using [exhaustAll](exhaustAll.md). + +![](/images/marble-diagrams/exhaustMap.png) + +Returns an Observable that emits items based on applying a function that you +supply to each item emitted by the source Observable, where that function +returns an (so-called "inner") Observable. When it projects a source value to +an Observable, the output Observable begins emitting the items emitted by +that projected Observable. However, `exhaustMap` ignores every new projected +Observable if the previous projected Observable has not yet completed. Once +that one completes, it will accept and flatten the next projected Observable +and repeat this process. + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `project` | (`value`: `T`, `index`: `number`) => `O` | A function that, when applied to an item emitted by the source Observable, returns an Observable. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +A function that returns an Observable containing projected +Observables of each item of the source, ignoring projected Observables that +start before their preceding Observable has completed. + +## Example + +Run a finite timer for each click, only if there is no currently active timer + +```ts +import { fromEvent, exhaustMap, interval, take } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(exhaustMap(() => interval(1000).pipe(take(5)))); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [concatMap](concatMap.md) +- [exhaustAll](exhaustAll.md) +- [mergeMap](mergeMap.md) +- [switchMap](switchMap.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/expand.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/expand.md new file mode 100644 index 0000000000..15c174e9c9 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/expand.md @@ -0,0 +1,46 @@ +[API](../../index.md) / [rxjs](../index.md) / expand + +# Function: expand() + +> Recursively projects each source value to an Observable which is merged in +> the output Observable. + +## Description + +It's similar to [mergeMap](mergeMap.md), but applies the +projection function to every source value as well as every output value. +It's recursive. + +![](/images/marble-diagrams/expand.png) + +Returns an Observable that emits items based on applying a function that you +supply to each item emitted by the source Observable, where that function +returns an Observable, and then merging those resulting Observables and +emitting the results of this merger. _Expand_ will re-emit on the output +Observable every source value. Then, each output value is given to the +`project` function which returns an inner Observable to be merged on the +output Observable. Those output values resulting from the projection are also +given to the `project` function to produce new output values. This is how +_expand_ behaves recursively. + +```ts +function expand<>(project: (value: T, index: number) => O, concurrent?: number): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/expand.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/expand.ts#L5) + +## Parameters + +| Parameter | Type | Description | +| ------------- | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `project` | (`value`: `T`, `index`: `number`) => `O` | A function that, when applied to an item emitted by the source or the output Observable, returns an Observable. | +| `concurrent?` | `number` | Maximum number of input Observables being subscribed to concurrently. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +A function that returns an Observable that emits the source values +and also result of applying the projection function to each value emitted on +the output Observable and merging the results of the Observables obtained +from this transformation. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/filter.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/filter.md new file mode 100644 index 0000000000..d893c9dcfb --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/filter.md @@ -0,0 +1,179 @@ +[API](../../index.md) / [rxjs](../index.md) / filter + +# ~~Function: filter()~~ + +> Filter items emitted by the source Observable by only emitting those that +> satisfy a specified predicate. + +## Description + +Like +[Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter), +it only emits a value from the source if it passes a criterion function. + +![](/images/marble-diagrams/filter.png) + +Similar to the well-known `Array.prototype.filter` method, this operator +takes values from the source Observable, passes them through a `predicate` +function and only emits those values that yielded `true`. + +## Example + +Emit only click events whose target was a DIV element + +```ts +import { fromEvent, filter } from 'rxjs'; + +const div = document.createElement('div'); +div.style.cssText = 'width: 200px; height: 200px; background: #09c;'; +document.body.appendChild(div); + +const clicks = fromEvent(document, 'click'); +const clicksOnDivs = clicks.pipe(filter((ev) => (ev.target).tagName === 'DIV')); +clicksOnDivs.subscribe((x) => console.log(x)); +``` + +## See + +- [distinct](distinct.md) +- [distinctUntilChanged](distinctUntilChanged.md) +- [distinctUntilKeyChanged](distinctUntilKeyChanged.md) +- [ignoreElements](ignoreElements.md) +- [partition](partition.md) +- [skip](skip.md) + +evaluates each value emitted by the source Observable. If it returns `true`, +the value is emitted, if `false` the value is not passed to the output +Observable. The `index` parameter is the number `i` for the i-th source +emission that has happened since the subscription, starting from the number +`0`. + +in the `predicate` function. + +## Parameters + +### `predicate` + +A function that + +### `thisArg` + +An optional argument to determine the value of `this` + +## Returns + +`A` + +function that returns an Observable that emits items from the source Observable that satisfy the specified . + +## Call Signature + +```ts +function filter<>(predicate: (this: A, value: T, index: number) => value is S, thisArg: A): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/filter.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/filter.ts#L5) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------------------------------------------------- | +| `predicate` | (`this`: `A`, `value`: `T`, `index`: `number`) => `value is S` | +| `thisArg` | `A` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `S`\> + +### Deprecated + +Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. + +## Call Signature + +```ts +function filter<>(predicate: (value: T, index: number) => value is S): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/filter.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/filter.ts#L6) + +### Parameters + +| Parameter | Type | +| ----------- | ------------------------------------------------- | +| `predicate` | (`value`: `T`, `index`: `number`) => `value is S` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `S`\> + +### Deprecated + +Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. + +## Call Signature + +```ts +function filter<>(predicate: BooleanConstructor): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/filter.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/filter.ts#L7) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------- | +| `predicate` | `BooleanConstructor` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`TruthyTypesOf`](../type-aliases/TruthyTypesOf.md)\<`T`\>\> + +### Deprecated + +Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. + +## Call Signature + +```ts +function filter<>(predicate: (this: A, value: T, index: number) => boolean, thisArg: A): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/filter.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/filter.ts#L9) + +### Parameters + +| Parameter | Type | +| ----------- | ----------------------------------------------------------- | +| `predicate` | (`this`: `A`, `value`: `T`, `index`: `number`) => `boolean` | +| `thisArg` | `A` | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +### Deprecated + +Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. + +## Call Signature + +```ts +function filter<>(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/filter.ts:10](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/filter.ts#L10) + +### Parameters + +| Parameter | Type | +| ----------- | ---------------------------------------------- | +| `predicate` | (`value`: `T`, `index`: `number`) => `boolean` | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +### Deprecated + +Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/finalize.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/finalize.md new file mode 100644 index 0000000000..1bb1dc4ba8 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/finalize.md @@ -0,0 +1,78 @@ +[API](../../index.md) / [rxjs](../index.md) / finalize + +# Function: finalize() + +```ts +function finalize<>(callback: () => void): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/finalize.ts:65](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/finalize.ts#L65) + +Returns an Observable that mirrors the source Observable, but will call a specified function when +the source terminates on complete or error. +The specified function will also be called when the subscriber explicitly unsubscribes. + +## Parameters + +| Parameter | Type | Description | +| ---------- | ------------ | --------------------------------------------- | +| `callback` | () => `void` | Function to be called when source terminates. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that mirrors the source, but +will call the specified function on termination. + +## Example + +Execute callback function when the observable completes + +```ts +import { interval, take, finalize } from 'rxjs'; + +// emit value in sequence every 1 second +const source = interval(1000); +const example = source.pipe( + take(5), //take only the first 5 values + finalize(() => console.log('Sequence complete')) // Execute when the observable completes +); +const subscribe = example.subscribe((val) => console.log(val)); + +// results: +// 0 +// 1 +// 2 +// 3 +// 4 +// 'Sequence complete' +``` + +Execute callback function when the subscriber explicitly unsubscribes + +```ts +import { interval, finalize, tap, noop, timer } from 'rxjs'; + +const source = interval(100).pipe( + finalize(() => console.log('[finalize] Called')), + tap({ + next: () => console.log('[next] Called'), + error: () => console.log('[error] Not called'), + complete: () => console.log('[tap complete] Not called'), + }) +); + +const sub = source.subscribe({ + next: (x) => console.log(x), + error: noop, + complete: () => console.log('[complete] Not called'), +}); + +timer(150).subscribe(() => sub.unsubscribe()); + +// results: +// '[next] Called' +// 0 +// '[finalize] Called' +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/find.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/find.md new file mode 100644 index 0000000000..ce7ef9ce1d --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/find.md @@ -0,0 +1,108 @@ +[API](../../index.md) / [rxjs](../index.md) / find + +# Function: find() + +> Emits only the first value emitted by the source Observable that meets some +> condition. + +## Description + +Finds the first value that passes some test and emits +that. + +![](/images/marble-diagrams/find.png) + +`find` searches for the first item in the source Observable that matches the +specified condition embodied by the `predicate`, and returns the first +occurrence in the source. Unlike [first](first.md), the `predicate` is required +in `find`, and does not emit an error if a valid value is not found +(emits `undefined` instead). + +## Example + +Find and emit the first click that happens on a DIV element + +```ts +import { fromEvent, find } from 'rxjs'; + +const div = document.createElement('div'); +div.style.cssText = 'width: 200px; height: 200px; background: #09c;'; +document.body.appendChild(div); + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(find((ev) => (ev.target).tagName === 'DIV')); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [filter](filter.md) +- [first](first.md) +- [findIndex](findIndex.md) +- [take](take.md) + +## Parameters + +### `predicate` + +A function called with each item to test for condition matching. + +## Returns + +`A` + +function that returns an Observable that emits the first item that matches the condition. + +## Call Signature + +```ts +function find<>(predicate: BooleanConstructor): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/find.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/find.ts#L5) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------- | +| `predicate` | `BooleanConstructor` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`TruthyTypesOf`](../type-aliases/TruthyTypesOf.md)\<`T`\>\> + +## Call Signature + +```ts +function find<>(predicate: (value: T, index: number, source: Observable) => value is S): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/find.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/find.ts#L6) + +### Parameters + +| Parameter | Type | +| ----------- | ------------------------------------------------------------------------------------------------------------ | +| `predicate` | (`value`: `T`, `index`: `number`, `source`: [`Observable`](../classes/Observable.md)\<`T`\>) => `value is S` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `S` \| `undefined`\> + +## Call Signature + +```ts +function find<>(predicate: (value: T, index: number, source: Observable) => boolean): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/find.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/find.ts#L9) + +### Parameters + +| Parameter | Type | +| ----------- | --------------------------------------------------------------------------------------------------------- | +| `predicate` | (`value`: `T`, `index`: `number`, `source`: [`Observable`](../classes/Observable.md)\<`T`\>) => `boolean` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `undefined`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/findIndex.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/findIndex.md new file mode 100644 index 0000000000..4775a7b849 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/findIndex.md @@ -0,0 +1,92 @@ +[API](../../index.md) / [rxjs](../index.md) / findIndex + +# Function: findIndex() + +> Emits only the index of the first value emitted by the source Observable that +> meets some condition. + +## Description + +It's like [find](find.md), but emits the index of the +found value, not the value itself. + +![](/images/marble-diagrams/findIndex.png) + +`findIndex` searches for the first item in the source Observable that matches +the specified condition embodied by the `predicate`, and returns the +(zero-based) index of the first occurrence in the source. Unlike +[first](first.md), the `predicate` is required in `findIndex`, and does not emit +an error if a valid value is not found. + +## Example + +Emit the index of first click that happens on a DIV element + +```ts +import { fromEvent, findIndex } from 'rxjs'; + +const div = document.createElement('div'); +div.style.cssText = 'width: 200px; height: 200px; background: #09c;'; +document.body.appendChild(div); + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(findIndex((ev) => (ev.target).tagName === 'DIV')); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [filter](filter.md) +- [find](find.md) +- [first](first.md) +- [take](take.md) + +matching. + +## Parameters + +### `predicate` + +A function called with each item to test for condition + +## Returns + +`A` + +function that returns an Observable that emits the index of the first item that matches the condition. + +## Call Signature + +```ts +function findIndex<>(predicate: BooleanConstructor): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/findIndex.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/findIndex.ts#L5) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------- | +| `predicate` | `BooleanConstructor` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` _extends_ [`Falsy`](../type-aliases/Falsy.md) ? `-1` : `number`\> + +## Call Signature + +```ts +function findIndex<>(predicate: (value: T, index: number, source: Observable) => boolean): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/findIndex.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/findIndex.ts#L6) + +### Parameters + +| Parameter | Type | +| ----------- | --------------------------------------------------------------------------------------------------------- | +| `predicate` | (`value`: `T`, `index`: `number`, `source`: [`Observable`](../classes/Observable.md)\<`T`\>) => `boolean` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `number`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/first.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/first.md new file mode 100644 index 0000000000..e32287f1d4 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/first.md @@ -0,0 +1,190 @@ +[API](../../index.md) / [rxjs](../index.md) / first + +# Function: first() + +> Emits only the first value (or the first value that meets some condition) +> emitted by the source Observable. + +## Description + +Emits only the first value. Or emits only the first +value that passes some test. + +![](/images/marble-diagrams/first.png) + +If called with no arguments, `first` emits the first value of the source +Observable, then completes. If called with a `predicate` function, `first` +emits the first value of the source that matches the specified condition. Emits an error +notification if `defaultValue` was not provided and a matching element is not found. + +## Example + +Emit only the first click that happens on the DOM + +```ts +import { fromEvent, first } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(first()); +result.subscribe((x) => console.log(x)); +``` + +Emits the first click that happens on a DIV + +```ts +import { fromEvent, first } from 'rxjs'; + +const div = document.createElement('div'); +div.style.cssText = 'width: 200px; height: 200px; background: #09c;'; +document.body.appendChild(div); + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(first((ev) => (ev.target).tagName === 'DIV')); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [filter](filter.md) +- [find](find.md) +- [take](take.md) +- [last](last.md) + +## Throws + +Delivers an `EmptyError` to the Observer's `error` +callback if the Observable completes before any `next` notification was sent. +This is how `first()` is different from `take(1)` which completes instead. + +matching. + +the source. + +## Parameters + +### `predicate` + +An optional function called with each item to test for condition + +### `defaultValue` + +The default value emitted in case no valid value was found on + +## Returns + +`A` + +function that returns an Observable that emits the first item that matches the condition. + +## Call Signature + +```ts +function first<>(predicate?: null, defaultValue?: D): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/first.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/first.ts#L7) + +### Parameters + +| Parameter | Type | +| --------------- | ------ | +| `predicate?` | `null` | +| `defaultValue?` | `D` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `D`\> + +## Call Signature + +```ts +function first<>(predicate: BooleanConstructor): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/first.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/first.ts#L8) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------- | +| `predicate` | `BooleanConstructor` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`TruthyTypesOf`](../type-aliases/TruthyTypesOf.md)\<`T`\>\> + +## Call Signature + +```ts +function first<>(predicate: BooleanConstructor, defaultValue: D): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/first.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/first.ts#L9) + +### Parameters + +| Parameter | Type | +| -------------- | -------------------- | +| `predicate` | `BooleanConstructor` | +| `defaultValue` | `D` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `D` \| [`TruthyTypesOf`](../type-aliases/TruthyTypesOf.md)\<`T`\>\> + +## Call Signature + +```ts +function first<>(predicate: (value: T, index: number, source: Observable) => value is S, defaultValue?: S): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/first.ts:10](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/first.ts#L10) + +### Parameters + +| Parameter | Type | +| --------------- | ------------------------------------------------------------------------------------------------------------ | +| `predicate` | (`value`: `T`, `index`: `number`, `source`: [`Observable`](../classes/Observable.md)\<`T`\>) => `value is S` | +| `defaultValue?` | `S` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `S`\> + +## Call Signature + +```ts +function first<>(predicate: (value: T, index: number, source: Observable) => value is S, defaultValue: D): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/first.ts:14](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/first.ts#L14) + +### Parameters + +| Parameter | Type | +| -------------- | ------------------------------------------------------------------------------------------------------------ | +| `predicate` | (`value`: `T`, `index`: `number`, `source`: [`Observable`](../classes/Observable.md)\<`T`\>) => `value is S` | +| `defaultValue` | `D` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `S` \| `D`\> + +## Call Signature + +```ts +function first<>(predicate: (value: T, index: number, source: Observable) => boolean, defaultValue?: D): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/first.ts:18](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/first.ts#L18) + +### Parameters + +| Parameter | Type | +| --------------- | --------------------------------------------------------------------------------------------------------- | +| `predicate` | (`value`: `T`, `index`: `number`, `source`: [`Observable`](../classes/Observable.md)\<`T`\>) => `boolean` | +| `defaultValue?` | `D` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `D`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/firstValueFrom.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/firstValueFrom.md new file mode 100644 index 0000000000..d65bfc5c59 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/firstValueFrom.md @@ -0,0 +1,94 @@ +[API](../../index.md) / [rxjs](../index.md) / firstValueFrom + +# Function: firstValueFrom() + +> Converts an observable to a promise by subscribing to the observable, +> and returning a promise that will resolve as soon as the first value +> arrives from the observable. The subscription will then be closed. + +## Description + +If the observable stream completes before any values were emitted, the +returned promise will reject with [EmptyError](../classes/EmptyError.md) or will resolve +with the default value if a default was specified. + +If the observable stream emits an error, the returned promise will reject +with that error. + +**WARNING**: Only use this with observables you _know_ will emit at least one value, +_OR_ complete. If the source observable does not emit one value or complete, you will +end up with a promise that is hung up, and potentially all of the state of an +async function hanging out in memory. To avoid this situation, look into adding +something like [timeout](timeout.md), [take](take.md), [takeWhile](takeWhile.md), or [takeUntil](takeUntil.md) +amongst others. + +## Example + +Wait for the first value from a stream and emit it from a promise in +an async function + +```ts +import { interval, firstValueFrom } from 'rxjs'; + +async function execute() { + const source$ = interval(2000); + const firstNumber = await firstValueFrom(source$); + console.log(`The first number is ${firstNumber}`); +} + +execute(); + +// Expected output: +// 'The first number is 0' +``` + +## See + +[lastValueFrom](lastValueFrom.md) + +## Parameters + +### `source` + +the observable to convert to a promise + +### `config` + +a configuration object to define the `defaultValue` to use if the source completes without emitting a value + +## Call Signature + +```ts +function firstValueFrom<>(source: Observable, config: FirstValueFromConfig): Promise; +``` + +Defined in: [rxjs/src/internal/firstValueFrom.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/firstValueFrom.ts#L9) + +### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------- | +| `source` | [`Observable`](../classes/Observable.md)\<`T`\> | +| `config` | `FirstValueFromConfig`\<`D`\> | + +### Returns + +`Promise`\<`T` \| `D`\> + +## Call Signature + +```ts +function firstValueFrom<>(source: Observable): Promise; +``` + +Defined in: [rxjs/src/internal/firstValueFrom.ts:10](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/firstValueFrom.ts#L10) + +### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------- | +| `source` | [`Observable`](../classes/Observable.md)\<`T`\> | + +### Returns + +`Promise`\<`T`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/forkJoin.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/forkJoin.md new file mode 100644 index 0000000000..917ad1fbed --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/forkJoin.md @@ -0,0 +1,299 @@ +[API](../../index.md) / [rxjs](../index.md) / forkJoin + +# Function: forkJoin() + +> Accepts an `Array` of [ObservableInput](../type-aliases/ObservableInput.md) or a dictionary `Object` of [ObservableInput](../type-aliases/ObservableInput.md) and returns +> an [Observable](../classes/Observable.md) that emits either an array of values in the exact same order as the passed array, +> or a dictionary of values in the same shape as the passed dictionary. + +## Description + +Wait for Observables to complete and then combine last values they emitted; +complete immediately if an empty array is passed. + +![](/images/marble-diagrams/forkJoin.png) + +`forkJoin` is an operator that takes any number of input observables which can be passed either as an array +or a dictionary of input observables. If no input observables are provided (e.g. an empty array is passed), +then the resulting stream will complete immediately. + +`forkJoin` will wait for all passed observables to emit and complete and then it will emit an array or an object with last +values from corresponding observables. + +If you pass an array of `n` observables to the operator, then the resulting +array will have `n` values, where the first value is the last one emitted by the first observable, +second value is the last one emitted by the second observable and so on. + +If you pass a dictionary of observables to the operator, then the resulting +objects will have the same keys as the dictionary passed, with their last values they have emitted +located at the corresponding key. + +That means `forkJoin` will not emit more than once and it will complete after that. If you need to emit combined +values not only at the end of the lifecycle of passed observables, but also throughout it, try out [combineLatest](combineLatest.md) +or [zip](zip.md) instead. + +In order for the resulting array to have the same length as the number of input observables, whenever any of +the given observables completes without emitting any value, `forkJoin` will complete at that moment as well +and it will not emit anything either, even if it already has some last values from other observables. +Conversely, if there is an observable that never completes, `forkJoin` will never complete either, +unless at any point some other observable completes without emitting a value, which brings us back to +the previous case. Overall, in order for `forkJoin` to emit a value, all given observables +have to emit something at least once and complete. + +If any given observable errors at some point, `forkJoin` will error as well and immediately unsubscribe +from the other observables. + +Optionally `forkJoin` accepts a `resultSelector` function, that will be called with values which normally +would land in the emitted array. Whatever is returned by the `resultSelector`, will appear in the output +observable instead. This means that the default `resultSelector` can be thought of as a function that takes +all its arguments and puts them into an array. Note that the `resultSelector` will be called only +when `forkJoin` is supposed to emit a result. + +## Example + +Use `forkJoin` with a dictionary of observable inputs + +```ts +import { forkJoin, of, timer } from 'rxjs'; + +const observable = forkJoin({ + foo: of(1, 2, 3, 4), + bar: Promise.resolve(8), + baz: timer(4000), +}); +observable.subscribe({ + next: (value) => console.log(value), + complete: () => console.log('This is how it ends!'), +}); + +// Logs: +// { foo: 4, bar: 8, baz: 0 } after 4 seconds +// 'This is how it ends!' immediately after +``` + +Use `forkJoin` with an array of observable inputs + +```ts +import { forkJoin, of, timer } from 'rxjs'; + +const observable = forkJoin([of(1, 2, 3, 4), Promise.resolve(8), timer(4000)]); +observable.subscribe({ + next: (value) => console.log(value), + complete: () => console.log('This is how it ends!'), +}); + +// Logs: +// [4, 8, 0] after 4 seconds +// 'This is how it ends!' immediately after +``` + +## See + +- [combineLatest](combineLatest.md) +- [zip](zip.md) + +passed directly to the operator. + +## Parameters + +### `args` + +Any number of `ObservableInput`s provided either as an array or as an object + +## Returns + +`Observable` + +emitting either an array of last values emitted by passed Observables or value from project function. + +## Call Signature + +```ts +function forkJoin<>(arg: T): Observable; +``` + +Defined in: [rxjs/src/internal/observable/forkJoin.ts:21](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/forkJoin.ts#L21) + +You have passed `any` here, we can't figure out if it is +an array or an object, so you're getting `unknown`. Use better types. + +### Parameters + +| Parameter | Type | Description | +| --------- | ---- | ------------------------ | +| `arg` | `T` | Something typed as `any` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`unknown`\> + +## Call Signature + +```ts +function forkJoin(scheduler: null | undefined): Observable; +``` + +Defined in: [rxjs/src/internal/observable/forkJoin.ts:24](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/forkJoin.ts#L24) + +You have passed `any` here, we can't figure out if it is +an array or an object, so you're getting `unknown`. Use better types. + +### Parameters + +| Parameter | Type | +| ----------- | --------------------- | +| `scheduler` | `null` \| `undefined` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`never`\> + +## Call Signature + +```ts +function forkJoin(sources: readonly []): Observable; +``` + +Defined in: [rxjs/src/internal/observable/forkJoin.ts:27](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/forkJoin.ts#L27) + +You have passed `any` here, we can't figure out if it is +an array or an object, so you're getting `unknown`. Use better types. + +### Parameters + +| Parameter | Type | +| --------- | ------------- | +| `sources` | readonly \[\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`never`\> + +## Call Signature + +```ts +function forkJoin<>(sources: readonly [ObservableInputTuple
]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/forkJoin.ts:28](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/forkJoin.ts#L28) + +You have passed `any` here, we can't figure out if it is +an array or an object, so you're getting `unknown`. Use better types. + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------------------------------- | +| `sources` | readonly \[[`ObservableInputTuple`](../type-aliases/ObservableInputTuple.md)\<`A`\>\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`A`\> + +## Call Signature + +```ts +function forkJoin<>(sources: readonly [ObservableInputTuple], resultSelector: (...values: A) => R): Observable; +``` + +Defined in: [rxjs/src/internal/observable/forkJoin.ts:29](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/forkJoin.ts#L29) + +You have passed `any` here, we can't figure out if it is +an array or an object, so you're getting `unknown`. Use better types. + +### Parameters + +| Parameter | Type | +| ---------------- | ------------------------------------------------------------------------------------- | +| `sources` | readonly \[[`ObservableInputTuple`](../type-aliases/ObservableInputTuple.md)\<`A`\>\] | +| `resultSelector` | (...`values`: `A`) => `R` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`R`\> + +## Call Signature + +```ts +function forkJoin<>(...sources: [...ObservableInputTuple[]]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/forkJoin.ts:36](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/forkJoin.ts#L36) + +### Parameters + +| Parameter | Type | +| ------------ | ---------------------------------- | +| ...`sources` | \[`...ObservableInputTuple[]`\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`A`\> + +### Deprecated + +Pass an array of sources instead. The rest-parameters signature will be removed in v8. Details: https://rxjs.dev/deprecations/array-argument + +## Call Signature + +```ts +function forkJoin<>(...sourcesAndResultSelector: [...ObservableInputTuple[], (...values: A) => R]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/forkJoin.ts:38](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/forkJoin.ts#L38) + +### Parameters + +| Parameter | Type | +| ----------------------------- | ------------------------------------------------------------- | +| ...`sourcesAndResultSelector` | \[`...ObservableInputTuple[]`, (...`values`: `A`) => `R`\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`R`\> + +### Deprecated + +Pass an array of sources instead. The rest-parameters signature will be removed in v8. Details: https://rxjs.dev/deprecations/array-argument + +## Call Signature + +```ts +function forkJoin(sourcesObject: { [key: string]: never; [key: number]: never; [key: symbol]: never }): Observable; +``` + +Defined in: [rxjs/src/internal/observable/forkJoin.ts:43](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/forkJoin.ts#L43) + +You have passed `any` here, we can't figure out if it is +an array or an object, so you're getting `unknown`. Use better types. + +### Parameters + +| Parameter | Type | +| --------------- | ----------------------------------------------------------------------------------------------- | +| `sourcesObject` | \{ \[`key`: `string`\]: `never`; \[`key`: `number`\]: `never`; \[`key`: `symbol`\]: `never`; \} | + +### Returns + +[`Observable`](../classes/Observable.md)\<`never`\> + +## Call Signature + +```ts +function forkJoin<>(sourcesObject: T): Observable<{ [K in string | number | symbol]: ObservedValueOf }>; +``` + +Defined in: [rxjs/src/internal/observable/forkJoin.ts:44](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/forkJoin.ts#L44) + +You have passed `any` here, we can't figure out if it is +an array or an object, so you're getting `unknown`. Use better types. + +### Parameters + +| Parameter | Type | +| --------------- | ---- | +| `sourcesObject` | `T` | + +### Returns + +[`Observable`](../classes/Observable.md)\<\{ \[K in string \| number \| symbol\]: ObservedValueOf\ \}\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/from.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/from.md new file mode 100644 index 0000000000..0d46e5bf8c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/from.md @@ -0,0 +1,86 @@ +[API](../../index.md) / [rxjs](../index.md) / from + +# Function: from() + +```ts +function from<>(input: O): Observable>; +``` + +Defined in: [observable/src/observable.ts:1106](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L1106) + +Creates an Observable from an Array, an array-like object, a Promise, an iterable object, or an Observable-like object. + +Converts almost anything to an Observable. + +![](/images/marble-diagrams/from.png) + +`from` converts various other objects and data types into Observables. It also converts a Promise, an array-like, or an +iterable +object into an Observable that emits the items in that promise, array, or iterable. A String, in this context, is treated +as an array of characters. Observable-like objects (contains a function named with the ES2015 Symbol for Observable) can also be +converted through this operator. + +## Parameters + +| Parameter | Type | Description | +| --------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `input` | `O` | A subscription object, a Promise, an Observable-like, an Array, an iterable, async iterable, or an array-like object to be converted. | + +## Returns + +[`Observable`](../classes/Observable.md)\<`ObservedValueOf`\<`O`\>\> + +## Example + +Converts an array to an Observable + +```ts +import { from } from 'rxjs'; + +const array = [10, 20, 30]; +const result = from(array); + +result.subscribe((x) => console.log(x)); + +// Logs: +// 10 +// 20 +// 30 +``` + +Convert an infinite iterable (from a generator) to an Observable + +```ts +import { from, take } from 'rxjs'; + +function* generateDoubles(seed) { + let i = seed; + while (true) { + yield i; + i = 2 * i; // double it + } +} + +const iterator = generateDoubles(3); +const result = from(iterator).pipe(take(10)); + +result.subscribe((x) => console.log(x)); + +// Logs: +// 3 +// 6 +// 12 +// 24 +// 48 +// 96 +// 192 +// 384 +// 768 +// 1536 +``` + +## See + +- [fromEvent](fromEvent.md) +- [fromEventPattern](fromEventPattern.md) +- [scheduled](scheduled.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/fromEvent.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/fromEvent.md new file mode 100644 index 0000000000..21119dbec0 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/fromEvent.md @@ -0,0 +1,416 @@ +[API](../../index.md) / [rxjs](../index.md) / fromEvent + +# Function: fromEvent() + +> Creates an Observable that emits events of a specific type coming from the +> given event target. + +## Description + +Creates an Observable from DOM events, or Node.js +EventEmitter events or others. + +![](/images/marble-diagrams/fromEvent.png) + +`fromEvent` accepts as a first argument event target, which is an object with methods +for registering event handler functions. As a second argument it takes string that indicates +type of event we want to listen for. `fromEvent` supports selected types of event targets, +which are described in detail below. If your event target does not match any of the ones listed, +you should use [fromEventPattern](fromEventPattern.md), which can be used on arbitrary APIs. +When it comes to APIs supported by `fromEvent`, their methods for adding and removing event +handler functions have different names, but they all accept a string describing event type +and function itself, which will be called whenever said event happens. + +Every time resulting Observable is subscribed, event handler function will be registered +to event target on given event type. When that event fires, value +passed as a first argument to registered function will be emitted by output Observable. +When Observable is unsubscribed, function will be unregistered from event target. + +Note that if event target calls registered function with more than one argument, second +and following arguments will not appear in resulting stream. In order to get access to them, +you can pass to `fromEvent` optional project function, which will be called with all arguments +passed to event handler. Output Observable will then emit value returned by project function, +instead of the usual value. + +Remember that event targets listed below are checked via duck typing. It means that +no matter what kind of object you have and no matter what environment you work in, +you can safely use `fromEvent` on that object if it exposes described methods (provided +of course they behave as was described above). So for example if Node.js library exposes +event target which has the same method names as DOM EventTarget, `fromEvent` is still +a good choice. + +If the API you use is more callback then event handler oriented (subscribed +callback function fires only once and thus there is no need to manually +unregister it), you should use [bindCallback](bindCallback.md) or [bindNodeCallback](bindNodeCallback.md) +instead. + +`fromEvent` supports following types of event targets: + +**DOM EventTarget** + +This is an object with `addEventListener` and `removeEventListener` methods. + +In the browser, `addEventListener` accepts - apart from event type string and event +handler function arguments - optional third parameter, which is either an object or boolean, +both used for additional configuration how and when passed function will be called. When +`fromEvent` is used with event target of that type, you can provide this values +as third parameter as well. + +**Node.js EventEmitter** + +An object with `addListener` and `removeListener` methods. + +**JQuery-style event target** + +An object with `on` and `off` methods + +**DOM NodeList** + +List of DOM Nodes, returned for example by `document.querySelectorAll` or `Node.childNodes`. + +Although this collection is not event target in itself, `fromEvent` will iterate over all Nodes +it contains and install event handler function in every of them. When returned Observable +is unsubscribed, function will be removed from all Nodes. + +**DOM HtmlCollection** + +Just as in case of NodeList it is a collection of DOM nodes. Here as well event handler function is +installed and removed in each of elements. + +## Example + +Emit clicks happening on the DOM document + +```ts +import { fromEvent } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +clicks.subscribe((x) => console.log(x)); + +// Results in: +// MouseEvent object logged to console every time a click +// occurs on the document. +``` + +Use `addEventListener` with capture option + +```ts +import { fromEvent } from 'rxjs'; + +const div = document.createElement('div'); +div.style.cssText = 'width: 200px; height: 200px; background: #09c;'; +document.body.appendChild(div); + +// note optional configuration parameter which will be passed to addEventListener +const clicksInDocument = fromEvent(document, 'click', { capture: true }); +const clicksInDiv = fromEvent(div, 'click'); + +clicksInDocument.subscribe(() => console.log('document')); +clicksInDiv.subscribe(() => console.log('div')); + +// By default events bubble UP in DOM tree, so normally +// when we would click on div in document +// "div" would be logged first and then "document". +// Since we specified optional `capture` option, document +// will catch event when it goes DOWN DOM tree, so console +// will log "document" and then "div". +``` + +## See + +- [bindCallback](bindCallback.md) +- [bindNodeCallback](bindNodeCallback.md) +- [fromEventPattern](fromEventPattern.md) + +NodeList or HTMLCollection to attach the event handler to. + +`addEventListener` or `on` functions. + +arguments from the event handler and should return a single value. + +## Parameters + +### `target` + +The DOM EventTarget, Node.js EventEmitter, JQuery-like event target, + +### `eventName` + +The event name of interest, being emitted by the `target`. + +### `options` + +Options to pass through to the underlying `addListener`, + +### `resultSelector` + +A mapping function used to transform events. It takes the + +## Returns + +`An` + +Observable emitting events registered through 's listener handlers. + +## Call Signature + +```ts +function fromEvent<>(target: HasEventTargetAddRemove | ArrayLike>, eventName: string): Observable; +``` + +Defined in: [rxjs/src/internal/observable/fromEvent.ts:63](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/fromEvent.ts#L63) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------------------------------------------------------------------------- | +| `target` | \| `HasEventTargetAddRemove`\<`T`\> \| `ArrayLike`\<`HasEventTargetAddRemove`\<`T`\>\> | +| `eventName` | `string` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`T`\> + +## Call Signature + +```ts +function fromEvent<>( + target: HasEventTargetAddRemove | ArrayLike>, + eventName: string, + resultSelector: (event: T) => R +): Observable; +``` + +Defined in: [rxjs/src/internal/observable/fromEvent.ts:64](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/fromEvent.ts#L64) + +### Parameters + +| Parameter | Type | +| ---------------- | -------------------------------------------------------------------------------------- | +| `target` | \| `HasEventTargetAddRemove`\<`T`\> \| `ArrayLike`\<`HasEventTargetAddRemove`\<`T`\>\> | +| `eventName` | `string` | +| `resultSelector` | (`event`: `T`) => `R` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`R`\> + +## Call Signature + +```ts +function fromEvent<>( + target: HasEventTargetAddRemove | ArrayLike>, + eventName: string, + options: EventListenerOptions +): Observable; +``` + +Defined in: [rxjs/src/internal/observable/fromEvent.ts:69](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/fromEvent.ts#L69) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------------------------------------------------------------------------- | +| `target` | \| `HasEventTargetAddRemove`\<`T`\> \| `ArrayLike`\<`HasEventTargetAddRemove`\<`T`\>\> | +| `eventName` | `string` | +| `options` | `EventListenerOptions` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`T`\> + +## Call Signature + +```ts +function fromEvent<>( + target: HasEventTargetAddRemove | ArrayLike>, + eventName: string, + options: EventListenerOptions, + resultSelector: (event: T) => R +): Observable; +``` + +Defined in: [rxjs/src/internal/observable/fromEvent.ts:74](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/fromEvent.ts#L74) + +### Parameters + +| Parameter | Type | +| ---------------- | -------------------------------------------------------------------------------------- | +| `target` | \| `HasEventTargetAddRemove`\<`T`\> \| `ArrayLike`\<`HasEventTargetAddRemove`\<`T`\>\> | +| `eventName` | `string` | +| `options` | `EventListenerOptions` | +| `resultSelector` | (`event`: `T`) => `R` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`R`\> + +## Call Signature + +```ts +function fromEvent(target: NodeStyleEventEmitter | ArrayLike, eventName: string | symbol): Observable; +``` + +Defined in: [rxjs/src/internal/observable/fromEvent.ts:81](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/fromEvent.ts#L81) + +### Parameters + +| Parameter | Type | +| ----------- | ----------------------------------------------------------------- | +| `target` | `NodeStyleEventEmitter` \| `ArrayLike`\<`NodeStyleEventEmitter`\> | +| `eventName` | `string` \| `symbol` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`unknown`\> + +## Call Signature + +```ts +function fromEvent<>(target: NodeStyleEventEmitter | ArrayLike, eventName: string | symbol): Observable; +``` + +Defined in: [rxjs/src/internal/observable/fromEvent.ts:85](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/fromEvent.ts#L85) + +### Parameters + +| Parameter | Type | +| ----------- | ----------------------------------------------------------------- | +| `target` | `NodeStyleEventEmitter` \| `ArrayLike`\<`NodeStyleEventEmitter`\> | +| `eventName` | `string` \| `symbol` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`T`\> + +## Call Signature + +```ts +function fromEvent<>( + target: NodeStyleEventEmitter | ArrayLike, + eventName: string | symbol, + resultSelector: (...args: any[]) => R +): Observable; +``` + +Defined in: [rxjs/src/internal/observable/fromEvent.ts:86](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/fromEvent.ts#L86) + +### Parameters + +| Parameter | Type | +| ---------------- | ----------------------------------------------------------------- | +| `target` | `NodeStyleEventEmitter` \| `ArrayLike`\<`NodeStyleEventEmitter`\> | +| `eventName` | `string` \| `symbol` | +| `resultSelector` | (...`args`: `any`[]) => `R` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`R`\> + +## Call Signature + +```ts +function fromEvent(target: NodeCompatibleEventEmitter | ArrayLike, eventName: string): Observable; +``` + +Defined in: [rxjs/src/internal/observable/fromEvent.ts:92](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/fromEvent.ts#L92) + +### Parameters + +| Parameter | Type | +| ----------- | ------------------------------------------------------------------------------ | +| `target` | \| `NodeCompatibleEventEmitter` \| `ArrayLike`\<`NodeCompatibleEventEmitter`\> | +| `eventName` | `string` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`unknown`\> + +## Call Signature + +```ts +function fromEvent<>(target: NodeCompatibleEventEmitter | ArrayLike, eventName: string): Observable; +``` + +Defined in: [rxjs/src/internal/observable/fromEvent.ts:96](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/fromEvent.ts#L96) + +### Parameters + +| Parameter | Type | +| ----------- | ------------------------------------------------------------------------------ | +| `target` | \| `NodeCompatibleEventEmitter` \| `ArrayLike`\<`NodeCompatibleEventEmitter`\> | +| `eventName` | `string` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`T`\> + +## Call Signature + +```ts +function fromEvent<>( + target: NodeCompatibleEventEmitter | ArrayLike, + eventName: string, + resultSelector: (...args: any[]) => R +): Observable; +``` + +Defined in: [rxjs/src/internal/observable/fromEvent.ts:97](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/fromEvent.ts#L97) + +### Parameters + +| Parameter | Type | +| ---------------- | ------------------------------------------------------------------------------ | +| `target` | \| `NodeCompatibleEventEmitter` \| `ArrayLike`\<`NodeCompatibleEventEmitter`\> | +| `eventName` | `string` | +| `resultSelector` | (...`args`: `any`[]) => `R` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`R`\> + +## Call Signature + +```ts +function fromEvent<>( + target: JQueryStyleEventEmitter | ArrayLike>, + eventName: string +): Observable; +``` + +Defined in: [rxjs/src/internal/observable/fromEvent.ts:103](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/fromEvent.ts#L103) + +### Parameters + +| Parameter | Type | +| ----------- | ---------------------------------------------------------------------------------------------------- | +| `target` | \| `JQueryStyleEventEmitter`\<`any`, `T`\> \| `ArrayLike`\<`JQueryStyleEventEmitter`\<`any`, `T`\>\> | +| `eventName` | `string` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`T`\> + +## Call Signature + +```ts +function fromEvent<>( + target: JQueryStyleEventEmitter | ArrayLike>, + eventName: string, + resultSelector: (value: T, ...args: any[]) => R +): Observable; +``` + +Defined in: [rxjs/src/internal/observable/fromEvent.ts:107](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/fromEvent.ts#L107) + +### Parameters + +| Parameter | Type | +| ---------------- | ---------------------------------------------------------------------------------------------------- | +| `target` | \| `JQueryStyleEventEmitter`\<`any`, `T`\> \| `ArrayLike`\<`JQueryStyleEventEmitter`\<`any`, `T`\>\> | +| `eventName` | `string` | +| `resultSelector` | (`value`: `T`, ...`args`: `any`[]) => `R` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`R`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/fromEventPattern.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/fromEventPattern.md new file mode 100644 index 0000000000..38c3cee37a --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/fromEventPattern.md @@ -0,0 +1,190 @@ +[API](../../index.md) / [rxjs](../index.md) / fromEventPattern + +# Function: fromEventPattern() + +> Creates an Observable from an arbitrary API for registering event handlers. + +## Description + +When that method for adding event handler was something [fromEvent](fromEvent.md) +was not prepared for. + +![](/images/marble-diagrams/fromEventPattern.png) + +`fromEventPattern` allows you to convert into an Observable any API that supports registering handler functions +for events. It is similar to [fromEvent](fromEvent.md), but far +more flexible. In fact, all use cases of [fromEvent](fromEvent.md) could be easily handled by +`fromEventPattern` (although in slightly more verbose way). + +This operator accepts as a first argument an `addHandler` function, which will be injected with +handler parameter. That handler is actually an event handler function that you now can pass +to API expecting it. `addHandler` will be called whenever Observable +returned by the operator is subscribed, so registering handler in API will not +necessarily happen when `fromEventPattern` is called. + +After registration, every time an event that we listen to happens, +Observable returned by `fromEventPattern` will emit value that event handler +function was called with. Note that if event handler was called with more +than one argument, second and following arguments will not appear in the Observable. + +If API you are using allows to unregister event handlers as well, you can pass to `fromEventPattern` +another function - `removeHandler` - as a second parameter. It will be injected +with the same handler function as before, which now you can use to unregister +it from the API. `removeHandler` will be called when consumer of resulting Observable +unsubscribes from it. + +In some APIs unregistering is actually handled differently. Method registering an event handler +returns some kind of token, which is later used to identify which function should +be unregistered or it itself has method that unregisters event handler. +If that is the case with your API, make sure token returned +by registering method is returned by `addHandler`. Then it will be passed +as a second argument to `removeHandler`, where you will be able to use it. + +If you need access to all event handler parameters (not only the first one), +or you need to transform them in any way, you can call `fromEventPattern` with optional +third parameter - project function which will accept all arguments passed to +event handler when it is called. Whatever is returned from project function will appear on +resulting stream instead of usual event handlers first argument. This means +that default project can be thought of as function that takes its first parameter +and ignores the rest. + +## Example + +Emits clicks happening on the DOM document + +```ts +import { fromEventPattern } from 'rxjs'; + +function addClickHandler(handler) { + document.addEventListener('click', handler); +} + +function removeClickHandler(handler) { + document.removeEventListener('click', handler); +} + +const clicks = fromEventPattern(addClickHandler, removeClickHandler); +clicks.subscribe((x) => console.log(x)); + +// Whenever you click anywhere in the browser, DOM MouseEvent +// object will be logged. +``` + +Use with API that returns cancellation token + +```ts +import { fromEventPattern } from 'rxjs'; + +const token = someAPI.registerEventHandler(function () {}); +someAPI.unregisterEventHandler(token); // this APIs cancellation method accepts +// not handler itself, but special token. + +const someAPIObservable = fromEventPattern( + function (handler) { + return someAPI.registerEventHandler(handler); + }, // Note that we return the token here... + function (handler, token) { + someAPI.unregisterEventHandler(token); + } // ...to then use it here. +); +``` + +Use with project function + +```ts +import { fromEventPattern } from 'rxjs'; + +someAPI.registerEventHandler((eventType, eventMessage) => { + console.log(eventType, eventMessage); // Logs 'EVENT_TYPE' 'EVENT_MESSAGE' to console. +}); + +const someAPIObservable = fromEventPattern( + handler => someAPI.registerEventHandler(handler), + handler => someAPI.unregisterEventHandler(handler) + (eventType, eventMessage) => eventType + ' --- ' + eventMessage // without that function only 'EVENT_TYPE' +); // would be emitted by the Observable + +someAPIObservable.subscribe(value => console.log(value)); + +// Logs: +// 'EVENT_TYPE --- EVENT_MESSAGE' +``` + +## See + +- [fromEvent](fromEvent.md) +- [bindCallback](bindCallback.md) +- [bindNodeCallback](bindNodeCallback.md) + +somehow to the actual source of events. + +it from the event source. If `addHandler` returns some kind of token, `removeHandler` function +will have it as a second parameter. + +handler and should return a single value. + +## Parameters + +### `addHandler` + +A function that takes a `handler` function as argument and attaches it + +### `removeHandler` + +A function that takes a `handler` function as an argument and removes + +### `resultSelector` + +A function to transform results. It takes the arguments from the event + +## Returns + +`Observable` + +which, when an event happens, emits first parameter passed to registered event handler. Alternatively it emits whatever project function returns at that moment. + +## Call Signature + +```ts +function fromEventPattern<>( + addHandler: (handler: NodeEventHandler) => any, + removeHandler?: (handler: NodeEventHandler, signal?: any) => void +): Observable; +``` + +Defined in: [rxjs/src/internal/observable/fromEventPattern.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/fromEventPattern.ts#L5) + +### Parameters + +| Parameter | Type | +| ---------------- | ----------------------------------------------------------- | +| `addHandler` | (`handler`: `NodeEventHandler`) => `any` | +| `removeHandler?` | (`handler`: `NodeEventHandler`, `signal?`: `any`) => `void` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`T`\> + +## Call Signature + +```ts +function fromEventPattern<>( + addHandler: (handler: NodeEventHandler) => any, + removeHandler?: (handler: NodeEventHandler, signal?: any) => void, + resultSelector?: (...args: any[]) => T +): Observable; +``` + +Defined in: [rxjs/src/internal/observable/fromEventPattern.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/fromEventPattern.ts#L9) + +### Parameters + +| Parameter | Type | +| ----------------- | ----------------------------------------------------------- | +| `addHandler` | (`handler`: `NodeEventHandler`) => `any` | +| `removeHandler?` | (`handler`: `NodeEventHandler`, `signal?`: `any`) => `void` | +| `resultSelector?` | (...`args`: `any`[]) => `T` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`T`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/generate.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/generate.md new file mode 100644 index 0000000000..c8e4c9e164 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/generate.md @@ -0,0 +1,390 @@ +[API](../../index.md) / [rxjs](../index.md) / generate + +# Function: generate() + +## Call Signature + +```ts +function generate<>( + initialState: S, + condition: ConditionFunc, + iterate: IterateFunc, + resultSelector: ResultFunc, + scheduler?: SchedulerLike +): Observable; +``` + +Defined in: [rxjs/src/internal/observable/generate.ts:93](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/generate.ts#L93) + +Generates an observable sequence by running a state-driven loop +producing the sequence's elements, using the specified scheduler +to send out observer messages. + +![](/images/marble-diagrams/generate.png) + +### Parameters + +| Parameter | Type | Description | +| ---------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `initialState` | `S` | Initial state. | +| `condition` | `ConditionFunc`\<`S`\> | Condition to terminate generation (upon returning false). | +| `iterate` | `IterateFunc`\<`S`\> | Iteration step function. | +| `resultSelector` | `ResultFunc`\<`S`, `T`\> | Selector function for results produced in the sequence. | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | A [SchedulerLike](../interfaces/SchedulerLike.md) on which to run the generator loop. If not provided, defaults to emit immediately. | + +### Returns + +[`Observable`](../classes/Observable.md)\<`T`\> + +The generated sequence. + +### Example + +Produces sequence of numbers + +```ts +import { generate } from 'rxjs'; + +const result = generate( + 0, + (x) => x < 3, + (x) => x + 1, + (x) => x +); + +result.subscribe((x) => console.log(x)); + +// Logs: +// 0 +// 1 +// 2 +``` + +Use `asapScheduler` + +```ts +import { generate, asapScheduler } from 'rxjs'; + +const result = generate( + 1, + (x) => x < 5, + (x) => x * 2, + (x) => x + 1, + asapScheduler +); + +result.subscribe((x) => console.log(x)); + +// Logs: +// 2 +// 3 +// 5 +``` + +### See + +- [from](from.md) +- [Observable](../classes/Observable.md) + +### Deprecated + +Instead of passing separate arguments, use the options argument. +Signatures taking separate arguments will be removed in v8. + +## Call Signature + +```ts +function generate<>(initialState: S, condition: ConditionFunc, iterate: IterateFunc, scheduler?: SchedulerLike): Observable; +``` + +Defined in: [rxjs/src/internal/observable/generate.ts:244](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/generate.ts#L244) + +Generates an Observable by running a state-driven loop +that emits an element on each iteration. + +Use it instead of nexting values in a for loop. + +![](/images/marble-diagrams/generate.png) + +`generate` allows you to create a stream of values generated with a loop very similar to +a traditional for loop. The first argument of `generate` is a beginning value. The second argument +is a function that accepts this value and tests if some condition still holds. If it does, +then the loop continues, if not, it stops. The third value is a function which takes the +previously defined value and modifies it in some way on each iteration. Note how these three parameters +are direct equivalents of three expressions in a traditional for loop: the first expression +initializes some state (for example, a numeric index), the second tests if the loop can perform the next +iteration (for example, if the index is lower than 10) and the third states how the defined value +will be modified on every step (for example, the index will be incremented by one). + +Return value of a `generate` operator is an Observable that on each loop iteration +emits a value. First of all, the condition function is ran. If it returns true, then the Observable +emits the currently stored value (initial value at the first iteration) and finally updates +that value with iterate function. If at some point the condition returns false, then the Observable +completes at that moment. + +Optionally you can pass a fourth parameter to `generate` - a result selector function which allows you +to immediately map the value that would normally be emitted by an Observable. + +If you find three anonymous functions in `generate` call hard to read, you can provide +a single object to the operator instead where the object has the properties: `initialState`, +`condition`, `iterate` and `resultSelector`, which should have respective values that you +would normally pass to `generate`. `resultSelector` is still optional, but that form +of calling `generate` allows you to omit `condition` as well. If you omit it, that means +condition always holds, or in other words the resulting Observable will never complete. + +Both forms of `generate` can optionally accept a scheduler. In case of a multi-parameter call, +scheduler simply comes as a last argument (no matter if there is a `resultSelector` +function or not). In case of a single-parameter call, you can provide it as a +`scheduler` property on the object passed to the operator. In both cases, a scheduler decides when +the next iteration of the loop will happen and therefore when the next value will be emitted +by the Observable. For example, to ensure that each value is pushed to the Observer +on a separate task in the event loop, you could use the `asyncScheduler` scheduler. Note that +by default (when no scheduler is passed) values are simply emitted synchronously. + +### Parameters + +| Parameter | Type | Description | +| -------------- | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `initialState` | `S` | Initial state. | +| `condition` | `ConditionFunc`\<`S`\> | Condition to terminate generation (upon returning false). | +| `iterate` | `IterateFunc`\<`S`\> | Iteration step function. | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | A [Scheduler](../classes/Scheduler.md) on which to run the generator loop. If not provided, defaults to emitting immediately. | + +### Returns + +[`Observable`](../classes/Observable.md)\<`S`\> + +The generated sequence. + +### Example + +Use with condition and iterate functions + +```ts +import { generate } from 'rxjs'; + +const result = generate( + 0, + (x) => x < 3, + (x) => x + 1 +); + +result.subscribe({ + next: (value) => console.log(value), + complete: () => console.log('Complete!'), +}); + +// Logs: +// 0 +// 1 +// 2 +// 'Complete!' +``` + +Use with condition, iterate and resultSelector functions + +```ts +import { generate } from 'rxjs'; + +const result = generate( + 0, + (x) => x < 3, + (x) => x + 1, + (x) => x * 1000 +); + +result.subscribe({ + next: (value) => console.log(value), + complete: () => console.log('Complete!'), +}); + +// Logs: +// 0 +// 1000 +// 2000 +// 'Complete!' +``` + +Use with options object + +```ts +import { generate } from 'rxjs'; + +const result = generate({ + initialState: 0, + condition(value) { + return value < 3; + }, + iterate(value) { + return value + 1; + }, + resultSelector(value) { + return value * 1000; + }, +}); + +result.subscribe({ + next: (value) => console.log(value), + complete: () => console.log('Complete!'), +}); + +// Logs: +// 0 +// 1000 +// 2000 +// 'Complete!' +``` + +Use options object without condition function + +```ts +import { generate } from 'rxjs'; + +const result = generate({ + initialState: 0, + iterate(value) { + return value + 1; + }, + resultSelector(value) { + return value * 1000; + }, +}); + +result.subscribe({ + next: (value) => console.log(value), + complete: () => console.log('Complete!'), // This will never run +}); + +// Logs: +// 0 +// 1000 +// 2000 +// 3000 +// ...and never stops. +``` + +### See + +[from](from.md) + +### Deprecated + +Instead of passing separate arguments, use the options argument. +Signatures taking separate arguments will be removed in v8. + +## Call Signature + +```ts +function generate<>(options: GenerateBaseOptions): Observable; +``` + +Defined in: [rxjs/src/internal/observable/generate.ts:291](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/generate.ts#L291) + +Generates an observable sequence by running a state-driven loop +producing the sequence's elements, using the specified scheduler +to send out observer messages. +The overload accepts options object that might contain initial state, iterate, +condition and scheduler. + +![](/images/marble-diagrams/generate.png) + +### Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------- | ----------------------------------------------------------------------------------------- | +| `options` | `GenerateBaseOptions`\<`S`\> | Object that must contain initialState, iterate and might contain condition and scheduler. | + +### Returns + +[`Observable`](../classes/Observable.md)\<`S`\> + +The generated sequence. + +### Example + +Use options object with condition function + +```ts +import { generate } from 'rxjs'; + +const result = generate({ + initialState: 0, + condition: (x) => x < 3, + iterate: (x) => x + 1, +}); + +result.subscribe({ + next: (value) => console.log(value), + complete: () => console.log('Complete!'), +}); + +// Logs: +// 0 +// 1 +// 2 +// 'Complete!' +``` + +### See + +- [from](from.md) +- [Observable](../classes/Observable.md) + +## Call Signature + +```ts +function generate<>(options: GenerateOptions): Observable; +``` + +Defined in: [rxjs/src/internal/observable/generate.ts:334](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/generate.ts#L334) + +Generates an observable sequence by running a state-driven loop +producing the sequence's elements, using the specified scheduler +to send out observer messages. +The overload accepts options object that might contain initial state, iterate, +condition, result selector and scheduler. + +![](/images/marble-diagrams/generate.png) + +### Parameters + +| Parameter | Type | Description | +| --------- | ----------------------------- | --------------------------------------------------------------------------------------------------------- | +| `options` | `GenerateOptions`\<`T`, `S`\> | Object that must contain initialState, iterate, resultSelector and might contain condition and scheduler. | + +### Returns + +[`Observable`](../classes/Observable.md)\<`T`\> + +The generated sequence. + +### Example + +Use options object with condition and iterate function + +```ts +import { generate } from 'rxjs'; + +const result = generate({ + initialState: 0, + condition: (x) => x < 3, + iterate: (x) => x + 1, + resultSelector: (x) => x, +}); + +result.subscribe({ + next: (value) => console.log(value), + complete: () => console.log('Complete!'), +}); + +// Logs: +// 0 +// 1 +// 2 +// 'Complete!' +``` + +### See + +- [from](from.md) +- [Observable](../classes/Observable.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/groupBy.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/groupBy.md new file mode 100644 index 0000000000..a809f5e56f --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/groupBy.md @@ -0,0 +1,239 @@ +[API](../../index.md) / [rxjs](../index.md) / groupBy + +# Function: groupBy() + +## Call Signature + +```ts +function groupBy<>(key: (value: T) => K, options: BasicGroupByOptions): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/groupBy.ts:17](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/groupBy.ts#L17) + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------------------- | +| `key` | (`value`: `T`) => `K` | +| `options` | [`BasicGroupByOptions`](../interfaces/BasicGroupByOptions.md)\<`K`, `T`\> | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`GroupedObservable`](../interfaces/GroupedObservable.md)\<`K`, `T`\>\> + +## Call Signature + +```ts +function groupBy<>(key: (value: T) => K, options: GroupByOptionsWithElement): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/groupBy.ts:19](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/groupBy.ts#L19) + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------------------------------------ | +| `key` | (`value`: `T`) => `K` | +| `options` | [`GroupByOptionsWithElement`](../interfaces/GroupByOptionsWithElement.md)\<`K`, `E`, `T`\> | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`GroupedObservable`](../interfaces/GroupedObservable.md)\<`K`, `E`\>\> + +## Call Signature + +```ts +function groupBy<>( + key: (value: T) => value is K +): OperatorFunction | GroupedObservable>>; +``` + +Defined in: [rxjs/src/internal/operators/groupBy.ts:24](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/groupBy.ts#L24) + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------ | +| `key` | (`value`: `T`) => `value is K` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, +\| [`GroupedObservable`](../interfaces/GroupedObservable.md)\<`true`, `K`\> +\| [`GroupedObservable`](../interfaces/GroupedObservable.md)\<`false`, `Exclude`\<`T`, `K`\>\>\> + +## Call Signature + +```ts +function groupBy<>(key: (value: T) => K): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/groupBy.ts:28](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/groupBy.ts#L28) + +### Parameters + +| Parameter | Type | +| --------- | --------------------- | +| `key` | (`value`: `T`) => `K` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`GroupedObservable`](../interfaces/GroupedObservable.md)\<`K`, `T`\>\> + +## Call Signature + +```ts +function groupBy<>( + key: (value: T) => K, + element: void, + duration: (grouped: GroupedObservable) => Observable +): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/groupBy.ts:33](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/groupBy.ts#L33) + +### Parameters + +| Parameter | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `key` | (`value`: `T`) => `K` | +| `element` | `void` | +| `duration` | (`grouped`: [`GroupedObservable`](../interfaces/GroupedObservable.md)\<`K`, `T`\>) => [`Observable`](../classes/Observable.md)\<`any`\> | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`GroupedObservable`](../interfaces/GroupedObservable.md)\<`K`, `T`\>\> + +### Deprecated + +use the options parameter instead. + +## Call Signature + +```ts +function groupBy<>( + key: (value: T) => K, + element?: (value: T) => R, + duration?: (grouped: GroupedObservable) => Observable +): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/groupBy.ts:42](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/groupBy.ts#L42) + +### Parameters + +| Parameter | Type | +| ----------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `key` | (`value`: `T`) => `K` | +| `element?` | (`value`: `T`) => `R` | +| `duration?` | (`grouped`: [`GroupedObservable`](../interfaces/GroupedObservable.md)\<`K`, `R`\>) => [`Observable`](../classes/Observable.md)\<`any`\> | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`GroupedObservable`](../interfaces/GroupedObservable.md)\<`K`, `R`\>\> + +### Deprecated + +use the options parameter instead. + +## Call Signature + +```ts +function groupBy<>( + key: (value: T) => K, + element?: (value: T) => R, + duration?: (grouped: GroupedObservable) => Observable, + connector?: () => Subject +): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/groupBy.ts:130](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/groupBy.ts#L130) + +Groups the items emitted by an Observable according to a specified criterion, +and emits these grouped items as `GroupedObservables`, one +[GroupedObservable](../interfaces/GroupedObservable.md) per group. + +![](/images/marble-diagrams/groupBy.png) + +When the Observable emits an item, a key is computed for this item with the key function. + +If a [GroupedObservable](../interfaces/GroupedObservable.md) for this key exists, this [GroupedObservable](../interfaces/GroupedObservable.md) emits. Otherwise, a new +[GroupedObservable](../interfaces/GroupedObservable.md) for this key is created and emits. + +A [GroupedObservable](../interfaces/GroupedObservable.md) represents values belonging to the same group represented by a common key. The common +key is available as the `key` field of a [GroupedObservable](../interfaces/GroupedObservable.md) instance. + +The elements emitted by [GroupedObservable](../interfaces/GroupedObservable.md)s are by default the items emitted by the Observable, or elements +returned by the element function. + +### Parameters + +| Parameter | Type | Description | +| ------------ | --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `key` | (`value`: `T`) => `K` | A function that extracts the key for each item. | +| `element?` | (`value`: `T`) => `R` | A function that extracts the return element for each item. | +| `duration?` | (`grouped`: [`GroupedObservable`](../interfaces/GroupedObservable.md)\<`K`, `R`\>) => [`Observable`](../classes/Observable.md)\<`any`\> | A function that returns an Observable to determine how long each group should exist. | +| `connector?` | () => [`Subject`](../classes/Subject.md)\<`R`\> | Factory function to create an intermediate Subject through which grouped elements are emitted. | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`GroupedObservable`](../interfaces/GroupedObservable.md)\<`K`, `R`\>\> + +A function that returns an Observable that emits GroupedObservables, +each of which corresponds to a unique key value and each of which emits +those items from the source Observable that share that key value. + +### Example + +Group objects by `id` and return as array + +```ts +import { of, groupBy, mergeMap, reduce } from 'rxjs'; + +of( + { id: 1, name: 'JavaScript' }, + { id: 2, name: 'Parcel' }, + { id: 2, name: 'webpack' }, + { id: 1, name: 'TypeScript' }, + { id: 3, name: 'TSLint' } +) + .pipe( + groupBy((p) => p.id), + mergeMap((group$) => group$.pipe(reduce((acc, cur) => [...acc, cur], []))) + ) + .subscribe((p) => console.log(p)); + +// displays: +// [{ id: 1, name: 'JavaScript' }, { id: 1, name: 'TypeScript'}] +// [{ id: 2, name: 'Parcel' }, { id: 2, name: 'webpack'}] +// [{ id: 3, name: 'TSLint' }] +``` + +Pivot data on the `id` field + +```ts +import { of, groupBy, mergeMap, reduce, map } from 'rxjs'; + +of( + { id: 1, name: 'JavaScript' }, + { id: 2, name: 'Parcel' }, + { id: 2, name: 'webpack' }, + { id: 1, name: 'TypeScript' }, + { id: 3, name: 'TSLint' } +) + .pipe( + groupBy((p) => p.id, { element: (p) => p.name }), + mergeMap((group$) => group$.pipe(reduce((acc, cur) => [...acc, cur], [`${group$.key}`]))), + map((arr) => ({ id: parseInt(arr[0], 10), values: arr.slice(1) })) + ) + .subscribe((p) => console.log(p)); + +// displays: +// { id: 1, values: [ 'JavaScript', 'TypeScript' ] } +// { id: 2, values: [ 'Parcel', 'webpack' ] } +// { id: 3, values: [ 'TSLint' ] } +``` + +### Deprecated + +Use the options parameter instead. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/identity.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/identity.md new file mode 100644 index 0000000000..0f3a325b40 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/identity.md @@ -0,0 +1,59 @@ +[API](../../index.md) / [rxjs](../index.md) / identity + +# Function: identity() + +```ts +function identity<>(x: T): T; +``` + +Defined in: [rxjs/src/internal/util/identity.ts:43](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/identity.ts#L43) + +This function takes one parameter and just returns it. Simply put, +this is like `(x: T): T => x`. + +## Parameters + +| Parameter | Type | Description | +| --------- | ---- | ------------------------------------------- | +| `x` | `T` | Any value that is returned by this function | + +## Returns + +`T` + +The value passed as the first parameter to this function + +## Example + +This is useful in some cases when using things like `mergeMap` + +```ts +import { interval, take, map, range, mergeMap, identity } from 'rxjs'; + +const source$ = interval(1000).pipe(take(5)); + +const result$ = source$.pipe( + map((i) => range(i)), + mergeMap(identity) // same as mergeMap(x => x) +); + +result$.subscribe({ + next: console.log, +}); +``` + +Or when you want to selectively apply an operator + +```ts +import { interval, take, identity } from 'rxjs'; + +const shouldLimit = () => Math.random() < 0.5; + +const source$ = interval(1000); + +const result$ = source$.pipe(shouldLimit() ? take(5) : identity); + +result$.subscribe({ + next: console.log, +}); +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/ignoreElements.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/ignoreElements.md new file mode 100644 index 0000000000..e656d4322e --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/ignoreElements.md @@ -0,0 +1,47 @@ +[API](../../index.md) / [rxjs](../index.md) / ignoreElements + +# Function: ignoreElements() + +```ts +function ignoreElements(): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/ignoreElements.ts:40](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/ignoreElements.ts#L40) + +Ignores all items emitted by the source Observable and only passes calls of `complete` or `error`. + +![](/images/marble-diagrams/ignoreElements.png) + +The `ignoreElements` operator suppresses all items emitted by the source Observable, +but allows its termination notification (either `error` or `complete`) to pass through unchanged. + +If you do not care about the items being emitted by an Observable, but you do want to be notified +when it completes or when it terminates with an error, you can apply the `ignoreElements` operator +to the Observable, which will ensure that it will never call its observers’ `next` handlers. + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`unknown`, `never`\> + +A function that returns an empty Observable that only calls +`complete` or `error`, based on which one is called by the source +Observable. + +## Example + +Ignore all `next` emissions from the source + +```ts +import { of, ignoreElements } from 'rxjs'; + +of('you', 'talking', 'to', 'me') + .pipe(ignoreElements()) + .subscribe({ + next: (word) => console.log(word), + error: (err) => console.log('error:', err), + complete: () => console.log('the end'), + }); + +// result: +// 'the end' +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/iif.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/iif.md new file mode 100644 index 0000000000..ecb3007b70 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/iif.md @@ -0,0 +1,89 @@ +[API](../../index.md) / [rxjs](../index.md) / iif + +# Function: iif() + +```ts +function iif<>(condition: () => boolean, trueResult: ObservableInput, falseResult: ObservableInput): Observable; +``` + +Defined in: [rxjs/src/internal/observable/iif.ts:83](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/iif.ts#L83) + +Checks a boolean at subscription time, and chooses between one of two observable sources + +`iif` expects a function that returns a boolean (the `condition` function), and two sources, +the `trueResult` and the `falseResult`, and returns an Observable. + +At the moment of subscription, the `condition` function is called. If the result is `true`, the +subscription will be to the source passed as the `trueResult`, otherwise, the subscription will be +to the source passed as the `falseResult`. + +If you need to check more than two options to choose between more than one observable, have a look at the [defer](defer.md) creation method. + +## Parameters + +| Parameter | Type | Description | +| ------------- | -------------------------------------------------------------- | ------------------------------------------------------------ | +| `condition` | () => `boolean` | Condition which Observable should be chosen. | +| `trueResult` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`T`\> | An Observable that will be subscribed if condition is true. | +| `falseResult` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`F`\> | An Observable that will be subscribed if condition is false. | + +## Returns + +[`Observable`](../classes/Observable.md)\<`T` \| `F`\> + +An observable that proxies to `trueResult` or `falseResult`, depending on the result of the `condition` function. + +## Example + +Change at runtime which Observable will be subscribed + +```ts +import { iif, of } from 'rxjs'; + +let subscribeToFirst; +const firstOrSecond = iif(() => subscribeToFirst, of('first'), of('second')); + +subscribeToFirst = true; +firstOrSecond.subscribe((value) => console.log(value)); + +// Logs: +// 'first' + +subscribeToFirst = false; +firstOrSecond.subscribe((value) => console.log(value)); + +// Logs: +// 'second' +``` + +Control access to an Observable + +```ts +import { iif, of, EMPTY } from 'rxjs'; + +let accessGranted; +const observableIfYouHaveAccess = iif(() => accessGranted, of('It seems you have an access...'), EMPTY); + +accessGranted = true; +observableIfYouHaveAccess.subscribe({ + next: (value) => console.log(value), + complete: () => console.log('The end'), +}); + +// Logs: +// 'It seems you have an access...' +// 'The end' + +accessGranted = false; +observableIfYouHaveAccess.subscribe({ + next: (value) => console.log(value), + complete: () => console.log('The end'), +}); + +// Logs: +// 'The end' +``` + +## See + +[defer](defer.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/interval.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/interval.md new file mode 100644 index 0000000000..5208049e6a --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/interval.md @@ -0,0 +1,61 @@ +[API](../../index.md) / [rxjs](../index.md) / interval + +# Function: interval() + +```ts +function interval(period: number, scheduler: SchedulerLike): Observable; +``` + +Defined in: [rxjs/src/internal/observable/interval.ts:50](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/interval.ts#L50) + +Creates an Observable that emits sequential numbers every specified +interval of time, on a specified [SchedulerLike](../interfaces/SchedulerLike.md). + +Emits incremental numbers periodically in time. + +![](/images/marble-diagrams/interval.png) + +`interval` returns an Observable that emits an infinite sequence of +ascending integers, with a constant interval of time of your choosing +between those emissions. The first emission is not sent immediately, but +only after the first period has passed. By default, this operator uses the +`asyncScheduler` [SchedulerLike](../interfaces/SchedulerLike.md) to provide a notion of time, but you may pass any +[SchedulerLike](../interfaces/SchedulerLike.md) to it. + +## Parameters + +| Parameter | Type | Default value | Description | +| ----------- | ------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +| `period` | `number` | `0` | The interval size in milliseconds (by default) or the time unit determined by the scheduler's clock. | +| `scheduler` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | `asyncScheduler` | The [SchedulerLike](../interfaces/SchedulerLike.md) to use for scheduling the emission of values, and providing a notion of "time". | + +## Returns + +[`Observable`](../classes/Observable.md)\<`number`\> + +An Observable that emits a sequential number each time interval. + +## Example + +Emits ascending numbers, one every second (1000ms) up to the number 3 + +```ts +import { interval, take } from 'rxjs'; + +const numbers = interval(1000); + +const takeFourNumbers = numbers.pipe(take(4)); + +takeFourNumbers.subscribe((x) => console.log('Next: ', x)); + +// Logs: +// Next: 0 +// Next: 1 +// Next: 2 +// Next: 3 +``` + +## See + +- [timer](timer.md) +- [delay](delay.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/isEmpty.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/isEmpty.md new file mode 100644 index 0000000000..a40c14d60b --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/isEmpty.md @@ -0,0 +1,75 @@ +[API](../../index.md) / [rxjs](../index.md) / isEmpty + +# Function: isEmpty() + +```ts +function isEmpty<>(): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/isEmpty.ts:65](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/isEmpty.ts#L65) + +Emits `false` if the input Observable emits any values, or emits `true` if the +input Observable completes without emitting any values. + +Tells whether any values are emitted by an Observable. + +![](/images/marble-diagrams/isEmpty.png) + +`isEmpty` transforms an Observable that emits values into an Observable that +emits a single boolean value representing whether or not any values were +emitted by the source Observable. As soon as the source Observable emits a +value, `isEmpty` will emit a `false` and complete. If the source Observable +completes having not emitted anything, `isEmpty` will emit a `true` and +complete. + +A similar effect could be achieved with [count](count.md), but `isEmpty` can emit +a `false` value sooner. + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `boolean`\> + +A function that returns an Observable that emits boolean value +indicating whether the source Observable was empty or not. + +## Example + +Emit `false` for a non-empty Observable + +```ts +import { Subject, isEmpty } from 'rxjs'; + +const source = new Subject(); +const result = source.pipe(isEmpty()); + +source.subscribe((x) => console.log(x)); +result.subscribe((x) => console.log(x)); + +source.next('a'); +source.next('b'); +source.next('c'); +source.complete(); + +// Outputs +// 'a' +// false +// 'b' +// 'c' +``` + +Emit `true` for an empty Observable + +```ts +import { EMPTY, isEmpty } from 'rxjs'; + +const result = EMPTY.pipe(isEmpty()); +result.subscribe((x) => console.log(x)); + +// Outputs +// true +``` + +## See + +- [count](count.md) +- [EMPTY](../variables/EMPTY.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/isObservable.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/isObservable.md new file mode 100644 index 0000000000..008c44ecaa --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/isObservable.md @@ -0,0 +1,21 @@ +[API](../../index.md) / [rxjs](../index.md) / isObservable + +# Function: isObservable() + +```ts +function isObservable(obj: any): obj is Observable; +``` + +Defined in: [observable/src/observable.ts:1328](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L1328) + +Tests to see if the object is an RxJS [Observable](../classes/Observable.md) + +## Parameters + +| Parameter | Type | Description | +| --------- | ----- | ------------------ | +| `obj` | `any` | the object to test | + +## Returns + +`obj is Observable` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/last.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/last.md new file mode 100644 index 0000000000..6d2e34dc56 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/last.md @@ -0,0 +1,173 @@ +[API](../../index.md) / [rxjs](../index.md) / last + +# Function: last() + +> Returns an Observable that emits only the last item emitted by the source Observable. +> It optionally takes a predicate function as a parameter, in which case, rather than emitting +> the last item from the source Observable, the resulting Observable will emit the last item +> from the source Observable that satisfies the predicate. + +## Description + +![](/images/marble-diagrams/last.png) + +It will emit an error notification if the source completes without notification or one that matches +the predicate. It returns the last value or if a predicate is provided last value that matches the +predicate. It returns the given default value if no notification is emitted or matches the predicate. + +## Example + +Last alphabet from the sequence + +```ts +import { from, last } from 'rxjs'; + +const source = from(['x', 'y', 'z']); +const result = source.pipe(last()); + +result.subscribe((value) => console.log(`Last alphabet: ${value}`)); + +// Outputs +// Last alphabet: z +``` + +Default value when the value in the predicate is not matched + +```ts +import { from, last } from 'rxjs'; + +const source = from(['x', 'y', 'z']); +const result = source.pipe(last((char) => char === 'a', 'not found')); + +result.subscribe((value) => console.log(`'a' is ${value}.`)); + +// Outputs +// 'a' is not found. +``` + +## See + +- [skip](skip.md) +- [skipUntil](skipUntil.md) +- [skipLast](skipLast.md) +- [skipWhile](skipWhile.md) +- [first](first.md) + +## Throws + +Delivers an `EmptyError` to the Observer's `error` +callback if the Observable completes before any `next` notification was sent. + +isn't met or no values were emitted. + +## Parameters + +### `predicate` + +The condition any source emitted item has to satisfy. + +### `defaultValue` + +An optional default value to provide if last `predicate` + +## Returns + +`A function that returns an Observable that emits only the last item +satisfying the given condition from the source, or an error notification +with an` + +object if no such items are emitted. + +## Call Signature + +```ts +function last<>(predicate: BooleanConstructor): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/last.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/last.ts#L5) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------- | +| `predicate` | `BooleanConstructor` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`TruthyTypesOf`](../type-aliases/TruthyTypesOf.md)\<`T`\>\> + +## Call Signature + +```ts +function last<>(predicate: BooleanConstructor, defaultValue: D): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/last.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/last.ts#L6) + +### Parameters + +| Parameter | Type | +| -------------- | -------------------- | +| `predicate` | `BooleanConstructor` | +| `defaultValue` | `D` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `D` \| [`TruthyTypesOf`](../type-aliases/TruthyTypesOf.md)\<`T`\>\> + +## Call Signature + +```ts +function last<>(predicate?: null, defaultValue?: D): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/last.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/last.ts#L7) + +### Parameters + +| Parameter | Type | +| --------------- | ------ | +| `predicate?` | `null` | +| `defaultValue?` | `D` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `D`\> + +## Call Signature + +```ts +function last<>(predicate: (value: T, index: number, source: Observable) => value is S, defaultValue?: S): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/last.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/last.ts#L8) + +### Parameters + +| Parameter | Type | +| --------------- | ------------------------------------------------------------------------------------------------------------ | +| `predicate` | (`value`: `T`, `index`: `number`, `source`: [`Observable`](../classes/Observable.md)\<`T`\>) => `value is S` | +| `defaultValue?` | `S` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `S`\> + +## Call Signature + +```ts +function last<>(predicate: (value: T, index: number, source: Observable) => boolean, defaultValue?: D): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/last.ts:12](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/last.ts#L12) + +### Parameters + +| Parameter | Type | +| --------------- | --------------------------------------------------------------------------------------------------------- | +| `predicate` | (`value`: `T`, `index`: `number`, `source`: [`Observable`](../classes/Observable.md)\<`T`\>) => `boolean` | +| `defaultValue?` | `D` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `D`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/lastValueFrom.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/lastValueFrom.md new file mode 100644 index 0000000000..9c50a21581 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/lastValueFrom.md @@ -0,0 +1,93 @@ +[API](../../index.md) / [rxjs](../index.md) / lastValueFrom + +# Function: lastValueFrom() + +> Converts an observable to a promise by subscribing to the observable, +> waiting for it to complete, and resolving the returned promise with the +> last value from the observed stream. + +## Description + +If the observable stream completes before any values were emitted, the +returned promise will reject with [EmptyError](../classes/EmptyError.md) or will resolve +with the default value if a default was specified. + +If the observable stream emits an error, the returned promise will reject +with that error. + +**WARNING**: Only use this with observables you _know_ will complete. If the source +observable does not complete, you will end up with a promise that is hung up, and +potentially all of the state of an async function hanging out in memory. To avoid +this situation, look into adding something like [timeout](timeout.md), [take](take.md), +[takeWhile](takeWhile.md), or [takeUntil](takeUntil.md) amongst others. + +## Example + +Wait for the last value from a stream and emit it from a promise in +an async function + +```ts +import { interval, take, lastValueFrom } from 'rxjs'; + +async function execute() { + const source$ = interval(2000).pipe(take(10)); + const finalNumber = await lastValueFrom(source$); + console.log(`The final number is ${finalNumber}`); +} + +execute(); + +// Expected output: +// 'The final number is 9' +``` + +## See + +[firstValueFrom](firstValueFrom.md) + +## Parameters + +### `source` + +the observable to convert to a promise + +### `config` + +a configuration object to define the `defaultValue` to use if the source completes without emitting a value + +## Call Signature + +```ts +function lastValueFrom<>(source: Observable, config: LastValueFromConfig): Promise; +``` + +Defined in: [rxjs/src/internal/lastValueFrom.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/lastValueFrom.ts#L8) + +### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------- | +| `source` | [`Observable`](../classes/Observable.md)\<`T`\> | +| `config` | `LastValueFromConfig`\<`D`\> | + +### Returns + +`Promise`\<`T` \| `D`\> + +## Call Signature + +```ts +function lastValueFrom<>(source: Observable): Promise; +``` + +Defined in: [rxjs/src/internal/lastValueFrom.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/lastValueFrom.ts#L9) + +### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------- | +| `source` | [`Observable`](../classes/Observable.md)\<`T`\> | + +### Returns + +`Promise`\<`T`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/map.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/map.md new file mode 100644 index 0000000000..329f436737 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/map.md @@ -0,0 +1,52 @@ +[API](../../index.md) / [rxjs](../index.md) / map + +# Function: map() + +```ts +function map<>(project: (value: T, index: number) => R): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/map.ts:39](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/map.ts#L39) + +Applies a given `project` function to each value emitted by the source +Observable, and emits the resulting values as an Observable. + +Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map), +it passes each source value through a transformation function to get +corresponding output values. + +![](/images/marble-diagrams/map.png) + +Similar to the well known `Array.prototype.map` function, this operator +applies a projection to each value and emits that projection in the output +Observable. + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `project` | (`value`: `T`, `index`: `number`) => `R` | The function to apply to each `value` emitted by the source Observable. The `index` parameter is the number `i` for the i-th emission that has happened since the subscription, starting from the number `0`. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `R`\> + +A function that returns an Observable that emits the values from the +source Observable transformed by the given `project` function. + +## Example + +Map every click to the `clientX` position of that click + +```ts +import { fromEvent, map } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const positions = clicks.pipe(map((ev) => ev.clientX)); + +positions.subscribe((x) => console.log(x)); +``` + +## See + +[mapTo](mapTo.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/mapTo.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/mapTo.md new file mode 100644 index 0000000000..c253ac32e7 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/mapTo.md @@ -0,0 +1,98 @@ +[API](../../index.md) / [rxjs](../index.md) / mapTo + +# ~~Function: mapTo()~~ + +> Emits the given constant value on the output Observable every time the source +> Observable emits a value. + +## Description + +Like [map](map.md), but it maps every source value to +the same output value every time. + +![](/images/marble-diagrams/mapTo.png) + +Takes a constant `value` as argument, and emits that whenever the source +Observable emits a value. In other words, ignores the actual source value, +and simply uses the emission moment to know when to emit the given `value`. + +**deprecated**: To be removed in v9. Use [map](map.md) instead: `map(() => value)`. + +## Example + +Map every click to the string `'Hi'` + +```ts +import { fromEvent, mapTo } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const greetings = clicks.pipe(mapTo('Hi')); + +greetings.subscribe((x) => console.log(x)); +``` + +## See + +[map](map.md) + +## Deprecated + +To be removed in v9. Use [map](map.md) instead: `map(() => value)`. + +## Parameters + +### `value` + +The value to map each source value to. + +## Returns + +`A function that returns an Observable that emits the given` + +every time the source Observable emits. + +## Call Signature + +```ts +function mapTo<>(value: R): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/mapTo.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/mapTo.ts#L5) + +### Parameters + +| Parameter | Type | +| --------- | ---- | +| `value` | `R` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`unknown`, `R`\> + +### Deprecated + +To be removed in v9. Use [map](map.md) instead: `map(() => value)`. + +## Call Signature + +```ts +function mapTo<>(value: R): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/mapTo.ts:11](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/mapTo.ts#L11) + +### Parameters + +| Parameter | Type | +| --------- | ---- | +| `value` | `R` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `R`\> + +### Deprecated + +Do not specify explicit type parameters. Signatures with type parameters +that cannot be inferred will be removed in v8. `mapTo` itself will be removed in v9, +use [map](map.md) instead: `map(() => value)`. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/materialize.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/materialize.md new file mode 100644 index 0000000000..2d43905287 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/materialize.md @@ -0,0 +1,62 @@ +[API](../../index.md) / [rxjs](../index.md) / materialize + +# Function: materialize() + +```ts +function materialize<>(): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/materialize.ts:52](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/materialize.ts#L52) + +Represents all of the notifications from the source Observable as `next` +emissions marked with their original types within [ObservableNotification](../type-aliases/ObservableNotification.md) +objects. + +Wraps `next`, `error` and `complete` emissions in +[ObservableNotification](../type-aliases/ObservableNotification.md) objects, emitted as `next` on the output Observable. + + +![](/images/marble-diagrams/materialize.png) + +`materialize` returns an Observable that emits a `next` notification for each +`next`, `error`, or `complete` emission of the source Observable. When the +source Observable emits `complete`, the output Observable will emit `next` as +a Notification of type "complete", and then it will emit `complete` as well. +When the source Observable emits `error`, the output will emit `next` as a +Notification of type "error", and then `complete`. + +This operator is useful for producing metadata of the source Observable, to +be consumed as `next` emissions. Use it in conjunction with +[dematerialize](dematerialize.md). + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`ObservableNotification`](../type-aliases/ObservableNotification.md)\<`T`\>\> + +A function that returns an Observable that emits +[ObservableNotification](../type-aliases/ObservableNotification.md) objects that wrap the original emissions from the +source Observable with metadata. + +## Example + +Convert a faulty Observable to an Observable of Notifications + +```ts +import { of, materialize, map } from 'rxjs'; + +const letters = of('a', 'b', 13, 'd'); +const upperCase = letters.pipe(map((x: any) => x.toUpperCase())); +const materialized = upperCase.pipe(materialize()); + +materialized.subscribe((x) => console.log(x)); + +// Results in the following: +// - Notification { kind: 'N', value: 'A', error: undefined, hasValue: true } +// - Notification { kind: 'N', value: 'B', error: undefined, hasValue: true } +// - Notification { kind: 'E', value: undefined, error: TypeError { message: x.toUpperCase is not a function }, hasValue: false } +``` + +## See + +- [ObservableNotification](../type-aliases/ObservableNotification.md) +- [dematerialize](dematerialize.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/max.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/max.md new file mode 100644 index 0000000000..609d2eda8c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/max.md @@ -0,0 +1,60 @@ +[API](../../index.md) / [rxjs](../index.md) / max + +# Function: max() + +```ts +function max<>(comparer?: (x: T, y: T) => number): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/max.ts:52](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/max.ts#L52) + +The `max` operator operates on an Observable that emits numbers (or items that +can be compared with a provided function), and when source Observable completes +it emits a single item: the item with the largest value. + +![](/images/marble-diagrams/max.png) + +## Parameters + +| Parameter | Type | Description | +| ----------- | -------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `comparer?` | (`x`: `T`, `y`: `T`) => `number` | Optional comparer function that it will use instead of its default to compare the value of two items. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that emits item with the +largest value. + +## Example + +Get the maximal value of a series of numbers + +```ts +import { of, max } from 'rxjs'; + +of(5, 4, 7, 2, 8) + .pipe(max()) + .subscribe((x) => console.log(x)); + +// Outputs +// 8 +``` + +Use a comparer function to get the maximal item + +```ts +import { of, max } from 'rxjs'; + +of({ age: 7, name: 'Foo' }, { age: 5, name: 'Bar' }, { age: 9, name: 'Beer' }) + .pipe(max((a, b) => (a.age < b.age ? -1 : 1))) + .subscribe((x) => console.log(x.name)); + +// Outputs +// 'Beer' +``` + +## See + +[min](min.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/merge.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/merge.md new file mode 100644 index 0000000000..012c74b95a --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/merge.md @@ -0,0 +1,163 @@ +[API](../../index.md) / [rxjs](../index.md) / merge + +# Function: merge() + +> Creates an output Observable which concurrently emits all values from every +> given input Observable. + +## Description + +Flattens multiple Observables together by blending +their values into one Observable. + +![](/images/marble-diagrams/merge.png) + +`merge` subscribes to each given input Observable (as arguments), and simply +forwards (without doing any transformation) all the values from all the input +Observables to the output Observable. The output Observable only completes +once all input Observables have completed. Any error delivered by an input +Observable will be immediately emitted on the output Observable. + +## Example + +Merge together two Observables: 1s interval and clicks + +```ts +import { merge, fromEvent, interval } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const timer = interval(1000); +const clicksOrTimer = merge(clicks, timer); +clicksOrTimer.subscribe((x) => console.log(x)); + +// Results in the following: +// timer will emit ascending values, one every second(1000ms) to console +// clicks logs MouseEvents to console every time the "document" is clicked +// Since the two streams are merged you see these happening +// as they occur. +``` + +Merge together 3 Observables, but run only 2 concurrently + +```ts +import { interval, take, merge } from 'rxjs'; + +const timer1 = interval(1000).pipe(take(10)); +const timer2 = interval(2000).pipe(take(6)); +const timer3 = interval(500).pipe(take(10)); + +const concurrent = 2; // the argument +const merged = merge(timer1, timer2, timer3, concurrent); +merged.subscribe((x) => console.log(x)); + +// Results in the following: +// - First timer1 and timer2 will run concurrently +// - timer1 will emit a value every 1000ms for 10 iterations +// - timer2 will emit a value every 2000ms for 6 iterations +// - after timer1 hits its max iteration, timer2 will +// continue, and timer3 will start to run concurrently with timer2 +// - when timer2 hits its max iteration it terminates, and +// timer3 will continue to emit a value every 500ms until it is complete +``` + +## See + +- [mergeAll](mergeAll.md) +- [mergeMap](mergeMap.md) +- [mergeMapTo](mergeMapTo.md) +- [mergeScan](mergeScan.md) + +is of type number, `merge` will use it to limit number of concurrently +subscribed `ObservableInput`s. + +## Parameters + +### `args` + +`ObservableInput`s to merge together. If the last parameter + +## Returns + +`An` + +Observable that emits items that are the result of every input Observable. + +## Call Signature + +```ts +function merge<>(...sources: [...ObservableInputTuple[]]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/merge.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/merge.ts#L9) + +### Parameters + +| Parameter | Type | +| ------------ | ---------------------------------- | +| ...`sources` | \[`...ObservableInputTuple[]`\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`A`\[`number`\]\> + +## Call Signature + +```ts +function merge<>(...sourcesAndConcurrency: [...ObservableInputTuple[], number?]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/merge.ts:10](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/merge.ts#L10) + +### Parameters + +| Parameter | Type | +| -------------------------- | --------------------------------------------- | +| ...`sourcesAndConcurrency` | \[`...ObservableInputTuple[]`, `number`?\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`A`\[`number`\]\> + +## Call Signature + +```ts +function merge<>(...sourcesAndScheduler: [...ObservableInputTuple[], SchedulerLike?]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/merge.ts:12](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/merge.ts#L12) + +### Parameters + +| Parameter | Type | +| ------------------------ | -------------------------------------------------------------------------------------- | +| ...`sourcesAndScheduler` | \[`...ObservableInputTuple[]`, [`SchedulerLike`](../interfaces/SchedulerLike.md)?\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`A`\[`number`\]\> + +### Deprecated + +The `scheduler` parameter will be removed in v8. Use `scheduled` and `mergeAll`. Details: https://rxjs.dev/deprecations/scheduler-argument + +## Call Signature + +```ts +function merge<>(...sourcesAndConcurrencyAndScheduler: [...ObservableInputTuple[], number?, SchedulerLike?]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/merge.ts:16](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/merge.ts#L16) + +### Parameters + +| Parameter | Type | +| -------------------------------------- | ------------------------------------------------------------------------------------------------- | +| ...`sourcesAndConcurrencyAndScheduler` | \[`...ObservableInputTuple[]`, `number`?, [`SchedulerLike`](../interfaces/SchedulerLike.md)?\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`A`\[`number`\]\> + +### Deprecated + +The `scheduler` parameter will be removed in v8. Use `scheduled` and `mergeAll`. Details: https://rxjs.dev/deprecations/scheduler-argument diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeAll.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeAll.md new file mode 100644 index 0000000000..364e6e0d3c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeAll.md @@ -0,0 +1,75 @@ +[API](../../index.md) / [rxjs](../index.md) / mergeAll + +# Function: mergeAll() + +```ts +function mergeAll<>(concurrent: number): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/mergeAll.ts:64](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/mergeAll.ts#L64) + +Converts a higher-order Observable into a first-order Observable which +concurrently delivers all values that are emitted on the inner Observables. + +Flattens an Observable-of-Observables. + +![](/images/marble-diagrams/mergeAll.png) + +`mergeAll` subscribes to an Observable that emits Observables, also known as +a higher-order Observable. Each time it observes one of these emitted inner +Observables, it subscribes to that and delivers all the values from the +inner Observable on the output Observable. The output Observable only +completes once all inner Observables have completed. Any error delivered by +a inner Observable will be immediately emitted on the output Observable. + +## Parameters + +| Parameter | Type | Default value | Description | +| ------------ | -------- | ------------- | --------------------------------------------------------------------- | +| `concurrent` | `number` | `Infinity` | Maximum number of inner Observables being subscribed to concurrently. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`O`, [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +A function that returns an Observable that emits values coming from +all the inner Observables emitted by the source Observable. + +## Example + +Spawn a new interval Observable for each click event, and blend their outputs as one Observable + +```ts +import { fromEvent, map, interval, mergeAll } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const higherOrder = clicks.pipe(map(() => interval(1000))); +const firstOrder = higherOrder.pipe(mergeAll()); + +firstOrder.subscribe((x) => console.log(x)); +``` + +Count from 0 to 9 every second for each click, but only allow 2 concurrent timers + +```ts +import { fromEvent, map, interval, take, mergeAll } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const higherOrder = clicks.pipe(map(() => interval(1000).pipe(take(10)))); +const firstOrder = higherOrder.pipe(mergeAll(2)); + +firstOrder.subscribe((x) => console.log(x)); +``` + +## See + +- [combineLatestAll](combineLatestAll.md) +- [concatAll](concatAll.md) +- [exhaustAll](exhaustAll.md) +- [merge](merge.md) +- [mergeMap](mergeMap.md) +- [mergeMapTo](mergeMapTo.md) +- [mergeScan](mergeScan.md) +- [switchAll](switchAll.md) +- [switchMap](switchMap.md) +- [zipAll](zipAll.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeMap.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeMap.md new file mode 100644 index 0000000000..8cfe431c15 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeMap.md @@ -0,0 +1,69 @@ +[API](../../index.md) / [rxjs](../index.md) / mergeMap + +# Function: mergeMap() + +```ts +function mergeMap<>(project: (value: T, index: number) => O, concurrent: number): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/mergeMap.ts:58](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/mergeMap.ts#L58) + +Projects each source value to an Observable which is merged in the output +Observable. + +Maps each value to an Observable, then flattens all of +these inner Observables using [mergeAll](mergeAll.md). + +![](/images/marble-diagrams/mergeMap.png) + +Returns an Observable that emits items based on applying a function that you +supply to each item emitted by the source Observable, where that function +returns an Observable, and then merging those resulting Observables and +emitting the results of this merger. + +## Parameters + +| Parameter | Type | Default value | Description | +| ------------ | ---------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------- | +| `project` | (`value`: `T`, `index`: `number`) => `O` | `undefined` | A function that, when applied to an item emitted by the source Observable, returns an Observable. | +| `concurrent` | `number` | `Infinity` | Maximum number of `ObservableInput`s being subscribed to concurrently. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +A function that returns an Observable that emits the result of +applying the projection function to each item emitted by the source Observable +and merging the results of the Observables obtained from this transformation. + +## Example + +Map and flatten each letter to an Observable ticking every 1 second + +```ts +import { of, mergeMap, interval, map } from 'rxjs'; + +const letters = of('a', 'b', 'c'); +const result = letters.pipe(mergeMap((x) => interval(1000).pipe(map((i) => x + i)))); + +result.subscribe((x) => console.log(x)); + +// Results in the following: +// a0 +// b0 +// c0 +// a1 +// b1 +// c1 +// continues to list a, b, c every second with respective ascending integers +``` + +## See + +- [concatMap](concatMap.md) +- [exhaustMap](exhaustMap.md) +- [merge](merge.md) +- [mergeAll](mergeAll.md) +- [mergeMapTo](mergeMapTo.md) +- [mergeScan](mergeScan.md) +- [switchMap](switchMap.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeMapTo.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeMapTo.md new file mode 100644 index 0000000000..dd4418deef --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeMapTo.md @@ -0,0 +1,61 @@ +[API](../../index.md) / [rxjs](../index.md) / mergeMapTo + +# ~~Function: mergeMapTo()~~ + +```ts +function mergeMapTo<>(innerObservable: O, concurrent?: number): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/mergeMapTo.ts:45](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/mergeMapTo.ts#L45) + +Projects each source value to the same Observable which is merged multiple +times in the output Observable. + +It's like [mergeMap](mergeMap.md), but maps each value always +to the same inner Observable. + +![](/images/marble-diagrams/mergeMapTo.png) + +Maps each source value to the given Observable `innerObservable` regardless +of the source value, and then merges those resulting Observables into one +single Observable, which is the output Observable. + +## Parameters + +| Parameter | Type | Description | +| ----------------- | -------- | ---------------------------------------------------------------------- | +| `innerObservable` | `O` | An `ObservableInput` to replace each value from the source Observable. | +| `concurrent?` | `number` | Maximum number of input Observables being subscribed to concurrently. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`unknown`, [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +A function that returns an Observable that emits items from the +given `innerObservable`. + +## Example + +For each click event, start an interval Observable ticking every 1 second + +```ts +import { fromEvent, mergeMapTo, interval } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(mergeMapTo(interval(1000))); + +result.subscribe((x) => console.log(x)); +``` + +## See + +- [concatMapTo](concatMapTo.md) +- [merge](merge.md) +- [mergeAll](mergeAll.md) +- [mergeMap](mergeMap.md) +- [mergeScan](mergeScan.md) +- [switchMapTo](switchMapTo.md) + +## Deprecated + +Will be removed in v9. Use [mergeMap](mergeMap.md) instead: `mergeMap(() => result)` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeScan.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeScan.md new file mode 100644 index 0000000000..78aa668f2c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeScan.md @@ -0,0 +1,85 @@ +[API](../../index.md) / [rxjs](../index.md) / mergeScan + +# Function: mergeScan() + +```ts +function mergeScan<>( + accumulator: (acc: R, value: T, index: number) => ObservableInput, + seed: R, + concurrent: number +): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/mergeScan.ts:70](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/mergeScan.ts#L70) + +Applies an accumulator function over the source Observable where the +accumulator function itself returns an Observable, then each intermediate +Observable returned is merged into the output Observable. + +It's like [scan](scan.md), but the Observables returned +by the accumulator are merged into the outer Observable. + +The first parameter of the `mergeScan` is an `accumulator` function which is +being called every time the source Observable emits a value. `mergeScan` will +subscribe to the value returned by the `accumulator` function and will emit +values to the subscriber emitted by inner Observable. + +The `accumulator` function is being called with three parameters passed to it: +`acc`, `value` and `index`. The `acc` parameter is used as the state parameter +whose value is initially set to the `seed` parameter (the second parameter +passed to the `mergeScan` operator). + +`mergeScan` internally keeps the value of the `acc` parameter: as long as the +source Observable emits without inner Observable emitting, the `acc` will be +set to `seed`. The next time the inner Observable emits a value, `mergeScan` +will internally remember it and it will be passed to the `accumulator` +function as `acc` parameter the next time source emits. + +The `value` parameter of the `accumulator` function is the value emitted by the +source Observable, while the `index` is a number which represent the order of the +current emission by the source Observable. It starts with 0. + +The last parameter to the `mergeScan` is the `concurrent` value which defaults +to Infinity. It represents the maximum number of inner Observable subscriptions +at a time. + +## Parameters + +| Parameter | Type | Default value | Description | +| ------------- | --------------------------------------------------------------------------------------------------------------- | ------------- | --------------------------------------------------------------------- | +| `accumulator` | (`acc`: `R`, `value`: `T`, `index`: `number`) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`R`\> | `undefined` | The accumulator function called on each source value. | +| `seed` | `R` | `undefined` | The initial accumulation value. | +| `concurrent` | `number` | `Infinity` | Maximum number of input Observables being subscribed to concurrently. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `R`\> + +A function that returns an Observable of the accumulated values. + +## Example + +Count the number of click events + +```ts +import { fromEvent, map, mergeScan, of } from 'rxjs'; + +const click$ = fromEvent(document, 'click'); +const one$ = click$.pipe(map(() => 1)); +const seed = 0; +const count$ = one$.pipe(mergeScan((acc, one) => of(acc + one), seed)); + +count$.subscribe((x) => console.log(x)); + +// Results: +// 1 +// 2 +// 3 +// 4 +// ...and so on for each click +``` + +## See + +- [scan](scan.md) +- [switchScan](switchScan.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeWith.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeWith.md new file mode 100644 index 0000000000..cff51e411f --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/mergeWith.md @@ -0,0 +1,58 @@ +[API](../../index.md) / [rxjs](../index.md) / mergeWith + +# Function: mergeWith() + +```ts +function mergeWith<>(...otherSources: [...ObservableInputTuple[]]): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/mergeWith.ts:46](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/mergeWith.ts#L46) + +Merge the values from all observables to a single observable result. + +Creates an observable, that when subscribed to, subscribes to the source +observable, and all other sources provided as arguments. All values from +every source are emitted from the resulting subscription. + +When all sources complete, the resulting observable will complete. + +When any source errors, the resulting observable will error. + +## Parameters + +| Parameter | Type | Description | +| ----------------- | ---------------------------------- | ----------------------------------------------- | +| ...`otherSources` | \[`...ObservableInputTuple[]`\] | the sources to combine the current source with. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `A`\[`number`\]\> + +A function that returns an Observable that merges the values from +all given Observables. + +## Example + +Joining all outputs from multiple user input event streams + +```ts +import { fromEvent, map, mergeWith } from 'rxjs'; + +const clicks$ = fromEvent(document, 'click').pipe(map(() => 'click')); +const mousemoves$ = fromEvent(document, 'mousemove').pipe(map(() => 'mousemove')); +const dblclicks$ = fromEvent(document, 'dblclick').pipe(map(() => 'dblclick')); + +mousemoves$.pipe(mergeWith(clicks$, dblclicks$)).subscribe((x) => console.log(x)); + +// result (assuming user interactions) +// 'mousemove' +// 'mousemove' +// 'mousemove' +// 'click' +// 'click' +// 'dblclick' +``` + +## See + +[merge](merge.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/min.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/min.md new file mode 100644 index 0000000000..83741f9055 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/min.md @@ -0,0 +1,60 @@ +[API](../../index.md) / [rxjs](../index.md) / min + +# Function: min() + +```ts +function min<>(comparer?: (x: T, y: T) => number): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/min.ts:52](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/min.ts#L52) + +The `min` operator operates on an Observable that emits numbers (or items that +can be compared with a provided function), and when source Observable completes +it emits a single item: the item with the smallest value. + +![](/images/marble-diagrams/min.png) + +## Parameters + +| Parameter | Type | Description | +| ----------- | -------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `comparer?` | (`x`: `T`, `y`: `T`) => `number` | Optional comparer function that it will use instead of its default to compare the value of two items. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that emits item with the +smallest value. + +## Example + +Get the minimal value of a series of numbers + +```ts +import { of, min } from 'rxjs'; + +of(5, 4, 7, 2, 8) + .pipe(min()) + .subscribe((x) => console.log(x)); + +// Outputs +// 2 +``` + +Use a comparer function to get the minimal item + +```ts +import { of, min } from 'rxjs'; + +of({ age: 7, name: 'Foo' }, { age: 5, name: 'Bar' }, { age: 9, name: 'Beer' }) + .pipe(min((a, b) => (a.age < b.age ? -1 : 1))) + .subscribe((x) => console.log(x.name)); + +// Outputs +// 'Bar' +``` + +## See + +[max](max.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/noop.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/noop.md new file mode 100644 index 0000000000..fea0052c83 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/noop.md @@ -0,0 +1,13 @@ +[API](../../index.md) / [rxjs](../index.md) / noop + +# Function: noop() + +```ts +function noop(): void; +``` + +Defined in: [rxjs/src/internal/util/noop.ts:1](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/noop.ts#L1) + +## Returns + +`void` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/observeOn.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/observeOn.md new file mode 100644 index 0000000000..a1258bc592 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/observeOn.md @@ -0,0 +1,72 @@ +[API](../../index.md) / [rxjs](../index.md) / observeOn + +# Function: observeOn() + +```ts +function observeOn<>(scheduler: SchedulerLike, delay: number): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/observeOn.ts:57](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/observeOn.ts#L57) + +Re-emits all notifications from source Observable with specified scheduler. + +Ensure a specific scheduler is used, from outside of an Observable. + +`observeOn` is an operator that accepts a scheduler as a first parameter, which will be used to reschedule +notifications emitted by the source Observable. It might be useful, if you do not have control over +internal scheduler of a given Observable, but want to control when its values are emitted nevertheless. + +Returned Observable emits the same notifications (nexted values, complete and error events) as the source Observable, +but rescheduled with provided scheduler. Note that this doesn't mean that source Observables internal +scheduler will be replaced in any way. Original scheduler still will be used, but when the source Observable emits +notification, it will be immediately scheduled again - this time with scheduler passed to `observeOn`. +An anti-pattern would be calling `observeOn` on Observable that emits lots of values synchronously, to split +that emissions into asynchronous chunks. For this to happen, scheduler would have to be passed into the source +Observable directly (usually into the operator that creates it). `observeOn` simply delays notifications a +little bit more, to ensure that they are emitted at expected moments. + +As a matter of fact, `observeOn` accepts second parameter, which specifies in milliseconds with what delay notifications +will be emitted. The main difference between [delay](#observeon) operator and `observeOn` is that `observeOn` +will delay all notifications - including error notifications - while `delay` will pass through error +from source Observable immediately when it is emitted. In general it is highly recommended to use `delay` operator +for any kind of delaying of values in the stream, while using `observeOn` to specify which scheduler should be used +for notification emissions in general. + +## Parameters + +| Parameter | Type | Default value | Description | +| ----------- | ------------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------- | +| `scheduler` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | `undefined` | Scheduler that will be used to reschedule notifications from source Observable. | +| `delay` | `number` | `0` | Number of milliseconds that states with what delay every notification should be rescheduled. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that emits the same +notifications as the source Observable, but with provided scheduler. + +## Example + +Ensure values in subscribe are called just before browser repaint + +```ts +import { interval, observeOn, animationFrameScheduler } from 'rxjs'; + +const someDiv = document.createElement('div'); +someDiv.style.cssText = 'width: 200px;background: #09c'; +document.body.appendChild(someDiv); +const intervals = interval(10); // Intervals are scheduled +// with async scheduler by default... +intervals + .pipe( + observeOn(animationFrameScheduler) // ...but we will observe on animationFrameScheduler + ) // scheduler to ensure smooth animation. + .subscribe((val) => { + someDiv.style.height = val + 'px'; + }); +``` + +## See + +[delay](#observeon) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/of.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/of.md new file mode 100644 index 0000000000..083e218c59 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/of.md @@ -0,0 +1,151 @@ +[API](../../index.md) / [rxjs](../index.md) / of + +# Function: of() + +> Converts the arguments to an observable sequence. + +## Description + +Each argument becomes a `next` notification. + +![](/images/marble-diagrams/of.png) + +Unlike [from](from.md), it does not do any flattening and emits each argument in whole +as a separate `next` notification. + +## Example + +Emit the values `10, 20, 30` + +```ts +import { of } from 'rxjs'; + +of(10, 20, 30).subscribe({ + next: (value) => console.log('next:', value), + error: (err) => console.log('error:', err), + complete: () => console.log('the end'), +}); + +// Outputs +// next: 10 +// next: 20 +// next: 30 +// the end +``` + +Emit the array `[1, 2, 3]` + +```ts +import { of } from 'rxjs'; + +of([1, 2, 3]).subscribe({ + next: (value) => console.log('next:', value), + error: (err) => console.log('error:', err), + complete: () => console.log('the end'), +}); + +// Outputs +// next: [1, 2, 3] +// the end +``` + +## See + +- [from](from.md) +- [range](range.md) + +## Parameters + +### `values` + +A comma separated list of arguments you want to be emitted. + +## Returns + +`An` + +Observable that synchronously emits the arguments described above and then immediately completes. + +## Call Signature + +```ts +function of(value: null): Observable; +``` + +Defined in: [rxjs/src/internal/observable/of.ts:10](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/of.ts#L10) + +### Parameters + +| Parameter | Type | +| --------- | ------ | +| `value` | `null` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`null`\> + +## Call Signature + +```ts +function of(value: undefined): Observable; +``` + +Defined in: [rxjs/src/internal/observable/of.ts:11](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/of.ts#L11) + +### Parameters + +| Parameter | Type | +| --------- | ----------- | +| `value` | `undefined` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`undefined`\> + +## Call Signature + +```ts +function of(): Observable; +``` + +Defined in: [rxjs/src/internal/observable/of.ts:13](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/of.ts#L13) + +### Returns + +[`Observable`](../classes/Observable.md)\<`never`\> + +## Call Signature + +```ts +function of<>(value: T): Observable; +``` + +Defined in: [rxjs/src/internal/observable/of.ts:14](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/of.ts#L14) + +### Parameters + +| Parameter | Type | +| --------- | ---- | +| `value` | `T` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`T`\> + +## Call Signature + +```ts +function of<>(...values: A): Observable>; +``` + +Defined in: [rxjs/src/internal/observable/of.ts:15](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/of.ts#L15) + +### Parameters + +| Parameter | Type | +| ----------- | ---- | +| ...`values` | `A` | + +### Returns + +[`Observable`](../classes/Observable.md)\<[`ValueFromArray`](../type-aliases/ValueFromArray.md)\<`A`\>\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/onErrorResumeNext.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/onErrorResumeNext.md new file mode 100644 index 0000000000..9563d6efbf --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/onErrorResumeNext.md @@ -0,0 +1,111 @@ +[API](../../index.md) / [rxjs](../index.md) / onErrorResumeNext + +# Function: onErrorResumeNext() + +> When any of the provided Observable emits a complete or an error notification, it immediately subscribes to the next one +> that was passed. + +## Description + +Execute series of Observables no matter what, even if it means swallowing errors. + +![](/images/marble-diagrams/onErrorResumeNext.png) + +`onErrorResumeNext` will subscribe to each observable source it is provided, in order. +If the source it's subscribed to emits an error or completes, it will move to the next source +without error. + +If `onErrorResumeNext` is provided no arguments, or a single, empty array, it will return [EMPTY](../variables/EMPTY.md). + +`onErrorResumeNext` is basically [concatWith](concatWith.md), only it will continue, even if one of its +sources emits an error. + +Note that there is no way to handle any errors thrown by sources via the result of +`onErrorResumeNext`. If you want to handle errors thrown in any given source, you can +always use the [catchError](catchError.md) operator on them before passing them into `onErrorResumeNext`. + +## Example + +Subscribe to the next Observable after map fails + +```ts +import { onErrorResumeNext, of, map } from 'rxjs'; + +onErrorResumeNext( + of(1, 2, 3, 0).pipe( + map((x) => { + if (x === 0) { + throw Error(); + } + return 10 / x; + }) + ), + of(1, 2, 3) +).subscribe({ + next: (value) => console.log(value), + error: (err) => console.log(err), // Will never be called. + complete: () => console.log('done'), +}); + +// Logs: +// 10 +// 5 +// 3.3333333333333335 +// 1 +// 2 +// 3 +// 'done' +``` + +## See + +- [concat](concat.md) +- [catchError](catchError.md) + +## Parameters + +### `sources` + +`ObservableInput`s passed either directly or as an array. + +## Returns + +`An` + +Observable that concatenates all sources, one after the other, ignoring all errors, such that any error causes it to move on to the next source. + +## Call Signature + +```ts +function onErrorResumeNext<>(sources: [...ObservableInputTuple[]]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/onErrorResumeNext.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/onErrorResumeNext.ts#L6) + +### Parameters + +| Parameter | Type | +| --------- | ---------------------------------- | +| `sources` | \[`...ObservableInputTuple[]`\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`A`\[`number`\]\> + +## Call Signature + +```ts +function onErrorResumeNext<>(...sources: [...ObservableInputTuple[]]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/onErrorResumeNext.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/onErrorResumeNext.ts#L7) + +### Parameters + +| Parameter | Type | +| ------------ | ---------------------------------- | +| ...`sources` | \[`...ObservableInputTuple[]`\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`A`\[`number`\]\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/onErrorResumeNextWith.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/onErrorResumeNextWith.md new file mode 100644 index 0000000000..cdfbb9f4ec --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/onErrorResumeNextWith.md @@ -0,0 +1,122 @@ +[API](../../index.md) / [rxjs](../index.md) / onErrorResumeNextWith + +# Function: onErrorResumeNextWith() + +> When any of the provided Observable emits an complete or error notification, it immediately subscribes to the next one +> that was passed. + +## Description + +Execute series of Observables, subscribes to next one on error or complete. + +![](/images/marble-diagrams/onErrorResumeNext.png) + +`onErrorResumeNext` is an operator that accepts a series of Observables, provided either directly as +arguments or as an array. If no single Observable is provided, returned Observable will simply behave the same +as the source. + +`onErrorResumeNext` returns an Observable that starts by subscribing and re-emitting values from the source Observable. +When its stream of values ends - no matter if Observable completed or emitted an error - `onErrorResumeNext` +will subscribe to the first Observable that was passed as an argument to the method. It will start re-emitting +its values as well and - again - when that stream ends, `onErrorResumeNext` will proceed to subscribing yet another +Observable in provided series, no matter if previous Observable completed or ended with an error. This will +be happening until there is no more Observables left in the series, at which point returned Observable will +complete - even if the last subscribed stream ended with an error. + +`onErrorResumeNext` can be therefore thought of as version of [concatWith](concatWith.md) operator, which is more permissive +when it comes to the errors emitted by its input Observables. While `concat` subscribes to the next Observable +in series only if previous one successfully completed, `onErrorResumeNext` subscribes even if it ended with +an error. + +Note that you do not get any access to errors emitted by the Observables. In particular do not +expect these errors to appear in error callback passed to [Observable#subscribe](../classes/Observable.md#subscribe). If you want to take +specific actions based on what error was emitted by an Observable, you should try out [catchError](catchError.md) instead. + +## Example + +Subscribe to the next Observable after map fails + +```ts +import { of, onErrorResumeNext, map } from 'rxjs'; + +of(1, 2, 3, 0) + .pipe( + map((x) => { + if (x === 0) { + throw Error(); + } + + return 10 / x; + }), + onErrorResumeNext(of(1, 2, 3)) + ) + .subscribe({ + next: (val) => console.log(val), + error: (err) => console.log(err), // Will never be called. + complete: () => console.log("that's it!"), + }); + +// Logs: +// 10 +// 5 +// 3.3333333333333335 +// 1 +// 2 +// 3 +// 'that's it!' +``` + +## See + +- [concat](concat.md) +- [catchError](catchError.md) + +## Parameters + +### `sources` + +`ObservableInput`s passed either directly or as an array. + +## Returns + +`A function that returns an Observable that emits values from source +Observable, but` + +if it errors - subscribes to the next passed Observable +and so on, until it completes or runs out of Observables. + +## Call Signature + +```ts +function onErrorResumeNextWith<>(sources: [...ObservableInputTuple[]]): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/onErrorResumeNextWith.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/onErrorResumeNextWith.ts#L5) + +### Parameters + +| Parameter | Type | +| --------- | ---------------------------------- | +| `sources` | \[`...ObservableInputTuple[]`\] | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `A`\[`number`\]\> + +## Call Signature + +```ts +function onErrorResumeNextWith<>(...sources: [...ObservableInputTuple[]]): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/onErrorResumeNextWith.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/onErrorResumeNextWith.ts#L8) + +### Parameters + +| Parameter | Type | +| ------------ | ---------------------------------- | +| ...`sources` | \[`...ObservableInputTuple[]`\] | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `A`\[`number`\]\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/operate.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/operate.md new file mode 100644 index 0000000000..58bea6e5b5 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/operate.md @@ -0,0 +1,37 @@ +[API](../../index.md) / [rxjs](../index.md) / operate + +# Function: operate() + +```ts +function operate<>(config: OperateConfig): Subscriber; +``` + +Defined in: [observable/src/observable.ts:536](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L536) + +Creates a new [Subscriber](../classes/Subscriber.md) instance that passes notifications on to the +supplied `destination`. The overrides provided in the `config` argument for +`next`, `error`, and `complete` will be called in such a way that any +errors are caught and forwarded to the destination's `error` handler. The returned +`Subscriber` will be "chained" to the `destination` such that when `unsubscribe` is +called on the `destination`, the returned `Subscriber` will also be unsubscribed. + +Advanced: This ensures that subscriptions are properly wired up prior to starting the +subscription logic. This prevents "synchronous firehose" scenarios where an +inner observable from a flattening operation cannot be stopped by a downstream +terminal operator like `take`. + +This is a utility designed to be used to create new operators for observables. + +For examples, please see our code base. + +## Parameters + +| Parameter | Type | Description | +| --------- | ------------------------------ | ---------------------------------------------------------------- | +| `config` | `OperateConfig`\<`In`, `Out`\> | The configuration for creating a new subscriber for an operator. | + +## Returns + +[`Subscriber`](../classes/Subscriber.md)\<`In`\> + +A new subscriber that is chained to the destination. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/pairwise.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/pairwise.md new file mode 100644 index 0000000000..23ab9b93e8 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/pairwise.md @@ -0,0 +1,57 @@ +[API](../../index.md) / [rxjs](../index.md) / pairwise + +# Function: pairwise() + +```ts +function pairwise<>(): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/pairwise.ts:47](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/pairwise.ts#L47) + +Groups pairs of consecutive emissions together and emits them as an array of +two values. + +Puts the current value and previous value together as +an array, and emits that. + +![](/images/marble-diagrams/pairwise.png) + +The Nth emission from the source Observable will cause the output Observable +to emit an array [(N-1)th, Nth] of the previous and the current value, as a +pair. For this reason, `pairwise` emits on the second and subsequent +emissions from the source Observable, but not on the first emission, because +there is no previous value in that case. + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, \[`T`, `T`\]\> + +A function that returns an Observable of pairs (as arrays) of +consecutive values from the source Observable. + +## Example + +On every click (starting from the second), emit the relative distance to the previous click + +```ts +import { fromEvent, pairwise, map } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const pairs = clicks.pipe(pairwise()); +const distance = pairs.pipe( + map(([first, second]) => { + const x0 = first.clientX; + const y0 = first.clientY; + const x1 = second.clientX; + const y1 = second.clientY; + return Math.sqrt(Math.pow(x0 - x1, 2) + Math.pow(y0 - y1, 2)); + }) +); + +distance.subscribe((x) => console.log(x)); +``` + +## See + +- [buffer](buffer.md) +- [bufferCount](bufferCount.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/partition.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/partition.md new file mode 100644 index 0000000000..771c2e5d87 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/partition.md @@ -0,0 +1,182 @@ +[API](../../index.md) / [rxjs](../index.md) / partition + +# ~~Function: partition()~~ + +> Splits the source Observable into two, one with values that satisfy a +> predicate, and another with values that don't satisfy the predicate. + +## Description + +It's like [filter](filter.md), but returns two Observables: +one like the output of [filter](filter.md), and the other with values that did not +pass the condition. + +![](/images/marble-diagrams/partition.png) + +`partition` outputs an array with two Observables that partition the values +from the source Observable through the given `predicate` function. The first +Observable in that array emits source values for which the predicate argument +returns true. The second Observable emits source values for which the +predicate returns false. The first behaves like [filter](filter.md) and the second +behaves like [filter](filter.md) with the predicate negated. + +## Example + +Partition a set of numbers into odds and evens observables + +```ts +import { of, partition } from 'rxjs'; + +const observableValues = of(1, 2, 3, 4, 5, 6); +const [evens$, odds$] = partition(observableValues, (value) => value % 2 === 0); + +odds$.subscribe((x) => console.log('odds', x)); +evens$.subscribe((x) => console.log('evens', x)); + +// Logs: +// odds 1 +// odds 3 +// odds 5 +// evens 2 +// evens 4 +// evens 6 +``` + +## See + +[filter](filter.md) + +two Observable elements. + +Observable. If it returns `true`, the value is emitted on the first Observable +in the returned array, if `false` the value is emitted on the second Observable +in the array. The `index` parameter is the number `i` for the i-th source +emission that has happened since the subscription, starting from the number `0`. + +`predicate` function. + +## Parameters + +### `source` + +The source `ObservableInput` that will be split into a tuple of + +### `predicate` + +A function that evaluates each value emitted by the source + +### `thisArg` + +An optional argument to determine the value of `this` in the + +## Returns + +`An array with two Observables` + +one with values that passed the +predicate, and another with values that did not pass the predicate. + +## Call Signature + +```ts +function partition<>( + source: ObservableInput, + predicate: (this: A, value: T, index: number) => value is U, + thisArg: A +): [Observable, Observable>]; +``` + +Defined in: [rxjs/src/internal/observable/partition.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/partition.ts#L8) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`T`\> | +| `predicate` | (`this`: `A`, `value`: `T`, `index`: `number`) => `value is U` | +| `thisArg` | `A` | + +### Returns + +\[[`Observable`](../classes/Observable.md)\<`U`\>, [`Observable`](../classes/Observable.md)\<`Exclude`\<`T`, `U`\>\>\] + +### Deprecated + +Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. + +## Call Signature + +```ts +function partition<>( + source: ObservableInput, + predicate: (value: T, index: number) => value is U +): [Observable, Observable>]; +``` + +Defined in: [rxjs/src/internal/observable/partition.ts:13](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/partition.ts#L13) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`T`\> | +| `predicate` | (`value`: `T`, `index`: `number`) => `value is U` | + +### Returns + +\[[`Observable`](../classes/Observable.md)\<`U`\>, [`Observable`](../classes/Observable.md)\<`Exclude`\<`T`, `U`\>\>\] + +### Deprecated + +Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. + +## Call Signature + +```ts +function partition<>( + source: ObservableInput, + predicate: (this: A, value: T, index: number) => boolean, + thisArg: A +): [Observable, Observable]; +``` + +Defined in: [rxjs/src/internal/observable/partition.ts:19](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/partition.ts#L19) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`T`\> | +| `predicate` | (`this`: `A`, `value`: `T`, `index`: `number`) => `boolean` | +| `thisArg` | `A` | + +### Returns + +\[[`Observable`](../classes/Observable.md)\<`T`\>, [`Observable`](../classes/Observable.md)\<`T`\>\] + +### Deprecated + +Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. + +## Call Signature + +```ts +function partition<>(source: ObservableInput, predicate: (value: T, index: number) => boolean): [Observable, Observable]; +``` + +Defined in: [rxjs/src/internal/observable/partition.ts:24](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/partition.ts#L24) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`T`\> | +| `predicate` | (`value`: `T`, `index`: `number`) => `boolean` | + +### Returns + +\[[`Observable`](../classes/Observable.md)\<`T`\>, [`Observable`](../classes/Observable.md)\<`T`\>\] + +### Deprecated + +Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/pipe.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/pipe.md new file mode 100644 index 0000000000..4a23ac90fc --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/pipe.md @@ -0,0 +1,326 @@ +[API](../../index.md) / [rxjs](../index.md) / pipe + +# Function: pipe() + +## Description + +pipe() can be called on one or more functions, each of which can take one argument ("UnaryFunction") +and uses it to return a value. +It returns a function that takes one argument, passes it to the first UnaryFunction, and then +passes the result to the next one, passes that result to the next one, and so on. + +pipe() can be called on one or more functions, each of which can take one argument ("UnaryFunction") +and uses it to return a value. +It returns a function that takes one argument, passes it to the first UnaryFunction, and then +passes the result to the next one, passes that result to the next one, and so on. + +## Call Signature + +```ts +function pipe(): (x: T) => T; +``` + +Defined in: [rxjs/src/internal/util/pipe.ts:3](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/pipe.ts#L3) + +### Returns + +```ts +(x: T): T; +``` + +#### Type Parameters + +| Type Parameter | +| -------------- | +| `T` | + +#### Parameters + +| Parameter | Type | +| --------- | ---- | +| `x` | `T` | + +#### Returns + +`T` + +## Call Signature + +```ts +function pipe<>(fn1: UnaryFunction): UnaryFunction; +``` + +Defined in: [rxjs/src/internal/util/pipe.ts:4](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/pipe.ts#L4) + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------- | +| `fn1` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `A`\> | + +### Returns + +[`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `A`\> + +## Call Signature + +```ts +function pipe<>(fn1: UnaryFunction, fn2: UnaryFunction): UnaryFunction; +``` + +Defined in: [rxjs/src/internal/util/pipe.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/pipe.ts#L5) + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------- | +| `fn1` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`A`, `B`\> | + +### Returns + +[`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `B`\> + +## Call Signature + +```ts +function pipe<>(fn1: UnaryFunction, fn2: UnaryFunction, fn3: UnaryFunction): UnaryFunction; +``` + +Defined in: [rxjs/src/internal/util/pipe.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/pipe.ts#L6) + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------- | +| `fn1` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`A`, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | + +### Returns + +[`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `C`\> + +## Call Signature + +```ts +function pipe<>( + fn1: UnaryFunction, + fn2: UnaryFunction, + fn3: UnaryFunction, + fn4: UnaryFunction +): UnaryFunction; +``` + +Defined in: [rxjs/src/internal/util/pipe.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/pipe.ts#L7) + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------- | +| `fn1` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`A`, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | +| `fn4` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`C`, `D`\> | + +### Returns + +[`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `D`\> + +## Call Signature + +```ts +function pipe<>( + fn1: UnaryFunction, + fn2: UnaryFunction, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction +): UnaryFunction; +``` + +Defined in: [rxjs/src/internal/util/pipe.ts:13](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/pipe.ts#L13) + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------- | +| `fn1` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`A`, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | +| `fn4` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`C`, `D`\> | +| `fn5` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`D`, `E`\> | + +### Returns + +[`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `E`\> + +## Call Signature + +```ts +function pipe<>( + fn1: UnaryFunction, + fn2: UnaryFunction, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction +): UnaryFunction; +``` + +Defined in: [rxjs/src/internal/util/pipe.ts:20](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/pipe.ts#L20) + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------- | +| `fn1` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`A`, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | +| `fn4` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`C`, `D`\> | +| `fn5` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`D`, `E`\> | +| `fn6` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`E`, `F`\> | + +### Returns + +[`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `F`\> + +## Call Signature + +```ts +function pipe<>( + fn1: UnaryFunction, + fn2: UnaryFunction, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction, + fn7: UnaryFunction +): UnaryFunction; +``` + +Defined in: [rxjs/src/internal/util/pipe.ts:28](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/pipe.ts#L28) + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------- | +| `fn1` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`A`, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | +| `fn4` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`C`, `D`\> | +| `fn5` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`D`, `E`\> | +| `fn6` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`E`, `F`\> | +| `fn7` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`F`, `G`\> | + +### Returns + +[`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `G`\> + +## Call Signature + +```ts +function pipe<>( + fn1: UnaryFunction, + fn2: UnaryFunction, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction, + fn7: UnaryFunction, + fn8: UnaryFunction +): UnaryFunction; +``` + +Defined in: [rxjs/src/internal/util/pipe.ts:37](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/pipe.ts#L37) + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------- | +| `fn1` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`A`, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | +| `fn4` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`C`, `D`\> | +| `fn5` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`D`, `E`\> | +| `fn6` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`E`, `F`\> | +| `fn7` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`F`, `G`\> | +| `fn8` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`G`, `H`\> | + +### Returns + +[`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `H`\> + +## Call Signature + +```ts +function pipe<>( + fn1: UnaryFunction, + fn2: UnaryFunction, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction, + fn7: UnaryFunction, + fn8: UnaryFunction, + fn9: UnaryFunction +): UnaryFunction; +``` + +Defined in: [rxjs/src/internal/util/pipe.ts:47](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/pipe.ts#L47) + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------- | +| `fn1` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`A`, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | +| `fn4` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`C`, `D`\> | +| `fn5` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`D`, `E`\> | +| `fn6` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`E`, `F`\> | +| `fn7` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`F`, `G`\> | +| `fn8` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`G`, `H`\> | +| `fn9` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`H`, `I`\> | + +### Returns + +[`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `I`\> + +## Call Signature + +```ts +function pipe<>( + fn1: UnaryFunction, + fn2: UnaryFunction, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction, + fn7: UnaryFunction, + fn8: UnaryFunction, + fn9: UnaryFunction, + ...fns: UnaryFunction[] +): UnaryFunction; +``` + +Defined in: [rxjs/src/internal/util/pipe.ts:58](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/pipe.ts#L58) + +### Parameters + +| Parameter | Type | +| --------- | ------------------------------------------------------------------- | +| `fn1` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`A`, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | +| `fn4` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`C`, `D`\> | +| `fn5` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`D`, `E`\> | +| `fn6` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`E`, `F`\> | +| `fn7` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`F`, `G`\> | +| `fn8` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`G`, `H`\> | +| `fn9` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`H`, `I`\> | +| ...`fns` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`any`, `any`\>[] | + +### Returns + +[`UnaryFunction`](../interfaces/UnaryFunction.md)\<`T`, `unknown`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/race.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/race.md new file mode 100644 index 0000000000..1b55b6e016 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/race.md @@ -0,0 +1,87 @@ +[API](../../index.md) / [rxjs](../index.md) / race + +# Function: race() + +> Returns an observable that mirrors the first source observable to emit an item. + +## Description + +![](/images/marble-diagrams/race.png) + +`race` returns an observable, that when subscribed to, subscribes to all source observables immediately. +As soon as one of the source observables emits a value, the result unsubscribes from the other sources. +The resulting observable will forward all notifications, including error and completion, from the "winning" +source observable. + +If one of the used source observable throws an errors before a first notification +the race operator will also throw an error, no matter if another source observable +could potentially win the race. + +`race` can be useful for selecting the response from the fastest network connection for +HTTP or WebSockets. `race` can also be useful for switching observable context based on user +input. + +## Example + +Subscribes to the observable that was the first to start emitting. + +```ts +import { interval, map, race } from 'rxjs'; + +const obs1 = interval(7000).pipe(map(() => 'slow one')); +const obs2 = interval(3000).pipe(map(() => 'fast one')); +const obs3 = interval(5000).pipe(map(() => 'medium one')); + +race(obs1, obs2, obs3).subscribe((winner) => console.log(winner)); + +// Outputs +// a series of 'fast one' +``` + +## Parameters + +### `sources` + +Used to race for which `ObservableInput` emits first. + +## Returns + +`An` + +Observable that mirrors the output of the first Observable to emit an item. + +## Call Signature + +```ts +function race<>(inputs: [...ObservableInputTuple[]]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/race.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/race.ts#L6) + +### Parameters + +| Parameter | Type | +| --------- | ---------------------------------- | +| `inputs` | \[`...ObservableInputTuple[]`\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`T`\[`number`\]\> + +## Call Signature + +```ts +function race<>(...inputs: [...ObservableInputTuple[]]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/race.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/race.ts#L7) + +### Parameters + +| Parameter | Type | +| ----------- | ---------------------------------- | +| ...`inputs` | \[`...ObservableInputTuple[]`\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`T`\[`number`\]\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/raceWith.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/raceWith.md new file mode 100644 index 0000000000..f6e71ee131 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/raceWith.md @@ -0,0 +1,41 @@ +[API](../../index.md) / [rxjs](../index.md) / raceWith + +# Function: raceWith() + +```ts +function raceWith<>(...otherSources: [...ObservableInputTuple[]]): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/raceWith.ts:32](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/raceWith.ts#L32) + +Creates an Observable that mirrors the first source Observable to emit a next, +error or complete notification from the combination of the Observable to which +the operator is applied and supplied Observables. + +## Parameters + +| Parameter | Type | Description | +| ----------------- | ---------------------------------- | ------------------------------------------------------ | +| ...`otherSources` | \[`...ObservableInputTuple[]`\] | Sources used to race for which Observable emits first. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `A`\[`number`\]\> + +A function that returns an Observable that mirrors the output of the +first Observable to emit an item. + +## Example + +```ts +import { interval, map, raceWith } from 'rxjs'; + +const obs1 = interval(7000).pipe(map(() => 'slow one')); +const obs2 = interval(3000).pipe(map(() => 'fast one')); +const obs3 = interval(5000).pipe(map(() => 'medium one')); + +obs1.pipe(raceWith(obs2, obs3)).subscribe((winner) => console.log(winner)); + +// Outputs +// a series of 'fast one' +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/range.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/range.md new file mode 100644 index 0000000000..2b97f721b9 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/range.md @@ -0,0 +1,108 @@ +[API](../../index.md) / [rxjs](../index.md) / range + +# Function: range() + +> Creates an Observable that emits a sequence of numbers within a specified +> range. + +## Description + +Emits a sequence of numbers in a range. + +![](/images/marble-diagrams/range.png) + +`range` operator emits a range of sequential integers, in order, where you +select the `start` of the range and its `length`. By default, uses no +[SchedulerLike](../interfaces/SchedulerLike.md) and just delivers the notifications synchronously, but may use +an optional [SchedulerLike](../interfaces/SchedulerLike.md) to regulate those deliveries. + +## Example + +Produce a range of numbers + +```ts +import { range } from 'rxjs'; + +const numbers = range(1, 3); + +numbers.subscribe({ + next: (value) => console.log(value), + complete: () => console.log('Complete!'), +}); + +// Logs: +// 1 +// 2 +// 3 +// 'Complete!' +``` + +## See + +- [timer](timer.md) +- [interval](interval.md) + +of the notifications. + +## Parameters + +### `start` + +The value of the first integer in the sequence. + +### `count` + +The number of sequential integers to generate. + +### `scheduler` + +A [SchedulerLike](../interfaces/SchedulerLike.md) to use for scheduling the emissions + +## Returns + +`An` + +Observable of numbers that emits a finite range of sequential integers. + +## Call Signature + +```ts +function range(start: number, count?: number): Observable; +``` + +Defined in: [rxjs/src/internal/observable/range.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/range.ts#L6) + +### Parameters + +| Parameter | Type | +| --------- | -------- | +| `start` | `number` | +| `count?` | `number` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`number`\> + +## Call Signature + +```ts +function range(start: number, count: number | undefined, scheduler: SchedulerLike): Observable; +``` + +Defined in: [rxjs/src/internal/observable/range.ts:11](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/range.ts#L11) + +### Parameters + +| Parameter | Type | +| ----------- | ------------------------------------------------- | +| `start` | `number` | +| `count` | `number` \| `undefined` | +| `scheduler` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +[`Observable`](../classes/Observable.md)\<`number`\> + +### Deprecated + +The `scheduler` parameter will be removed in v8. Use `range(start, count).pipe(observeOn(scheduler))` instead. Details: Details: https://rxjs.dev/deprecations/scheduler-argument diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/reduce.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/reduce.md new file mode 100644 index 0000000000..cb1cec34b3 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/reduce.md @@ -0,0 +1,122 @@ +[API](../../index.md) / [rxjs](../index.md) / reduce + +# Function: reduce() + +> Applies an accumulator function over the source Observable, and returns the +> accumulated result when the source completes, given an optional seed value. + +## Description + +Combines together all values emitted on the source, +using an accumulator function that knows how to join a new source value into +the accumulation from the past. + +![](/images/marble-diagrams/reduce.png) + +Like +[Array.prototype.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce), +`reduce` applies an `accumulator` function against an accumulation and each +value of the source Observable (from the past) to reduce it to a single +value, emitted on the output Observable. Note that `reduce` will only emit +one value, only when the source Observable completes. It is equivalent to +applying operator [scan](scan.md) followed by operator [last](last.md). + +Returns an Observable that applies a specified `accumulator` function to each +item emitted by the source Observable. If a `seed` value is specified, then +that value will be used as the initial value for the accumulator. If no seed +value is specified, the first item of the source is used as the seed. + +## Example + +Count the number of click events that happened in 5 seconds + +```ts +import { fromEvent, takeUntil, interval, map, reduce } from 'rxjs'; + +const clicksInFiveSeconds = fromEvent(document, 'click').pipe(takeUntil(interval(5000))); + +const ones = clicksInFiveSeconds.pipe(map(() => 1)); +const seed = 0; +const count = ones.pipe(reduce((acc, one) => acc + one, seed)); + +count.subscribe((x) => console.log(x)); +``` + +## See + +- [count](count.md) +- [expand](expand.md) +- [mergeScan](mergeScan.md) +- [scan](scan.md) + +## Parameters + +### `accumulator` + +The accumulator function called on each source value. + +### `seed` + +The initial accumulation value. + +## Returns + +`A` + +function that returns an Observable that emits a single value that is the result of accumulating the values emitted by the source Observable. + +## Call Signature + +```ts +function reduce<>(accumulator: (acc: V | A, value: V, index: number) => A): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/reduce.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/reduce.ts#L5) + +### Parameters + +| Parameter | Type | +| ------------- | ----------------------------------------------------------- | +| `accumulator` | (`acc`: `V` \| `A`, `value`: `V`, `index`: `number`) => `A` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`V`, `V` \| `A`\> + +## Call Signature + +```ts +function reduce<>(accumulator: (acc: A, value: V, index: number) => A, seed: A): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/reduce.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/reduce.ts#L6) + +### Parameters + +| Parameter | Type | +| ------------- | ---------------------------------------------------- | +| `accumulator` | (`acc`: `A`, `value`: `V`, `index`: `number`) => `A` | +| `seed` | `A` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`V`, `A`\> + +## Call Signature + +```ts +function reduce<>(accumulator: (acc: A | S, value: V, index: number) => A, seed: S): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/reduce.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/reduce.ts#L7) + +### Parameters + +| Parameter | Type | +| ------------- | ----------------------------------------------------------- | +| `accumulator` | (`acc`: `A` \| `S`, `value`: `V`, `index`: `number`) => `A` | +| `seed` | `S` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`V`, `A`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/repeat.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/repeat.md new file mode 100644 index 0000000000..e6bfddf52d --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/repeat.md @@ -0,0 +1,109 @@ +[API](../../index.md) / [rxjs](../index.md) / repeat + +# Function: repeat() + +```ts +function repeat<>(countOrConfig?: number | RepeatConfig): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/repeat.ts:114](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/repeat.ts#L114) + +Returns an Observable that will resubscribe to the source stream when the source stream completes. + +Repeats all values emitted on the source. It's like [retry](retry.md), but for non error cases. + +![](/images/marble-diagrams/repeat.png) + +Repeat will output values from a source until the source completes, then it will resubscribe to the +source a specified number of times, with a specified delay. Repeat can be particularly useful in +combination with closing operators like [take](take.md), [takeUntil](takeUntil.md), [first](first.md), or [takeWhile](takeWhile.md), +as it can be used to restart a source again from scratch. + +Repeat is very similar to [retry](retry.md), where [retry](retry.md) will resubscribe to the source in the error case, but +`repeat` will resubscribe if the source completes. + +Note that `repeat` will _not_ catch errors. Use [retry](retry.md) for that. + +- `repeat(0)` returns an empty observable +- `repeat()` will repeat forever +- `repeat({ delay: 200 })` will repeat forever, with a delay of 200ms between repetitions. +- `repeat({ count: 2, delay: 400 })` will repeat twice, with a delay of 400ms between repetitions. +- `repeat({ delay: (count) => timer(count * 1000) })` will repeat forever, but will have a delay that grows by one second for each repetition. + +## Parameters + +| Parameter | Type | Description | +| ---------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `countOrConfig?` | `number` \| [`RepeatConfig`](../interfaces/RepeatConfig.md) | Either the number of times the source Observable items are repeated (a count of 0 will yield an empty Observable) or a [RepeatConfig](../interfaces/RepeatConfig.md) object. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +## Example + +Repeat a message stream + +```ts +import { of, repeat } from 'rxjs'; + +const source = of('Repeat message'); +const result = source.pipe(repeat(3)); + +result.subscribe((x) => console.log(x)); + +// Results +// 'Repeat message' +// 'Repeat message' +// 'Repeat message' +``` + +Repeat 3 values, 2 times + +```ts +import { interval, take, repeat } from 'rxjs'; + +const source = interval(1000); +const result = source.pipe(take(3), repeat(2)); + +result.subscribe((x) => console.log(x)); + +// Results every second +// 0 +// 1 +// 2 +// 0 +// 1 +// 2 +``` + +Defining two complex repeats with delays on the same source. +Note that the second repeat cannot be called until the first +repeat as exhausted it's count. + +```ts +import { defer, of, repeat } from 'rxjs'; + +const source = defer(() => { + return of(`Hello, it is ${new Date()}`); +}); + +source.pipe( + // Repeat 3 times with a delay of 1 second between repetitions + repeat({ + count: 3, + delay: 1000, + }), + + // *Then* repeat forever, but with an exponential step-back + // maxing out at 1 minute. + repeat({ + delay: (count) => timer(Math.min(60000, 2 ^ (count * 1000))), + }) +); +``` + +## See + +- [repeatWhen](repeatWhen.md) +- [retry](retry.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/repeatWhen.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/repeatWhen.md new file mode 100644 index 0000000000..0b9771558d --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/repeatWhen.md @@ -0,0 +1,55 @@ +[API](../../index.md) / [rxjs](../index.md) / repeatWhen + +# ~~Function: repeatWhen()~~ + +```ts +function repeatWhen<>(notifier: (notifications: Observable) => ObservableInput): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/repeatWhen.ts:40](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/repeatWhen.ts#L40) + +Returns an Observable that mirrors the source Observable with the exception of a `complete`. If the source +Observable calls `complete`, this method will emit to the Observable returned from `notifier`. If that Observable +calls `complete` or `error`, then this method will call `complete` or `error` on the child subscription. Otherwise +this method will resubscribe to the source Observable. + +![](/images/marble-diagrams/repeatWhen.png) + +## Parameters + +| Parameter | Type | Description | +| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `notifier` | (`notifications`: [`Observable`](../classes/Observable.md)\<`void`\>) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | Function that receives an Observable of notifications with which a user can `complete` or `error`, aborting the repetition. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that mirrors the source +Observable with the exception of a `complete`. + +## Example + +Repeat a message stream on click + +```ts +import { of, fromEvent, repeatWhen } from 'rxjs'; + +const source = of('Repeat message'); +const documentClick$ = fromEvent(document, 'click'); + +const result = source.pipe(repeatWhen(() => documentClick$)); + +result.subscribe((data) => console.log(data)); +``` + +## See + +- [repeat](repeat.md) +- [retry](retry.md) +- [retryWhen](retryWhen.md) + +## Deprecated + +Will be removed in v9 or v10. Use [repeat](repeat.md)'s [delay](../interfaces/RepeatConfig.md#delay) option instead. +Instead of `repeatWhen(() => notify$)`, use: `repeat({ delay: () => notify$ })`. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/retry.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/retry.md new file mode 100644 index 0000000000..72f6f0c2a8 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/retry.md @@ -0,0 +1,99 @@ +[API](../../index.md) / [rxjs](../index.md) / retry + +# Function: retry() + +> Returns an Observable that mirrors the source Observable with the exception of an `error`. + +## Description + +If the source Observable calls `error`, this method will resubscribe to the source Observable for a maximum of +`count` resubscriptions rather than propagating the `error` call. + +![](/images/marble-diagrams/retry.png) + +The number of retries is determined by the `count` parameter. It can be set either by passing a number to +`retry` function or by setting `count` property when `retry` is configured using [RetryConfig](../interfaces/RetryConfig.md). If +`count` is omitted, `retry` will try to resubscribe on errors infinite number of times. + +Any and all items emitted by the source Observable will be emitted by the resulting Observable, even those +emitted during failed subscriptions. For example, if an Observable fails at first but emits `[1, 2]` then +succeeds the second time and emits: `[1, 2, 3, 4, 5, complete]` then the complete stream of emissions and +notifications would be: `[1, 2, 1, 2, 3, 4, 5, complete]`. + +## Example + +```ts +import { interval, mergeMap, throwError, of, retry } from 'rxjs'; + +const source = interval(1000); +const result = source.pipe( + mergeMap((val) => (val > 5 ? throwError(() => 'Error!') : of(val))), + retry(2) // retry 2 times on error +); + +result.subscribe({ + next: (value) => console.log(value), + error: (err) => console.log(`${err}: Retried 2 times then quit!`), +}); + +// Output: +// 0..1..2..3..4..5.. +// 0..1..2..3..4..5.. +// 0..1..2..3..4..5.. +// 'Error!: Retried 2 times then quit!' +``` + +## See + +[retryWhen](retryWhen.md) + +[RetryConfig](../interfaces/RetryConfig.md) object. + +## Parameters + +### `configOrCount` + +Either number of retry attempts before failing or a + +## Returns + +`A function that returns an Observable that will resubscribe to the +source stream when the source stream errors, at most` + +times. + +## Call Signature + +```ts +function retry<>(count?: number): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/retry.ts:32](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/retry.ts#L32) + +### Parameters + +| Parameter | Type | +| --------- | -------- | +| `count?` | `number` | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +## Call Signature + +```ts +function retry<>(config: RetryConfig): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/retry.ts:33](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/retry.ts#L33) + +### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------- | +| `config` | [`RetryConfig`](../interfaces/RetryConfig.md) | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/retryWhen.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/retryWhen.md new file mode 100644 index 0000000000..6a5b23ff95 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/retryWhen.md @@ -0,0 +1,77 @@ +[API](../../index.md) / [rxjs](../index.md) / retryWhen + +# ~~Function: retryWhen()~~ + +```ts +function retryWhen<>(notifier: (errors: Observable) => ObservableInput): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/retryWhen.ts:62](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/retryWhen.ts#L62) + +Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable +calls `error`, this method will emit the Throwable that caused the error to the `ObservableInput` returned from `notifier`. +If that Observable calls `complete` or `error` then this method will call `complete` or `error` on the child +subscription. Otherwise this method will resubscribe to the source Observable. + +![](/images/marble-diagrams/retryWhen.png) + +Retry an observable sequence on error based on custom criteria. + +## Parameters + +| Parameter | Type | Description | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `notifier` | (`errors`: [`Observable`](../classes/Observable.md)\<`any`\>) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | Function that receives an Observable of notifications with which a user can `complete` or `error`, aborting the retry. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that mirrors the source +Observable with the exception of an `error`. + +## Example + +```ts +import { interval, map, retryWhen, tap, delayWhen, timer } from 'rxjs'; + +const source = interval(1000); +const result = source.pipe( + map((value) => { + if (value > 5) { + // error will be picked up by retryWhen + throw value; + } + return value; + }), + retryWhen((errors) => + errors.pipe( + // log error message + tap((value) => console.log(`Value ${value} was too high!`)), + // restart in 5 seconds + delayWhen((value) => timer(value * 1000)) + ) + ) +); + +result.subscribe((value) => console.log(value)); + +// results: +// 0 +// 1 +// 2 +// 3 +// 4 +// 5 +// 'Value 6 was too high!' +// - Wait 5 seconds then repeat +``` + +## See + +[retry](retry.md) + +## Deprecated + +Will be removed in v9 or v10. Use [retry](retry.md)'s [delay](../interfaces/RetryConfig.md#delay) option instead. +Instead of `retryWhen(() => notify$)`, use: `retry({ delay: () => notify$ })`. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/rx.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/rx.md new file mode 100644 index 0000000000..06260de953 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/rx.md @@ -0,0 +1,334 @@ +[API](../../index.md) / [rxjs](../index.md) / rx + +# Function: rx() + +> Converts the first argument to an observable, then passes that observable to the function in the second argument. +> The result of _that_ function is then passed to the function in the third argument, and so on. This continues until +> all functions have been called, and the result of the last function is returned. + +## Description + +This means it can be used for anything involving unary functions, just so long as the first unary function accepts an observable as its argument, +and as long as the first argument to `rx()` is a valid [ObservableInput](../type-aliases/ObservableInput.md). + +This is the same as an ordinary functional [pipe](pipe.md), except it has an implicit `from` as the second argument. + +The following are equivalent: + +```ts +// Where `source` is any valid `ObservableInput`. +// A (observable, promise, array, async iterable, etc.) +rx( + source, + map((x) => x + 1), + filter((x) => x % 2 === 0) +); +pipe( + map((x) => x + 1), + filter((x) => x % 2 === 0) +)(from(source)); +pipe( + from, + map((x) => x + 1), + filter((x) => x % 2 === 0) +)(source); +``` + +Furthermore, `rx` can be used to create an observable and pipe it in any number of ways. For example: + +```ts +const subscription = rx( + of(1, 2, 3), + source => source.subscribe(x => console.log(x)), +); + +// or even something like this: +const promise = rx( + of(1, 2, 3), + async (source) => { + const result = []; + await source.forEach(x => result.push(x)); + return result; + }, +}); +``` + +@param source Any valid observable source. +@param fns Any number of unary functions, starting with a unary function that accepts an observable as its only argument. +@returns The result of the last function, or an observable if no functions are provided for the second argument and beyond. + +## Call Signature + +```ts +function rx<>(source: ObservableInput): Observable; +``` + +Defined in: [rxjs/src/internal/util/rx.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/rx.ts#L5) + +### Parameters + +| Parameter | Type | +| --------- | -------------------------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`A`\> | + +### Returns + +[`Observable`](../classes/Observable.md)\<`A`\> + +## Call Signature + +```ts +function rx<>(source: ObservableInput, fn2: UnaryFunction, B>): B; +``` + +Defined in: [rxjs/src/internal/util/rx.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/rx.ts#L6) + +### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<[`Observable`](../classes/Observable.md)\<`A`\>, `B`\> | + +### Returns + +`B` + +## Call Signature + +```ts +function rx<>(source: ObservableInput, fn2: UnaryFunction, B>, fn3: UnaryFunction): C; +``` + +Defined in: [rxjs/src/internal/util/rx.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/rx.ts#L7) + +### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<[`Observable`](../classes/Observable.md)\<`A`\>, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | + +### Returns + +`C` + +## Call Signature + +```ts +function rx<>(source: ObservableInput, fn2: UnaryFunction, B>, fn3: UnaryFunction, fn4: UnaryFunction): D; +``` + +Defined in: [rxjs/src/internal/util/rx.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/rx.ts#L8) + +### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<[`Observable`](../classes/Observable.md)\<`A`\>, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | +| `fn4` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`C`, `D`\> | + +### Returns + +`D` + +## Call Signature + +```ts +function rx<>( + source: ObservableInput, + fn2: UnaryFunction, B>, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction +): E; +``` + +Defined in: [rxjs/src/internal/util/rx.ts:14](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/rx.ts#L14) + +### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<[`Observable`](../classes/Observable.md)\<`A`\>, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | +| `fn4` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`C`, `D`\> | +| `fn5` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`D`, `E`\> | + +### Returns + +`E` + +## Call Signature + +```ts +function rx<>( + source: ObservableInput, + fn2: UnaryFunction, B>, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction +): F; +``` + +Defined in: [rxjs/src/internal/util/rx.ts:21](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/rx.ts#L21) + +### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<[`Observable`](../classes/Observable.md)\<`A`\>, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | +| `fn4` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`C`, `D`\> | +| `fn5` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`D`, `E`\> | +| `fn6` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`E`, `F`\> | + +### Returns + +`F` + +## Call Signature + +```ts +function rx<>( + source: ObservableInput, + fn2: UnaryFunction, B>, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction, + fn7: UnaryFunction +): G; +``` + +Defined in: [rxjs/src/internal/util/rx.ts:29](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/rx.ts#L29) + +### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<[`Observable`](../classes/Observable.md)\<`A`\>, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | +| `fn4` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`C`, `D`\> | +| `fn5` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`D`, `E`\> | +| `fn6` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`E`, `F`\> | +| `fn7` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`F`, `G`\> | + +### Returns + +`G` + +## Call Signature + +```ts +function rx<>( + source: ObservableInput, + fn2: UnaryFunction, B>, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction, + fn7: UnaryFunction, + fn8: UnaryFunction +): H; +``` + +Defined in: [rxjs/src/internal/util/rx.ts:38](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/rx.ts#L38) + +### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<[`Observable`](../classes/Observable.md)\<`A`\>, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | +| `fn4` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`C`, `D`\> | +| `fn5` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`D`, `E`\> | +| `fn6` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`E`, `F`\> | +| `fn7` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`F`, `G`\> | +| `fn8` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`G`, `H`\> | + +### Returns + +`H` + +## Call Signature + +```ts +function rx<>( + source: ObservableInput, + fn2: UnaryFunction, B>, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction, + fn7: UnaryFunction, + fn8: UnaryFunction, + fn9: UnaryFunction +): I; +``` + +Defined in: [rxjs/src/internal/util/rx.ts:48](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/rx.ts#L48) + +### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<[`Observable`](../classes/Observable.md)\<`A`\>, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | +| `fn4` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`C`, `D`\> | +| `fn5` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`D`, `E`\> | +| `fn6` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`E`, `F`\> | +| `fn7` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`F`, `G`\> | +| `fn8` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`G`, `H`\> | +| `fn9` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`H`, `I`\> | + +### Returns + +`I` + +## Call Signature + +```ts +function rx<>( + source: ObservableInput, + fn2: UnaryFunction, B>, + fn3: UnaryFunction, + fn4: UnaryFunction, + fn5: UnaryFunction, + fn6: UnaryFunction, + fn7: UnaryFunction, + fn8: UnaryFunction, + fn9: UnaryFunction, + ...fns: UnaryFunction[] +): unknown; +``` + +Defined in: [rxjs/src/internal/util/rx.ts:59](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/util/rx.ts#L59) + +### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------------------------------- | +| `source` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`A`\> | +| `fn2` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<[`Observable`](../classes/Observable.md)\<`A`\>, `B`\> | +| `fn3` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`B`, `C`\> | +| `fn4` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`C`, `D`\> | +| `fn5` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`D`, `E`\> | +| `fn6` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`E`, `F`\> | +| `fn7` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`F`, `G`\> | +| `fn8` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`G`, `H`\> | +| `fn9` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`H`, `I`\> | +| ...`fns` | [`UnaryFunction`](../interfaces/UnaryFunction.md)\<`unknown`, `unknown`\>[] | + +### Returns + +`unknown` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/sample.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/sample.md new file mode 100644 index 0000000000..ddb7193ece --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/sample.md @@ -0,0 +1,58 @@ +[API](../../index.md) / [rxjs](../index.md) / sample + +# Function: sample() + +```ts +function sample<>(notifier: ObservableInput): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/sample.ts:45](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/sample.ts#L45) + +Emits the most recently emitted value from the source Observable whenever +another Observable, the `notifier`, emits. + +It's like [sampleTime](sampleTime.md), but samples whenever +the `notifier` `ObservableInput` emits something. + +![](/images/marble-diagrams/sample.png) + +Whenever the `notifier` `ObservableInput` emits a value, `sample` +looks at the source Observable and emits whichever value it has most recently +emitted since the previous sampling, unless the source has not emitted +anything since the previous sampling. The `notifier` is subscribed to as soon +as the output Observable is subscribed. + +## Parameters + +| Parameter | Type | Description | +| ---------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `notifier` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | The `ObservableInput` to use for sampling the source Observable. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that emits the results of +sampling the values emitted by the source Observable whenever the notifier +Observable emits value or completes. + +## Example + +On every click, sample the most recent `seconds` timer + +```ts +import { fromEvent, interval, sample } from 'rxjs'; + +const seconds = interval(1000); +const clicks = fromEvent(document, 'click'); +const result = seconds.pipe(sample(clicks)); + +result.subscribe((x) => console.log(x)); +``` + +## See + +- [audit](audit.md) +- [debounce](debounce.md) +- [sampleTime](sampleTime.md) +- [throttle](throttle.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/sampleTime.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/sampleTime.md new file mode 100644 index 0000000000..78ebbc36f3 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/sampleTime.md @@ -0,0 +1,60 @@ +[API](../../index.md) / [rxjs](../index.md) / sampleTime + +# Function: sampleTime() + +```ts +function sampleTime<>(period: number, scheduler: SchedulerLike): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/sampleTime.ts:49](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/sampleTime.ts#L49) + +Emits the most recently emitted value from the source Observable within +periodic time intervals. + +Samples the source Observable at periodic time +intervals, emitting what it samples. + +![](/images/marble-diagrams/sampleTime.png) + +`sampleTime` periodically looks at the source Observable and emits whichever +value it has most recently emitted since the previous sampling, unless the +source has not emitted anything since the previous sampling. The sampling +happens periodically in time every `period` milliseconds (or the time unit +defined by the optional `scheduler` argument). The sampling starts as soon as +the output Observable is subscribed. + +## Parameters + +| Parameter | Type | Default value | Description | +| ----------- | ------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------- | +| `period` | `number` | `undefined` | The sampling period expressed in milliseconds or the time unit determined internally by the optional `scheduler`. | +| `scheduler` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | `asyncScheduler` | The [SchedulerLike](../interfaces/SchedulerLike.md) to use for managing the timers that handle the sampling. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that emits the results of +sampling the values emitted by the source Observable at the specified time +interval. + +## Example + +Every second, emit the most recent click at most once + +```ts +import { fromEvent, sampleTime } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(sampleTime(1000)); + +result.subscribe((x) => console.log(x)); +``` + +## See + +- [auditTime](auditTime.md) +- [debounceTime](debounceTime.md) +- [delay](delay.md) +- [sample](sample.md) +- [throttleTime](throttleTime.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/scan.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/scan.md new file mode 100644 index 0000000000..9c27091951 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/scan.md @@ -0,0 +1,157 @@ +[API](../../index.md) / [rxjs](../index.md) / scan + +# Function: scan() + +> Useful for encapsulating and managing state. Applies an accumulator (or "reducer function") +> to each value from the source after an initial state is established -- either via +> a `seed` value (second argument), or from the first value from the source. + +## Description + +It's like [reduce](reduce.md), but emits the current +accumulation state after each update + +![](/images/marble-diagrams/scan.png) + +This operator maintains an internal state and emits it after processing each value as follows: + +1. First value arrives + +- If a `seed` value was supplied (as the second argument to `scan`), let `state = seed` and `value = firstValue`. +- If NO `seed` value was supplied (no second argument), let `state = firstValue` and go to 3. + +2. Let `state = accumulator(state, value)`. + +- If an error is thrown by `accumulator`, notify the consumer of an error. The process ends. + +3. Emit `state`. +4. Next value arrives, let `value = nextValue`, go to 2. + +## Example + +An average of previous numbers. This example shows how +not providing a `seed` can prime the stream with the +first value from the source. + +```ts +import { of, scan, map } from 'rxjs'; + +const numbers$ = of(1, 2, 3); + +numbers$ + .pipe( + // Get the sum of the numbers coming in. + scan((total, n) => total + n), + // Get the average by dividing the sum by the total number + // received so far (which is 1 more than the zero-based index). + map((sum, index) => sum / (index + 1)) + ) + .subscribe(console.log); +``` + +The Fibonacci sequence. This example shows how you can use +a seed to prime accumulation process. Also... you know... Fibonacci. +So important to like, computers and stuff that its whiteboarded +in job interviews. Now you can show them the Rx version! (Please don't, haha) + +```ts +import { interval, scan, map, startWith } from 'rxjs'; + +const firstTwoFibs = [0, 1]; +// An endless stream of Fibonacci numbers. +const fibonacci$ = interval(1000).pipe( + // Scan to get the fibonacci numbers (after 0, 1) + scan(([a, b]) => [b, a + b], firstTwoFibs), + // Get the second number in the tuple, it's the one you calculated + map(([, n]) => n), + // Start with our first two digits :) + startWith(...firstTwoFibs) +); + +fibonacci$.subscribe(console.log); +``` + +## See + +- [expand](expand.md) +- [mergeScan](mergeScan.md) +- [reduce](reduce.md) +- [switchScan](switchScan.md) + +acquired. + +be used as the initial state, and emitted without going through the accumulator. All subsequent values +will be processed by the accumulator function. If this is provided, all values will go through +the accumulator function. + +## Parameters + +### `accumulator` + +A "reducer function". This will be called for each value after an initial state is + +### `seed` + +The initial state. If this is not provided, the first value from the source will + +## Returns + +`A` + +function that returns an Observable of the accumulated values. + +## Call Signature + +```ts +function scan<>(accumulator: (acc: V | A, value: V, index: number) => A): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/scan.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/scan.ts#L5) + +### Parameters + +| Parameter | Type | +| ------------- | ----------------------------------------------------------- | +| `accumulator` | (`acc`: `V` \| `A`, `value`: `V`, `index`: `number`) => `A` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`V`, `V` \| `A`\> + +## Call Signature + +```ts +function scan<>(accumulator: (acc: A, value: V, index: number) => A, seed: A): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/scan.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/scan.ts#L6) + +### Parameters + +| Parameter | Type | +| ------------- | ---------------------------------------------------- | +| `accumulator` | (`acc`: `A`, `value`: `V`, `index`: `number`) => `A` | +| `seed` | `A` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`V`, `A`\> + +## Call Signature + +```ts +function scan<>(accumulator: (acc: A | S, value: V, index: number) => A, seed: S): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/scan.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/scan.ts#L7) + +### Parameters + +| Parameter | Type | +| ------------- | ----------------------------------------------------------- | +| `accumulator` | (`acc`: `A` \| `S`, `value`: `V`, `index`: `number`) => `A` | +| `seed` | `S` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`V`, `A`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/scheduled.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/scheduled.md new file mode 100644 index 0000000000..dfcd07c423 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/scheduled.md @@ -0,0 +1,28 @@ +[API](../../index.md) / [rxjs](../index.md) / scheduled + +# Function: scheduled() + +```ts +function scheduled<>(input: ObservableInput, scheduler: SchedulerLike): Observable; +``` + +Defined in: [rxjs/src/internal/scheduled/scheduled.ts:22](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/scheduled/scheduled.ts#L22) + +Converts from a common [ObservableInput](../type-aliases/ObservableInput.md) type to an observable where subscription and emissions +are scheduled on the provided scheduler. + +## Parameters + +| Parameter | Type | Description | +| ----------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `input` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`T`\> | The observable, array, promise, iterable, etc you would like to schedule | +| `scheduler` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | The scheduler to use to schedule the subscription and emissions from the returned observable. | + +## Returns + +[`Observable`](../classes/Observable.md)\<`T`\> + +## See + +- [from](from.md) +- [of](of.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/sequenceEqual.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/sequenceEqual.md new file mode 100644 index 0000000000..7b9bf0aa74 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/sequenceEqual.md @@ -0,0 +1,75 @@ +[API](../../index.md) / [rxjs](../index.md) / sequenceEqual + +# Function: sequenceEqual() + +```ts +function sequenceEqual<>(compareTo: ObservableInput, comparator: (a: T, b: T) => boolean): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/sequenceEqual.ts:61](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/sequenceEqual.ts#L61) + +Compares all values of two observables in sequence using an optional comparator function +and returns an observable of a single boolean value representing whether or not the two sequences +are equal. + +Checks to see of all values emitted by both observables are equal, in order. + +![](/images/marble-diagrams/sequenceEqual.png) + +`sequenceEqual` subscribes to source observable and `compareTo` `ObservableInput` (that internally +gets converted to an observable) and buffers incoming values from each observable. Whenever either +observable emits a value, the value is buffered and the buffers are shifted and compared from the bottom +up; If any value pair doesn't match, the returned observable will emit `false` and complete. If one of the +observables completes, the operator will wait for the other observable to complete; If the other +observable emits before completing, the returned observable will emit `false` and complete. If one observable never +completes or emits after the other completes, the returned observable will never complete. + +## Parameters + +| Parameter | Type | Description | +| ------------ | -------------------------------------------------------------- | ----------------------------------------------------------------- | +| `compareTo` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`T`\> | The `ObservableInput` sequence to compare the source sequence to. | +| `comparator` | (`a`: `T`, `b`: `T`) => `boolean` | An optional function to compare each value pair. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `boolean`\> + +A function that returns an Observable that emits a single boolean +value representing whether or not the values emitted by the source +Observable and provided `ObservableInput` were equal in sequence. + +## Example + +Figure out if the Konami code matches + +```ts +import { from, fromEvent, map, bufferCount, mergeMap, sequenceEqual } from 'rxjs'; + +const codes = from([ + 'ArrowUp', + 'ArrowUp', + 'ArrowDown', + 'ArrowDown', + 'ArrowLeft', + 'ArrowRight', + 'ArrowLeft', + 'ArrowRight', + 'KeyB', + 'KeyA', + 'Enter', // no start key, clearly. +]); + +const keys = fromEvent(document, 'keyup').pipe(map((e) => e.code)); +const matches = keys.pipe( + bufferCount(11, 1), + mergeMap((last11) => from(last11).pipe(sequenceEqual(codes))) +); +matches.subscribe((matched) => console.log('Successful cheat at Contra? ', matched)); +``` + +## See + +- [combineLatest](combineLatest.md) +- [zip](zip.md) +- [withLatestFrom](withLatestFrom.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/share.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/share.md new file mode 100644 index 0000000000..60a775a366 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/share.md @@ -0,0 +1,127 @@ +[API](../../index.md) / [rxjs](../index.md) / share + +# Function: share() + +> Returns a new Observable that multicasts (shares) the original Observable. As long as there is at least one +> Subscriber this Observable will be subscribed and emitting data. When all subscribers have unsubscribed it will +> unsubscribe from the source Observable. Because the Observable is multicasting it makes the stream `hot`. + +## Description + +The subscription to the underlying source Observable can be reset (unsubscribe and resubscribe for new subscribers), +if the subscriber count to the shared observable drops to 0, or if the source Observable errors or completes. It is +possible to use notifier factories for the resets to allow for behaviors like conditional or delayed resets. Please +note that resetting on error or complete of the source Observable does not behave like a transparent retry or restart +of the source because the error or complete will be forwarded to all subscribers and their subscription will be +closed. Only new subscribers after a reset on error or complete happened will cause a fresh subscription to the +source. To achieve transparent retries or restarts pipe the source through appropriate operators before sharing. + +![](/images/marble-diagrams/share.png) + +## Examples + +Generate new multicast Observable from the `source` Observable value + +```ts +import { interval, tap, map, take, share } from 'rxjs'; + +const source = interval(1000).pipe( + tap((x) => console.log('Processing: ', x)), + map((x) => x * x), + take(6), + share() +); + +source.subscribe((x) => console.log('subscription 1: ', x)); +source.subscribe((x) => console.log('subscription 2: ', x)); + +// Logs: +// Processing: 0 +// subscription 1: 0 +// subscription 2: 0 +// Processing: 1 +// subscription 1: 1 +// subscription 2: 1 +// Processing: 2 +// subscription 1: 4 +// subscription 2: 4 +// Processing: 3 +// subscription 1: 9 +// subscription 2: 9 +// Processing: 4 +// subscription 1: 16 +// subscription 2: 16 +// Processing: 5 +// subscription 1: 25 +// subscription 2: 25 +``` + +```ts +import { interval, take, share, timer } from 'rxjs'; + +const source = interval(1000).pipe( + take(3), + share({ + resetOnRefCountZero: () => timer(1000), + }) +); + +const subscriptionOne = source.subscribe((x) => console.log('subscription 1: ', x)); +setTimeout(() => subscriptionOne.unsubscribe(), 1300); + +setTimeout(() => source.subscribe((x) => console.log('subscription 2: ', x)), 1700); + +setTimeout(() => source.subscribe((x) => console.log('subscription 3: ', x)), 5000); + +// Logs: +// subscription 1: 0 +// (subscription 1 unsubscribes here) +// (subscription 2 subscribes here ~400ms later, source was not reset) +// subscription 2: 1 +// subscription 2: 2 +// (subscription 2 unsubscribes here) +// (subscription 3 subscribes here ~2000ms later, source did reset before) +// subscription 3: 0 +// subscription 3: 1 +// subscription 3: 2 +``` + +## See + +[shareReplay](shareReplay.md) + +## Returns + +`A` + +function that returns an Observable that mirrors the source. + +## Call Signature + +```ts +function share<>(): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/share.ts:46](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/share.ts#L46) + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +## Call Signature + +```ts +function share<>(options: ShareConfig): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/share.ts:48](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/share.ts#L48) + +### Parameters + +| Parameter | Type | +| --------- | ---------------------------------------------------- | +| `options` | [`ShareConfig`](../interfaces/ShareConfig.md)\<`T`\> | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/shareReplay.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/shareReplay.md new file mode 100644 index 0000000000..a808610b90 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/shareReplay.md @@ -0,0 +1,193 @@ +[API](../../index.md) / [rxjs](../index.md) / shareReplay + +# Function: shareReplay() + +> Share source and replay specified number of emissions on subscription. + +## Description + +This operator is a specialization of `replay` that connects to a source observable +and multicasts through a `ReplaySubject` constructed with the specified arguments. +A successfully completed source will stay cached in the `shareReplay`ed observable forever, +but an errored source can be retried. + +## Why use `shareReplay`? + +You generally want to use `shareReplay` when you have side-effects or taxing computations +that you do not wish to be executed amongst multiple subscribers. +It may also be valuable in situations where you know you will have late subscribers to +a stream that need access to previously emitted values. +This ability to replay values on subscription is what differentiates [share](share.md) and `shareReplay`. + +## Reference counting + +By default `shareReplay` will use `refCount` of false, meaning that it will _not_ unsubscribe the +source when the reference counter drops to zero, i.e. the inner `ReplaySubject` will _not_ be unsubscribed +(and potentially run for ever). +This is the default as it is expected that `shareReplay` is often used to keep around expensive to setup +observables which we want to keep running instead of having to do the expensive setup again. + +As of RXJS version 6.4.0 a new overload signature was added to allow for manual control over what +happens when the operators internal reference counter drops to zero. +If `refCount` is true, the source will be unsubscribed from once the reference count drops to zero, i.e. +the inner `ReplaySubject` will be unsubscribed. All new subscribers will receive value emissions from a +new `ReplaySubject` which in turn will cause a new subscription to the source observable. + +## Example + +Example with a third subscriber coming late to the party + +```ts +import { interval, take, shareReplay } from 'rxjs'; + +const shared$ = interval(2000).pipe(take(6), shareReplay(3)); + +shared$.subscribe((x) => console.log('sub A: ', x)); +shared$.subscribe((y) => console.log('sub B: ', y)); + +setTimeout(() => { + shared$.subscribe((y) => console.log('sub C: ', y)); +}, 11000); + +// Logs: +// (after ~2000 ms) +// sub A: 0 +// sub B: 0 +// (after ~4000 ms) +// sub A: 1 +// sub B: 1 +// (after ~6000 ms) +// sub A: 2 +// sub B: 2 +// (after ~8000 ms) +// sub A: 3 +// sub B: 3 +// (after ~10000 ms) +// sub A: 4 +// sub B: 4 +// (after ~11000 ms, sub C gets the last 3 values) +// sub C: 2 +// sub C: 3 +// sub C: 4 +// (after ~12000 ms) +// sub A: 5 +// sub B: 5 +// sub C: 5 +``` + +Example for `refCount` usage + +```ts +import { Observable, tap, interval, shareReplay, take } from 'rxjs'; + +const log = (name: string, source: Observable) => + source.pipe( + tap({ + subscribe: () => console.log(`${name}: subscribed`), + next: (value) => console.log(`${name}: ${value}`), + complete: () => console.log(`${name}: completed`), + finalize: () => console.log(`${name}: unsubscribed`), + }) + ); + +const obs$ = log('source', interval(1000)); + +const shared$ = log('shared', obs$.pipe(shareReplay({ bufferSize: 1, refCount: true }), take(2))); + +shared$.subscribe((x) => console.log('sub A: ', x)); +shared$.subscribe((y) => console.log('sub B: ', y)); + +// PRINTS: +// shared: subscribed <-- reference count = 1 +// source: subscribed +// shared: subscribed <-- reference count = 2 +// source: 0 +// shared: 0 +// sub A: 0 +// shared: 0 +// sub B: 0 +// source: 1 +// shared: 1 +// sub A: 1 +// shared: completed <-- take(2) completes the subscription for sub A +// shared: unsubscribed <-- reference count = 1 +// shared: 1 +// sub B: 1 +// shared: completed <-- take(2) completes the subscription for sub B +// shared: unsubscribed <-- reference count = 0 +// source: unsubscribed <-- replaySubject unsubscribes from source observable because the reference count dropped to 0 and refCount is true + +// In case of refCount being false, the unsubscribe is never called on the source and the source would keep on emitting, even if no subscribers +// are listening. +// source: 2 +// source: 3 +// source: 4 +// ... +``` + +## See + +- [connectable](connectable.md) +- [share](share.md) + +object. + +will be invoked on. + +## Parameters + +### `configOrBufferSize` + +Maximum element count of the replay buffer or [configuration](../interfaces/ShareReplayConfig.md) + +### `windowTime` + +Maximum time length of the replay buffer in milliseconds. + +### `scheduler` + +Scheduler where connected observers within the selector function + +## Returns + +`A` + +function that returns an Observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. + +## Call Signature + +```ts +function shareReplay<>(config: ShareReplayConfig): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/shareReplay.ts:12](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/shareReplay.ts#L12) + +### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------- | +| `config` | [`ShareReplayConfig`](../interfaces/ShareReplayConfig.md) | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +## Call Signature + +```ts +function shareReplay<>(bufferSize?: number, windowTime?: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/shareReplay.ts:13](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/shareReplay.ts#L13) + +### Parameters + +| Parameter | Type | +| ------------- | ------------------------------------------------- | +| `bufferSize?` | `number` | +| `windowTime?` | `number` | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/single.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/single.md new file mode 100644 index 0000000000..e9980b382c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/single.md @@ -0,0 +1,116 @@ +[API](../../index.md) / [rxjs](../index.md) / single + +# Function: single() + +> Returns an observable that asserts that only one value is +> emitted from the observable that matches the predicate. If no +> predicate is provided, then it will assert that the observable +> only emits one value. + +## Description + +If the source Observable did not emit `next` before completion, it +will emit an [EmptyError](../classes/EmptyError.md) to the Observer's `error` callback. + +In the event that two values are found that match the predicate, +or when there are two values emitted and no predicate, it will +emit a [SequenceError](../classes/SequenceError.md) to the Observer's `error` callback. + +In the event that no values match the predicate, if one is provided, +it will emit a [NotFoundError](../classes/NotFoundError.md) to the Observer's `error` callback. + +## Example + +Expect only `name` beginning with `'B'` + +```ts +import { of, single } from 'rxjs'; + +const source1 = of({ name: 'Ben' }, { name: 'Tracy' }, { name: 'Laney' }, { name: 'Lily' }); + +source1.pipe(single((x) => x.name.startsWith('B'))).subscribe((x) => console.log(x)); +// Emits 'Ben' + +const source2 = of({ name: 'Ben' }, { name: 'Tracy' }, { name: 'Bradley' }, { name: 'Lincoln' }); + +source2.pipe(single((x) => x.name.startsWith('B'))).subscribe({ error: (err) => console.error(err) }); +// Error emitted: SequenceError('Too many values match') + +const source3 = of({ name: 'Laney' }, { name: 'Tracy' }, { name: 'Lily' }, { name: 'Lincoln' }); + +source3.pipe(single((x) => x.name.startsWith('B'))).subscribe({ error: (err) => console.error(err) }); +// Error emitted: NotFoundError('No values match') +``` + +## See + +- [first](first.md) +- [find](find.md) +- [findIndex](findIndex.md) +- [elementAt](elementAt.md) + +## Throws + +Delivers a `NotFoundError` to the Observer's `error` +callback if the Observable completes before any `next` notification was sent. + +## Throws + +Delivers a `SequenceError` if more than one value is +emitted that matches the provided predicate. If no predicate is provided, it +will deliver a `SequenceError` if more than one value comes from the source. + +## Throws + +Delivers an `EmptyError` if no values were `next`ed prior +to completion. + +Observable. + +## Parameters + +### `predicate` + +A predicate function to evaluate items emitted by the source + +## Returns + +`A` + +function that returns an Observable that emits the single item emitted by the source Observable that matches the predicate. + +## Call Signature + +```ts +function single<>(predicate: BooleanConstructor): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/single.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/single.ts#L8) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------- | +| `predicate` | `BooleanConstructor` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`TruthyTypesOf`](../type-aliases/TruthyTypesOf.md)\<`T`\>\> + +## Call Signature + +```ts +function single<>(predicate?: (value: T, index: number, source: Observable) => boolean): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/single.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/single.ts#L9) + +### Parameters + +| Parameter | Type | +| ------------ | --------------------------------------------------------------------------------------------------------- | +| `predicate?` | (`value`: `T`, `index`: `number`, `source`: [`Observable`](../classes/Observable.md)\<`T`\>) => `boolean` | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/skip.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/skip.md new file mode 100644 index 0000000000..59e52722db --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/skip.md @@ -0,0 +1,52 @@ +[API](../../index.md) / [rxjs](../index.md) / skip + +# Function: skip() + +```ts +function skip<>(count: number): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/skip.ts:37](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/skip.ts#L37) + +Returns an Observable that skips the first `count` items emitted by the source Observable. + +![](/images/marble-diagrams/skip.png) + +Skips the values until the sent notifications are equal or less than provided skip count. It raises +an error if skip count is equal or more than the actual number of emits and source raises an error. + +## Parameters + +| Parameter | Type | Description | +| --------- | -------- | -------------------------------------------------------------------------- | +| `count` | `number` | The number of times, items emitted by source Observable should be skipped. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that skips the first `count` +values emitted by the source Observable. + +## Example + +Skip the values before the emission + +```ts +import { interval, skip } from 'rxjs'; + +// emit every half second +const source = interval(500); +// skip the first 10 emitted values +const result = source.pipe(skip(10)); + +result.subscribe((value) => console.log(value)); +// output: 10...11...12...13... +``` + +## See + +- [last](last.md) +- [skipWhile](skipWhile.md) +- [skipUntil](skipUntil.md) +- [skipLast](skipLast.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/skipLast.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/skipLast.md new file mode 100644 index 0000000000..71f33b1631 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/skipLast.md @@ -0,0 +1,61 @@ +[API](../../index.md) / [rxjs](../index.md) / skipLast + +# Function: skipLast() + +```ts +function skipLast<>(skipCount: number): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/skipLast.ts:47](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/skipLast.ts#L47) + +Skip a specified number of values before the completion of an observable. + +![](/images/marble-diagrams/skipLast.png) + +Returns an observable that will emit values as soon as it can, given a number of +skipped values. For example, if you `skipLast(3)` on a source, when the source +emits its fourth value, the first value the source emitted will finally be emitted +from the returned observable, as it is no longer part of what needs to be skipped. + +All values emitted by the result of `skipLast(N)` will be delayed by `N` emissions, +as each value is held in a buffer until enough values have been emitted that that +the buffered value may finally be sent to the consumer. + +After subscribing, unsubscribing will not result in the emission of the buffered +skipped values. + +## Parameters + +| Parameter | Type | Description | +| ----------- | -------- | ----------------------------------------------------------------- | +| `skipCount` | `number` | Number of elements to skip from the end of the source Observable. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that skips the last `count` +values emitted by the source Observable. + +## Example + +Skip the last 2 values of an observable with many values + +```ts +import { of, skipLast } from 'rxjs'; + +const numbers = of(1, 2, 3, 4, 5); +const skipLastTwo = numbers.pipe(skipLast(2)); +skipLastTwo.subscribe((x) => console.log(x)); + +// Results in: +// 1 2 3 +// (4 and 5 are skipped) +``` + +## See + +- [skip](skip.md) +- [skipUntil](skipUntil.md) +- [skipWhile](skipWhile.md) +- [take](take.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/skipUntil.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/skipUntil.md new file mode 100644 index 0000000000..734f661c37 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/skipUntil.md @@ -0,0 +1,61 @@ +[API](../../index.md) / [rxjs](../index.md) / skipUntil + +# Function: skipUntil() + +```ts +function skipUntil<>(notifier: ObservableInput): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/skipUntil.ts:50](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/skipUntil.ts#L50) + +Returns an Observable that skips items emitted by the source Observable until a second Observable emits an item. + +The `skipUntil` operator causes the observable stream to skip the emission of values until the passed in observable +emits the first value. This can be particularly useful in combination with user interactions, responses of HTTP +requests or waiting for specific times to pass by. + +![](/images/marble-diagrams/skipUntil.png) + +Internally, the `skipUntil` operator subscribes to the passed in `notifier` `ObservableInput` (which gets converted +to an Observable) in order to recognize the emission of its first value. When `notifier` emits next, the operator +unsubscribes from it and starts emitting the values of the _source_ observable until it completes or errors. It +will never let the _source_ observable emit any values if the `notifier` completes or throws an error without +emitting a value before. + +## Parameters + +| Parameter | Type | Description | +| ---------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `notifier` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | An `ObservableInput` that has to emit an item before the source Observable elements begin to be mirrored by the resulting Observable. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that skips items from the +source Observable until the `notifier` Observable emits an item, then emits the +remaining items. + +## Example + +In the following example, all emitted values of the interval observable are skipped until the user clicks anywhere +within the page + +```ts +import { interval, fromEvent, skipUntil } from 'rxjs'; + +const intervalObservable = interval(1000); +const click = fromEvent(document, 'click'); + +const emitAfterClick = intervalObservable.pipe(skipUntil(click)); +// clicked at 4.6s. output: 5...6...7...8........ or +// clicked at 7.3s. output: 8...9...10..11....... +emitAfterClick.subscribe((value) => console.log(value)); +``` + +## See + +- [last](last.md) +- [skip](skip.md) +- [skipWhile](skipWhile.md) +- [skipLast](skipLast.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/skipWhile.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/skipWhile.md new file mode 100644 index 0000000000..15e0a2d4d8 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/skipWhile.md @@ -0,0 +1,111 @@ +[API](../../index.md) / [rxjs](../index.md) / skipWhile + +# Function: skipWhile() + +> Returns an Observable that skips all items emitted by the source Observable as long as a specified condition holds +> true, but emits all further source items as soon as the condition becomes false. + +## Description + +![](/images/marble-diagrams/skipWhile.png) + +Skips all the notifications with a truthy predicate. It will not skip the notifications when the predicate is falsy. +It can also be skipped using index. Once the predicate is true, it will not be called again. + +## Example + +Skip some super heroes + +```ts +import { from, skipWhile } from 'rxjs'; + +const source = from(['Green Arrow', 'SuperMan', 'Flash', 'SuperGirl', 'Black Canary']); +// Skip the heroes until SuperGirl +const example = source.pipe(skipWhile((hero) => hero !== 'SuperGirl')); +// output: SuperGirl, Black Canary +example.subscribe((femaleHero) => console.log(femaleHero)); +``` + +Skip values from the array until index 5 + +```ts +import { from, skipWhile } from 'rxjs'; + +const source = from([1, 2, 3, 4, 5, 6, 7, 9, 10]); +const example = source.pipe(skipWhile((_, i) => i !== 5)); +// output: 6, 7, 9, 10 +example.subscribe((value) => console.log(value)); +``` + +## See + +- [last](last.md) +- [skip](skip.md) +- [skipUntil](skipUntil.md) +- [skipLast](skipLast.md) + +## Parameters + +### `predicate` + +A function to test each item emitted from the source Observable. + +## Returns + +`A` + +function that returns an Observable that begins emitting items emitted by the source Observable when the specified predicate becomes false. + +## Call Signature + +```ts +function skipWhile<>(predicate: BooleanConstructor): OperatorFunction extends never ? never : T>; +``` + +Defined in: [rxjs/src/internal/operators/skipWhile.ts:4](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/skipWhile.ts#L4) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------- | +| `predicate` | `BooleanConstructor` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `Extract`\<`T`, [`Falsy`](../type-aliases/Falsy.md)\> _extends_ `never` ? `never` : `T`\> + +## Call Signature + +```ts +function skipWhile<>(predicate: (value: T, index: number) => true): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/skipWhile.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/skipWhile.ts#L5) + +### Parameters + +| Parameter | Type | +| ----------- | ------------------------------------------- | +| `predicate` | (`value`: `T`, `index`: `number`) => `true` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `never`\> + +## Call Signature + +```ts +function skipWhile<>(predicate: (value: T, index: number) => boolean): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/skipWhile.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/skipWhile.ts#L6) + +### Parameters + +| Parameter | Type | +| ----------- | ---------------------------------------------- | +| `predicate` | (`value`: `T`, `index`: `number`) => `boolean` | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/startWith.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/startWith.md new file mode 100644 index 0000000000..9ac3b0e2e1 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/startWith.md @@ -0,0 +1,107 @@ +[API](../../index.md) / [rxjs](../index.md) / startWith + +# Function: startWith() + +> Returns an observable that, at the moment of subscription, will synchronously emit all +> values provided to this operator, then subscribe to the source and mirror all of its emissions +> to subscribers. + +## Description + +This is a useful way to know when subscription has occurred on an existing observable. + +First emits its arguments in order, and then any +emissions from the source. + +![](/images/marble-diagrams/startWith.png) + +## Example + +Emit a value when a timer starts. + +```ts +import { timer, map, startWith } from 'rxjs'; + +timer(1000) + .pipe( + map(() => 'timer emit'), + startWith('timer start') + ) + .subscribe((x) => console.log(x)); + +// results: +// 'timer start' +// 'timer emit' +``` + +## See + +- [endWith](endWith.md) +- [finalize](finalize.md) +- [concat](concat.md) + +## Parameters + +### `values` + +Items you want the modified Observable to emit first. + +## Returns + +`A` + +function that returns an Observable that synchronously emits provided values before subscribing to the source Observable. + +## Call Signature + +```ts +function startWith<>(value: null): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/startWith.ts:4](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/startWith.ts#L4) + +### Parameters + +| Parameter | Type | +| --------- | ------ | +| `value` | `null` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `null`\> + +## Call Signature + +```ts +function startWith<>(value: undefined): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/startWith.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/startWith.ts#L5) + +### Parameters + +| Parameter | Type | +| --------- | ----------- | +| `value` | `undefined` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `undefined`\> + +## Call Signature + +```ts +function startWith<>(...values: A): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/startWith.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/startWith.ts#L6) + +### Parameters + +| Parameter | Type | +| ----------- | ---- | +| ...`values` | `A` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| [`ValueFromArray`](../type-aliases/ValueFromArray.md)\<`A`\>\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/subscribeOn.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/subscribeOn.md new file mode 100644 index 0000000000..dba56cb91c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/subscribeOn.md @@ -0,0 +1,76 @@ +[API](../../index.md) / [rxjs](../index.md) / subscribeOn + +# Function: subscribeOn() + +```ts +function subscribeOn<>(scheduler: SchedulerLike, delay: number): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/subscribeOn.ts:63](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/subscribeOn.ts#L63) + +Asynchronously subscribes Observers to this Observable on the specified [SchedulerLike](../interfaces/SchedulerLike.md). + +With `subscribeOn` you can decide what type of scheduler a specific Observable will be using when it is subscribed to. + +Schedulers control the speed and order of emissions to observers from an Observable stream. + +![](/images/marble-diagrams/subscribeOn.png) + +## Parameters + +| Parameter | Type | Default value | Description | +| ----------- | ------------------------------------------------- | ------------- | --------------------------------------------------------------------------------------- | +| `scheduler` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | `undefined` | The [SchedulerLike](../interfaces/SchedulerLike.md) to perform subscription actions on. | +| `delay` | `number` | `0` | A delay to pass to the scheduler to delay subscriptions | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable modified so that its +subscriptions happen on the specified [SchedulerLike](../interfaces/SchedulerLike.md). + +## Example + +Given the following code: + +```ts +import { of, merge } from 'rxjs'; + +const a = of(1, 2, 3); +const b = of(4, 5, 6); + +merge(a, b).subscribe(console.log); + +// Outputs +// 1 +// 2 +// 3 +// 4 +// 5 +// 6 +``` + +Both Observable `a` and `b` will emit their values directly and synchronously once they are subscribed to. + +If we instead use the `subscribeOn` operator declaring that we want to use the [asyncScheduler](../variables/asyncScheduler.md) for values emitted by Observable `a`: + +```ts +import { of, subscribeOn, asyncScheduler, merge } from 'rxjs'; + +const a = of(1, 2, 3).pipe(subscribeOn(asyncScheduler)); +const b = of(4, 5, 6); + +merge(a, b).subscribe(console.log); + +// Outputs +// 4 +// 5 +// 6 +// 1 +// 2 +// 3 +``` + +The reason for this is that Observable `b` emits its values directly and synchronously like before +but the emissions from `a` are scheduled on the event loop because we are now using the [asyncScheduler](../variables/asyncScheduler.md) for that specific Observable. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/switchAll.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/switchAll.md new file mode 100644 index 0000000000..819461a239 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/switchAll.md @@ -0,0 +1,70 @@ +[API](../../index.md) / [rxjs](../index.md) / switchAll + +# Function: switchAll() + +```ts +function switchAll<>(): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/switchAll.ts:63](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/switchAll.ts#L63) + +Converts a higher-order Observable into a first-order Observable +producing values only from the most recent observable sequence + +Flattens an Observable-of-Observables. + +![](/images/marble-diagrams/switchAll.png) + +`switchAll` subscribes to a source that is an observable of observables, also known as a +"higher-order observable" (or `Observable>`). It subscribes to the most recently +provided "inner observable" emitted by the source, unsubscribing from any previously subscribed +to inner observable, such that only the most recent inner observable may be subscribed to at +any point in time. The resulting observable returned by `switchAll` will only complete if the +source observable completes, _and_ any currently subscribed to inner observable also has completed, +if there are any. + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`O`, [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +A function that returns an Observable that converts a higher-order +Observable into a first-order Observable producing values only from the most +recent Observable sequence. + +## Example + +Spawn a new interval observable for each click event, but for every new +click, cancel the previous interval and subscribe to the new one + +```ts +import { fromEvent, tap, map, interval, switchAll } from 'rxjs'; + +const clicks = fromEvent(document, 'click').pipe(tap(() => console.log('click'))); +const source = clicks.pipe(map(() => interval(1000))); + +source.pipe(switchAll()).subscribe((x) => console.log(x)); + +// Output +// click +// 0 +// 1 +// 2 +// 3 +// ... +// click +// 0 +// 1 +// 2 +// ... +// click +// ... +``` + +## See + +- [combineLatestAll](combineLatestAll.md) +- [concatAll](concatAll.md) +- [exhaustAll](exhaustAll.md) +- [switchMap](switchMap.md) +- [switchMapTo](switchMapTo.md) +- [mergeAll](mergeAll.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/switchMap.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/switchMap.md new file mode 100644 index 0000000000..e003b915a5 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/switchMap.md @@ -0,0 +1,79 @@ +[API](../../index.md) / [rxjs](../index.md) / switchMap + +# Function: switchMap() + +```ts +function switchMap<>(project: (value: T, index: number) => O): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/switchMap.ts:66](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/switchMap.ts#L66) + +Projects each source value to an Observable which is merged in the output +Observable, emitting values only from the most recently projected Observable. + +Maps each value to an Observable, then flattens all of +these inner Observables using [switchAll](switchAll.md). + +![](/images/marble-diagrams/switchMap.png) + +Returns an Observable that emits items based on applying a function that you +supply to each item emitted by the source Observable, where that function +returns an (so-called "inner") Observable. Each time it observes one of these +inner Observables, the output Observable begins emitting the items emitted by +that inner Observable. When a new inner Observable is emitted, `switchMap` +stops emitting items from the earlier-emitted inner Observable and begins +emitting items from the new one. It continues to behave like this for +subsequent inner Observables. + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `project` | (`value`: `T`, `index`: `number`) => `O` | A function that, when applied to an item emitted by the source Observable, returns an Observable. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +A function that returns an Observable that emits the result of +applying the projection function to each item emitted by the source Observable +and taking only the values from the most recently projected inner Observable. + +## Example + +Generate new Observable according to source Observable values + +```ts +import { of, switchMap } from 'rxjs'; + +const switched = of(1, 2, 3).pipe(switchMap((x) => of(x, x ** 2, x ** 3))); +switched.subscribe((x) => console.log(x)); +// outputs +// 1 +// 1 +// 1 +// 2 +// 4 +// 8 +// 3 +// 9 +// 27 +``` + +Restart an interval Observable on every click event + +```ts +import { fromEvent, switchMap, interval } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(switchMap(() => interval(1000))); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [concatMap](concatMap.md) +- [exhaustMap](exhaustMap.md) +- [mergeMap](mergeMap.md) +- [switchAll](switchAll.md) +- [switchMapTo](switchMapTo.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/switchMapTo.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/switchMapTo.md new file mode 100644 index 0000000000..4745be3995 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/switchMapTo.md @@ -0,0 +1,60 @@ +[API](../../index.md) / [rxjs](../index.md) / switchMapTo + +# ~~Function: switchMapTo()~~ + +```ts +function switchMapTo<>(innerObservable: O): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/switchMapTo.ts:43](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/switchMapTo.ts#L43) + +Projects each source value to the same Observable which is flattened multiple +times with [switchMap](switchMap.md) in the output Observable. + +It's like [switchMap](switchMap.md), but maps each value +always to the same inner Observable. + +![](/images/marble-diagrams/switchMapTo.png) + +Maps each source value to the given Observable `innerObservable` regardless +of the source value, and then flattens those resulting Observables into one +single Observable, which is the output Observable. The output Observables +emits values only from the most recently emitted instance of +`innerObservable`. + +## Parameters + +| Parameter | Type | Description | +| ----------------- | ---- | ---------------------------------------------------------------------- | +| `innerObservable` | `O` | An `ObservableInput` to replace each value from the source Observable. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`unknown`, [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +A function that returns an Observable that emits items from the +given `innerObservable` every time a value is emitted on the source Observable, +and taking only the values from the most recently projected inner Observable. + +## Example + +Restart an interval Observable on every click event + +```ts +import { fromEvent, switchMapTo, interval } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(switchMapTo(interval(1000))); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [concatMapTo](concatMapTo.md) +- [switchAll](switchAll.md) +- [switchMap](switchMap.md) +- [mergeMapTo](mergeMapTo.md) + +## Deprecated + +Will be removed in v9. Use [switchMap](switchMap.md) instead: `switchMap(() => result)` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/switchScan.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/switchScan.md new file mode 100644 index 0000000000..1c811a5973 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/switchScan.md @@ -0,0 +1,35 @@ +[API](../../index.md) / [rxjs](../index.md) / switchScan + +# Function: switchScan() + +```ts +function switchScan<>(accumulator: (acc: R, value: T, index: number) => O, seed: R): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/switchScan.ts:24](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/switchScan.ts#L24) + +Applies an accumulator function over the source Observable where the +accumulator function itself returns an Observable, emitting values +only from the most recently returned Observable. + +It's like [mergeScan](mergeScan.md), but only the most recent +Observable returned by the accumulator is merged into the outer Observable. + +## Parameters + +| Parameter | Type | Description | +| ------------- | ---------------------------------------------------- | ----------------------------------------------------- | +| `accumulator` | (`acc`: `R`, `value`: `T`, `index`: `number`) => `O` | The accumulator function called on each source value. | +| `seed` | `R` | The initial accumulation value. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +A function that returns an observable of the accumulated values. + +## See + +- [scan](scan.md) +- [mergeScan](mergeScan.md) +- [switchMap](switchMap.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/take.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/take.md new file mode 100644 index 0000000000..761a989e5a --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/take.md @@ -0,0 +1,61 @@ +[API](../../index.md) / [rxjs](../index.md) / take + +# Function: take() + +```ts +function take<>(count: number): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/take.ts:47](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/take.ts#L47) + +Emits only the first `count` values emitted by the source Observable. + +Takes the first `count` values from the source, then +completes. + +![](/images/marble-diagrams/take.png) + +`take` returns an Observable that emits only the first `count` values emitted +by the source Observable. If the source emits fewer than `count` values then +all of its values are emitted. After that, it completes, regardless if the +source completes. + +## Parameters + +| Parameter | Type | Description | +| --------- | -------- | -------------------------------------------- | +| `count` | `number` | The maximum number of `next` values to emit. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that emits only the first +`count` values emitted by the source Observable, or all of the values from +the source if the source emits fewer than `count` values. + +## Example + +Take the first 5 seconds of an infinite 1-second interval Observable + +```ts +import { interval, take } from 'rxjs'; + +const intervalCount = interval(1000); +const takeFive = intervalCount.pipe(take(5)); +takeFive.subscribe((x) => console.log(x)); + +// Logs: +// 0 +// 1 +// 2 +// 3 +// 4 +``` + +## See + +- [takeLast](takeLast.md) +- [takeUntil](takeUntil.md) +- [takeWhile](takeWhile.md) +- [skip](skip.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/takeLast.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/takeLast.md new file mode 100644 index 0000000000..7e6e57eadf --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/takeLast.md @@ -0,0 +1,57 @@ +[API](../../index.md) / [rxjs](../index.md) / takeLast + +# Function: takeLast() + +```ts +function takeLast<>(count: number): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/takeLast.ts:44](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/takeLast.ts#L44) + +Waits for the source to complete, then emits the last N values from the source, +as specified by the `count` argument. + +![](/images/marble-diagrams/takeLast.png) + +`takeLast` results in an observable that will hold values up to `count` values in memory, +until the source completes. It then pushes all values in memory to the consumer, in the +order they were received from the source, then notifies the consumer that it is +complete. + +If for some reason the source completes before the `count` supplied to `takeLast` is reached, +all values received until that point are emitted, and then completion is notified. + +**Warning**: Using `takeLast` with an observable that never completes will result +in an observable that never emits a value. + +## Parameters + +| Parameter | Type | Description | +| --------- | -------- | ------------------------------------------------------------------------------------------------------------- | +| `count` | `number` | The maximum number of values to emit from the end of the sequence of values emitted by the source Observable. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that emits at most the last +`count` values emitted by the source Observable. + +## Example + +Take the last 3 values of an Observable with many values + +```ts +import { range, takeLast } from 'rxjs'; + +const many = range(1, 100); +const lastThree = many.pipe(takeLast(3)); +lastThree.subscribe((x) => console.log(x)); +``` + +## See + +- [take](take.md) +- [takeUntil](takeUntil.md) +- [takeWhile](takeWhile.md) +- [skip](skip.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/takeUntil.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/takeUntil.md new file mode 100644 index 0000000000..ca9fcdeefc --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/takeUntil.md @@ -0,0 +1,56 @@ +[API](../../index.md) / [rxjs](../index.md) / takeUntil + +# Function: takeUntil() + +```ts +function takeUntil<>(notifier: ObservableInput): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/takeUntil.ts:43](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/takeUntil.ts#L43) + +Emits the values emitted by the source Observable until a `notifier` +Observable emits a value. + +Lets values pass until a second Observable, +`notifier`, emits a value. Then, it completes. + +![](/images/marble-diagrams/takeUntil.png) + +`takeUntil` subscribes and begins mirroring the source Observable. It also +monitors a second Observable, `notifier` that you provide. If the `notifier` +emits a value, the output Observable stops mirroring the source Observable +and completes. If the `notifier` doesn't emit any value and completes +then `takeUntil` will pass all values. + +## Parameters + +| Parameter | Type | Description | +| ---------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | +| `notifier` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | The `ObservableInput` whose first emitted value will cause the output Observable of `takeUntil` to stop emitting values from the source Observable. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that emits the values from the +source Observable until `notifier` emits its first value. + +## Example + +Tick every second until the first click happens + +```ts +import { interval, fromEvent, takeUntil } from 'rxjs'; + +const source = interval(1000); +const clicks = fromEvent(document, 'click'); +const result = source.pipe(takeUntil(clicks)); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [take](take.md) +- [takeLast](takeLast.md) +- [takeWhile](takeWhile.md) +- [skip](skip.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/takeWhile.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/takeWhile.md new file mode 100644 index 0000000000..6325be58a3 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/takeWhile.md @@ -0,0 +1,173 @@ +[API](../../index.md) / [rxjs](../index.md) / takeWhile + +# Function: takeWhile() + +> Emits values emitted by the source Observable so long as each value satisfies +> the given `predicate`, and then completes as soon as this `predicate` is not +> satisfied. + +## Description + +Takes values from the source only while they pass the +condition given. When the first value does not satisfy, it completes. + +![](/images/marble-diagrams/takeWhile.png) + +`takeWhile` subscribes and begins mirroring the source Observable. Each value +emitted on the source is given to the `predicate` function which returns a +boolean, representing a condition to be satisfied by the source values. The +output Observable emits the source values until such time as the `predicate` +returns false, at which point `takeWhile` stops mirroring the source +Observable and completes the output Observable. + +## Example + +Emit click events only while the clientX property is greater than 200 + +```ts +import { fromEvent, takeWhile } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(takeWhile((ev) => ev.clientX > 200)); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [take](take.md) +- [takeLast](takeLast.md) +- [takeUntil](takeUntil.md) +- [skip](skip.md) + +Observable and returns a boolean. Also takes the (zero-based) index as the +second argument. + +return `false` will also be emitted. + +## Parameters + +### `predicate` + +A function that evaluates a value emitted by the source + +### `inclusive` + +When set to `true` the value that caused `predicate` to + +## Returns + +`A` + +function that returns an Observable that emits values from the source Observable so long as each value satisfies the condition defined by the , then completes. + +## Call Signature + +```ts +function takeWhile<>(predicate: BooleanConstructor, inclusive: true): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/takeWhile.ts:4](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/takeWhile.ts#L4) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------- | +| `predicate` | `BooleanConstructor` | +| `inclusive` | `true` | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +## Call Signature + +```ts +function takeWhile<>(predicate: BooleanConstructor, inclusive: false): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/takeWhile.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/takeWhile.ts#L5) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------- | +| `predicate` | `BooleanConstructor` | +| `inclusive` | `false` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`TruthyTypesOf`](../type-aliases/TruthyTypesOf.md)\<`T`\>\> + +## Call Signature + +```ts +function takeWhile<>(predicate: BooleanConstructor): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/takeWhile.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/takeWhile.ts#L6) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------- | +| `predicate` | `BooleanConstructor` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`TruthyTypesOf`](../type-aliases/TruthyTypesOf.md)\<`T`\>\> + +## Call Signature + +```ts +function takeWhile<>(predicate: (value: T, index: number) => value is S): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/takeWhile.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/takeWhile.ts#L7) + +### Parameters + +| Parameter | Type | +| ----------- | ------------------------------------------------- | +| `predicate` | (`value`: `T`, `index`: `number`) => `value is S` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `S`\> + +## Call Signature + +```ts +function takeWhile<>(predicate: (value: T, index: number) => value is S, inclusive: false): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/takeWhile.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/takeWhile.ts#L8) + +### Parameters + +| Parameter | Type | +| ----------- | ------------------------------------------------- | +| `predicate` | (`value`: `T`, `index`: `number`) => `value is S` | +| `inclusive` | `false` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `S`\> + +## Call Signature + +```ts +function takeWhile<>(predicate: (value: T, index: number) => boolean, inclusive?: boolean): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/takeWhile.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/takeWhile.ts#L9) + +### Parameters + +| Parameter | Type | +| ------------ | ---------------------------------------------- | +| `predicate` | (`value`: `T`, `index`: `number`) => `boolean` | +| `inclusive?` | `boolean` | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/tap.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/tap.md new file mode 100644 index 0000000000..122e644edd --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/tap.md @@ -0,0 +1,111 @@ +[API](../../index.md) / [rxjs](../index.md) / tap + +# Function: tap() + +```ts +function tap<>(observerOrNext?: + | Partial> + | (value: T) => void +| null): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/tap.ts:156](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/tap.ts#L156) + +Used to perform side-effects for notifications from the source observable + +Used when you want to affect outside state with a notification without altering the notification + +![](/images/marble-diagrams/tap.png) + +Tap is designed to allow the developer a designated place to perform side effects. While you _could_ perform side-effects +inside of a `map` or a `mergeMap`, that would make their mapping functions impure, which isn't always a big deal, but will +make it so you can't do things like memoize those functions. The `tap` operator is designed solely for such side-effects to +help you remove side-effects from other operations. + +For any notification, next, error, or complete, `tap` will call the appropriate callback you have provided to it, via a function +reference, or a partial observer, then pass that notification down the stream. + +The observable returned by `tap` is an exact mirror of the source, with one exception: Any error that occurs -- synchronously -- in a handler +provided to `tap` will be emitted as an error from the returned observable. + +> Be careful! You can mutate objects as they pass through the `tap` operator's handlers. + +The most common use of `tap` is actually for debugging. You can place a `tap(console.log)` anywhere +in your observable `pipe`, log out the notifications as they are emitted by the source returned by the previous +operation. + +## Parameters + +| Parameter | Type | Description | +| ----------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------- | +| `observerOrNext?` | \| `Partial`\<[`TapObserver`](../interfaces/TapObserver.md)\<`T`\>\> \| (`value`: `T`) => `void` \| `null` | A next handler or partial observer | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable identical to the source, but +runs the specified Observer or callback(s) for each item. + +## Example + +Check a random number before it is handled. Below is an observable that will use a random number between 0 and 1, +and emit `'big'` or `'small'` depending on the size of that number. But we wanted to log what the original number +was, so we have added a `tap(console.log)`. + +```ts +import { of, tap, map } from 'rxjs'; + +of(Math.random()) + .pipe( + tap(console.log), + map((n) => (n > 0.5 ? 'big' : 'small')) + ) + .subscribe(console.log); +``` + +Using `tap` to analyze a value and force an error. Below is an observable where in our system we only +want to emit numbers 3 or less we get from another source. We can force our observable to error +using `tap`. + +```ts +import { of, tap } from 'rxjs'; + +const source = of(1, 2, 3, 4, 5); + +source + .pipe( + tap((n) => { + if (n > 3) { + throw new TypeError(`Value ${n} is greater than 3`); + } + }) + ) + .subscribe({ next: console.log, error: (err) => console.log(err.message) }); +``` + +We want to know when an observable completes before moving on to the next observable. The system +below will emit a random series of `'X'` characters from 3 different observables in sequence. The +only way we know when one observable completes and moves to the next one, in this case, is because +we have added a `tap` with the side effect of logging to console. + +```ts +import { of, concatMap, interval, take, map, tap } from 'rxjs'; + +of(1, 2, 3) + .pipe( + concatMap((n) => + interval(1000).pipe( + take(Math.round(Math.random() * 10)), + map(() => 'X'), + tap({ complete: () => console.log(`Done with ${n}`) }) + ) + ) + ) + .subscribe(console.log); +``` + +## See + +- [finalize](finalize.md) +- [TapObserver](../interfaces/TapObserver.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/throttle.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/throttle.md new file mode 100644 index 0000000000..b1b25e1c63 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/throttle.md @@ -0,0 +1,63 @@ +[API](../../index.md) / [rxjs](../index.md) / throttle + +# Function: throttle() + +```ts +function throttle<>(durationSelector: (value: T) => ObservableInput, config?: ThrottleConfig): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/throttle.ts:81](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/throttle.ts#L81) + +Emits a value from the source Observable, then ignores subsequent source +values for a duration determined by another Observable, then repeats this +process. + +It's like [throttleTime](throttleTime.md), but the silencing +duration is determined by a second Observable. + +
Marble diagram +Marble diagram
+ +`throttle` emits the source Observable values on the output Observable +when its internal timer is disabled, and ignores source values when the timer +is enabled. Initially, the timer is disabled. As soon as the first source +value arrives, it is forwarded to the output Observable, and then the timer +is enabled by calling the `durationSelector` function with the source value, +which returns the "duration" Observable. When the duration Observable emits a +value, the timer is disabled, and this process repeats for the +next source value. + +## Parameters + +| Parameter | Type | Description | +| ------------------ | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `durationSelector` | (`value`: `T`) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | A function that receives a value from the source Observable, for computing the silencing duration for each source value, returned as an `ObservableInput`. | +| `config?` | [`ThrottleConfig`](../interfaces/ThrottleConfig.md) | A configuration object to define `leading` and `trailing` behavior. Defaults to `{ leading: true, trailing: false }`. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that performs the throttle +operation to limit the rate of emissions from the source. + +## Example + +Emit clicks at a rate of at most one click per second + +```ts +import { fromEvent, throttle, interval } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(throttle(() => interval(1000))); + +result.subscribe((x) => console.log(x)); +``` + +## See + +- [audit](audit.md) +- [debounce](debounce.md) +- [delayWhen](delayWhen.md) +- [sample](sample.md) +- [throttleTime](throttleTime.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/throttleTime.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/throttleTime.md new file mode 100644 index 0000000000..20f3b17357 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/throttleTime.md @@ -0,0 +1,64 @@ +[API](../../index.md) / [rxjs](../index.md) / throttleTime + +# Function: throttleTime() + +```ts +function throttleTime<>(duration: number, scheduler: SchedulerLike, config?: ThrottleConfig): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/throttleTime.ts:56](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/throttleTime.ts#L56) + +Emits a value from the source Observable, then ignores subsequent source +values for `duration` milliseconds, then repeats this process. + +Lets a value pass, then ignores source values for the +next `duration` milliseconds. + +![](/images/marble-diagrams/throttleTime.png) + +`throttleTime` emits the source Observable values on the output Observable +when its internal timer is disabled, and ignores source values when the timer +is enabled. Initially, the timer is disabled. As soon as the first source +value arrives, it is forwarded to the output Observable, and then the timer +is enabled. After `duration` milliseconds (or the time unit determined +internally by the optional `scheduler`) has passed, the timer is disabled, +and this process repeats for the next source value. Optionally takes a +[SchedulerLike](../interfaces/SchedulerLike.md) for managing timers. + +## Parameters + +| Parameter | Type | Default value | Description | +| ----------- | --------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `duration` | `number` | `undefined` | Time to wait before emitting another value after emitting the last value, measured in milliseconds or the time unit determined internally by the optional `scheduler`. | +| `scheduler` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | `asyncScheduler` | The [SchedulerLike](../interfaces/SchedulerLike.md) to use for managing the timers that handle the throttling. Defaults to [asyncScheduler](../variables/asyncScheduler.md). | +| `config?` | [`ThrottleConfig`](../interfaces/ThrottleConfig.md) | `undefined` | A configuration object to define `leading` and `trailing` behavior. Defaults to `{ leading: true, trailing: false }`. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that performs the throttle +operation to limit the rate of emissions from the source. + +## Example + +### Limit click rate + +Emit clicks at a rate of at most one click per second + +```ts +import { fromEvent, throttleTime } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe(throttleTime(1000)); + +result.subscribe((x) => console.log(x)); +``` + +## See + +- [auditTime](auditTime.md) +- [debounceTime](debounceTime.md) +- [delay](delay.md) +- [sampleTime](sampleTime.md) +- [throttle](throttle.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/throwError.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/throwError.md new file mode 100644 index 0000000000..260a229939 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/throwError.md @@ -0,0 +1,110 @@ +[API](../../index.md) / [rxjs](../index.md) / throwError + +# Function: throwError() + +```ts +function throwError(errorFactory: () => any): Observable; +``` + +Defined in: [rxjs/src/internal/observable/throwError.ts:95](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/throwError.ts#L95) + +Creates an observable that will create an error instance and push it to the consumer as an error +immediately upon subscription. + +Just errors and does nothing else + +![](/images/marble-diagrams/throw.png) + +This creation function is useful for creating an observable that will create an error and error every +time it is subscribed to. Generally, inside of most operators when you might want to return an errored +observable, this is unnecessary. In most cases, such as in the inner return of [concatMap](concatMap.md), +[mergeMap](mergeMap.md), [defer](defer.md), and many others, you can simply throw the error, and RxJS will pick +that up and notify the consumer of the error. + +## Parameters + +| Parameter | Type | Description | +| -------------- | ----------- | ---------------------------------------------------------------------- | +| `errorFactory` | () => `any` | A factory function that will create the error instance that is pushed. | + +## Returns + +[`Observable`](../classes/Observable.md)\<`never`\> + +## Example + +Create a simple observable that will create a new error with a timestamp and log it +and the message every time you subscribe to it + +```ts +import { throwError } from 'rxjs'; + +let errorCount = 0; + +const errorWithTimestamp$ = throwError(() => { + const error: any = new Error(`This is error number ${++errorCount}`); + error.timestamp = Date.now(); + return error; +}); + +errorWithTimestamp$.subscribe({ + error: (err) => console.log(err.timestamp, err.message), +}); + +errorWithTimestamp$.subscribe({ + error: (err) => console.log(err.timestamp, err.message), +}); + +// Logs the timestamp and a new error message for each subscription +``` + +### Unnecessary usage + +Using `throwError` inside of an operator or creation function +with a callback, is usually not necessary + +```ts +import { of, concatMap, timer, throwError } from 'rxjs'; + +const delays$ = of(1000, 2000, Infinity, 3000); + +delays$ + .pipe( + concatMap((ms) => { + if (ms < 10000) { + return timer(ms); + } else { + // This is probably overkill. + return throwError(() => new Error(`Invalid time ${ms}`)); + } + }) + ) + .subscribe({ + next: console.log, + error: console.error, + }); +``` + +You can just throw the error instead + +```ts +import { of, concatMap, timer } from 'rxjs'; + +const delays$ = of(1000, 2000, Infinity, 3000); + +delays$ + .pipe( + concatMap((ms) => { + if (ms < 10000) { + return timer(ms); + } else { + // Cleaner and easier to read for most folks. + throw new Error(`Invalid time ${ms}`); + } + }) + ) + .subscribe({ + next: console.log, + error: console.error, + }); +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/throwIfEmpty.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/throwIfEmpty.md new file mode 100644 index 0000000000..11e18d9863 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/throwIfEmpty.md @@ -0,0 +1,52 @@ +[API](../../index.md) / [rxjs](../index.md) / throwIfEmpty + +# Function: throwIfEmpty() + +```ts +function throwIfEmpty<>(errorFactory: () => any): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/throwIfEmpty.ts:41](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/throwIfEmpty.ts#L41) + +If the source observable completes without emitting a value, it will emit +an error. The error will be created at that time by the optional +`errorFactory` argument, otherwise, the error will be [EmptyError](../classes/EmptyError.md). + +![](/images/marble-diagrams/throwIfEmpty.png) + +## Parameters + +| Parameter | Type | Default value | Description | +| -------------- | ----------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `errorFactory` | () => `any` | `defaultErrorFactory` | A factory function called to produce the error to be thrown when the source observable completes without emitting a value. | + +## Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +A function that returns an Observable that throws an error if the +source Observable completed without emitting. + +## Example + +Throw an error if the document wasn't clicked within 1 second + +```ts +import { fromEvent, takeUntil, timer, throwIfEmpty } from 'rxjs'; + +const click$ = fromEvent(document, 'click'); + +click$ + .pipe( + takeUntil(timer(1000)), + throwIfEmpty(() => new Error('The document was not clicked within 1 second')) + ) + .subscribe({ + next() { + console.log('The document was clicked'); + }, + error(err) { + console.error(err.message); + }, + }); +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/timeInterval.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/timeInterval.md new file mode 100644 index 0000000000..62e11d73ff --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/timeInterval.md @@ -0,0 +1,54 @@ +[API](../../index.md) / [rxjs](../index.md) / timeInterval + +# Function: timeInterval() + +```ts +function timeInterval<>(scheduler: SchedulerLike): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/timeInterval.ts:44](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/timeInterval.ts#L44) + +Emits an object containing the current value, and the time that has +passed between emitting the current value and the previous value, which is +calculated by using the provided `scheduler`'s `now()` method to retrieve +the current time at each emission, then calculating the difference. The `scheduler` +defaults to [asyncScheduler](../variables/asyncScheduler.md), so by default, the `interval` will be in +milliseconds. + +Convert an Observable that emits items into one that +emits indications of the amount of time elapsed between those emissions. + +![](/images/marble-diagrams/timeInterval.png) + +## Parameters + +| Parameter | Type | Default value | Description | +| ----------- | ------------------------------------------------- | ---------------- | --------------------------------------- | +| `scheduler` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | `asyncScheduler` | Scheduler used to get the current time. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `TimeInterval`\<`T`\>\> + +A function that returns an Observable that emits information about +value and interval. + +## Example + +Emit interval between current value with the last value + +```ts +import { interval, timeInterval } from 'rxjs'; + +const seconds = interval(1000); + +seconds.pipe(timeInterval()).subscribe((value) => console.log(value)); + +// NOTE: The values will never be this precise, +// intervals created with `interval` or `setInterval` +// are non-deterministic. + +// { value: 0, interval: 1000 } +// { value: 1, interval: 1000 } +// { value: 2, interval: 1000 } +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/timeout.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/timeout.md new file mode 100644 index 0000000000..985108eccc --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/timeout.md @@ -0,0 +1,259 @@ +[API](../../index.md) / [rxjs](../index.md) / timeout + +# Function: timeout() + +> Errors if Observable does not emit a value in given time span. + +## Description + +Timeouts on Observable that doesn't emit values fast enough. + +![](/images/marble-diagrams/timeout.png) + +## See + +[timeoutWith](timeoutWith.md) + +## Returns + +`A` + +function that returns an Observable that mirrors behaviour of the source Observable, unless timeout happens when it throws an error. + +## Call Signature + +```ts +function timeout<>( + config: TimeoutConfig & { + with: (info: TimeoutInfo) => O; + } +): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/timeout.ts:142](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/timeout.ts#L142) + +If `with` is provided, this will return an observable that will switch to a different observable if the source +does not push values within the specified time parameters. + +The most flexible option for creating a timeout behavior. + +The first thing to know about the configuration is if you do not provide a `with` property to the configuration, +when timeout conditions are met, this operator will emit a [TimeoutError](../classes/TimeoutError.md). Otherwise, it will use the factory +function provided by `with`, and switch your subscription to the result of that. Timeout conditions are provided by +the settings in `first` and `each`. + +The `first` property can be either a `Date` for a specific time, a `number` for a time period relative to the +point of subscription, or it can be skipped. This property is to check timeout conditions for the arrival of +the first value from the source _only_. The timings of all subsequent values from the source will be checked +against the time period provided by `each`, if it was provided. + +The `each` property can be either a `number` or skipped. If a value for `each` is provided, it represents the amount of +time the resulting observable will wait between the arrival of values from the source before timing out. Note that if +`first` is _not_ provided, the value from `each` will be used to check timeout conditions for the arrival of the first +value and all subsequent values. If `first` _is_ provided, `each` will only be use to check all values after the first. + +### Parameters + +| Parameter | Type | Description | +| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | +| `config` | [`TimeoutConfig`](../interfaces/TimeoutConfig.md)\<`T`, `O`, `M`\> & \{ `with`: (`info`: [`TimeoutInfo`](../interfaces/TimeoutInfo.md)\<`T`, `M`\>) => `O`; \} | The configuration for the timeout. | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| [`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`O`\>\> + +### Example + +Emit a custom error if there is too much time between values + +```ts +import { interval, timeout, throwError } from 'rxjs'; + +class CustomTimeoutError extends Error { + constructor() { + super('It was too slow'); + this.name = 'CustomTimeoutError'; + } +} + +const slow$ = interval(900); + +slow$ + .pipe( + timeout({ + each: 1000, + with: () => throwError(() => new CustomTimeoutError()), + }) + ) + .subscribe({ + error: console.error, + }); +``` + +Switch to a faster observable if your source is slow. + +```ts +import { interval, timeout } from 'rxjs'; + +const slow$ = interval(900); +const fast$ = interval(500); + +slow$ + .pipe( + timeout({ + each: 1000, + with: () => fast$, + }) + ) + .subscribe(console.log); +``` + +## Call Signature + +```ts +function timeout<>(config: Omit, 'with'>): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/timeout.ts:236](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/timeout.ts#L236) + +Returns an observable that will error or switch to a different observable if the source does not push values +within the specified time parameters. + +The most flexible option for creating a timeout behavior. + +The first thing to know about the configuration is if you do not provide a `with` property to the configuration, +when timeout conditions are met, this operator will emit a [TimeoutError](../classes/TimeoutError.md). Otherwise, it will use the factory +function provided by `with`, and switch your subscription to the result of that. Timeout conditions are provided by +the settings in `first` and `each`. + +The `first` property can be either a `Date` for a specific time, a `number` for a time period relative to the +point of subscription, or it can be skipped. This property is to check timeout conditions for the arrival of +the first value from the source _only_. The timings of all subsequent values from the source will be checked +against the time period provided by `each`, if it was provided. + +The `each` property can be either a `number` or skipped. If a value for `each` is provided, it represents the amount of +time the resulting observable will wait between the arrival of values from the source before timing out. Note that if +`first` is _not_ provided, the value from `each` will be used to check timeout conditions for the arrival of the first +value and all subsequent values. If `first` _is_ provided, `each` will only be use to check all values after the first. + +### Handling TimeoutErrors + +If no `with` property was provided, subscriptions to the resulting observable may emit an error of [TimeoutError](../classes/TimeoutError.md). +The timeout error provides useful information you can examine when you're handling the error. The most common way to handle +the error would be with [catchError](catchError.md), although you could use [tap](tap.md) or just the error handler in your `subscribe` call +directly, if your error handling is only a side effect (such as notifying the user, or logging). + +In this case, you would check the error for `instanceof TimeoutError` to validate that the error was indeed from `timeout`, and +not from some other source. If it's not from `timeout`, you should probably rethrow it if you're in a `catchError`. + +### Parameters + +| Parameter | Type | +| --------- | ---------------------------------------------------------------------------------------- | +| `config` | `Omit`\<[`TimeoutConfig`](../interfaces/TimeoutConfig.md)\<`T`, `any`, `M`\>, `"with"`\> | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T`\> + +### Example + +Emit a [TimeoutError](../classes/TimeoutError.md) if the first value, and _only_ the first value, does not arrive within 5 seconds + +```ts +import { interval, timeout } from 'rxjs'; + +// A random interval that lasts between 0 and 10 seconds per tick +const source$ = interval(Math.round(Math.random() * 10_000)); + +source$.pipe(timeout({ first: 5_000 })).subscribe({ + next: console.log, + error: console.error, +}); +``` + +Emit a [TimeoutError](../classes/TimeoutError.md) if the source waits longer than 5 seconds between any two values or the first value +and subscription. + +```ts +import { timer, timeout, expand } from 'rxjs'; + +const getRandomTime = () => Math.round(Math.random() * 10_000); + +// An observable that waits a random amount of time between each delivered value +const source$ = timer(getRandomTime()).pipe(expand(() => timer(getRandomTime()))); + +source$.pipe(timeout({ each: 5_000 })).subscribe({ + next: console.log, + error: console.error, +}); +``` + +Emit a [TimeoutError](../classes/TimeoutError.md) if the source does not emit before 7 seconds, _or_ if the source waits longer than +5 seconds between any two values after the first. + +```ts +import { timer, timeout, expand } from 'rxjs'; + +const getRandomTime = () => Math.round(Math.random() * 10_000); + +// An observable that waits a random amount of time between each delivered value +const source$ = timer(getRandomTime()).pipe(expand(() => timer(getRandomTime()))); + +source$.pipe(timeout({ first: 7_000, each: 5_000 })).subscribe({ + next: console.log, + error: console.error, +}); +``` + +## Call Signature + +```ts +function timeout<>(first: Date, scheduler?: SchedulerLike): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/timeout.ts:250](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/timeout.ts#L250) + +Returns an observable that will error if the source does not push its first value before the specified time passed as a `Date`. +This is functionally the same as `timeout({ first: someDate })`. + +Errors if the first value doesn't show up before the given date and time + +![](/images/marble-diagrams/timeout.png) + +### Parameters + +| Parameter | Type | Description | +| ------------ | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `first` | `Date` | The date to at which the resulting observable will timeout if the source observable does not emit at least one value. | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | The scheduler to use. Defaults to [asyncScheduler](../variables/asyncScheduler.md). | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> + +## Call Signature + +```ts +function timeout<>(each: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/timeout.ts:264](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/timeout.ts#L264) + +Returns an observable that will error if the source does not push a value within the specified time in milliseconds. +This is functionally the same as `timeout({ each: milliseconds })`. + +Errors if it waits too long between any value + +![](/images/marble-diagrams/timeout.png) + +### Parameters + +| Parameter | Type | Description | +| ------------ | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `each` | `number` | The time allowed between each pushed value from the source before the resulting observable will timeout. | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | The scheduler to use. Defaults to [asyncScheduler](../variables/asyncScheduler.md). | + +### Returns + +[`MonoTypeOperatorFunction`](../interfaces/MonoTypeOperatorFunction.md)\<`T`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/timeoutWith.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/timeoutWith.md new file mode 100644 index 0000000000..001f9093e3 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/timeoutWith.md @@ -0,0 +1,152 @@ +[API](../../index.md) / [rxjs](../index.md) / timeoutWith + +# ~~Function: timeoutWith()~~ + +> When the passed timespan elapses before the source emits any given value, it will unsubscribe from the source, +> and switch the subscription to another observable. + +## Description + +Used to switch to a different observable if your source is being slow. + +Useful in cases where: + +- You want to switch to a different source that may be faster. +- You want to notify a user that the data stream is slow. +- You want to emit a custom error rather than the [TimeoutError](../classes/TimeoutError.md) emitted + by the default usage of [timeout](timeout.md). + +If the first parameter is passed as Date and the time of the Date arrives before the first value arrives from the source, +it will unsubscribe from the source and switch the subscription to another observable. + +Use Date object to switch to a different observable if the first value doesn't arrive by a specific time. + +Can be used to set a timeout only for the first value, however it's recommended to use the [timeout](timeout.md) operator with +the `first` configuration to get the same effect. + +**deprecated**: Replaced with [timeout](timeout.md). Instead of `timeoutWith(100, a$, scheduler)`, use [timeout](timeout.md) with the configuration +object: `timeout({ each: 100, with: () => a$, scheduler })`. Instead of `timeoutWith(someDate, a$, scheduler)`, use [timeout](timeout.md) +with the configuration object: `timeout({ first: someDate, with: () => a$, scheduler })`. Will be removed in v8. + +## Example + +Fallback to a faster observable + +```ts +import { interval, timeoutWith } from 'rxjs'; + +const slow$ = interval(1000); +const faster$ = interval(500); + +slow$.pipe(timeoutWith(900, faster$)).subscribe(console.log); +``` + +Emit your own custom timeout error + +```ts +import { interval, timeoutWith, throwError } from 'rxjs'; + +class CustomTimeoutError extends Error { + constructor() { + super('It was too slow'); + this.name = 'CustomTimeoutError'; + } +} + +const slow$ = interval(1000); + +slow$ + .pipe( + timeoutWith( + 900, + throwError(() => new CustomTimeoutError()) + ) + ) + .subscribe({ + error: (err) => console.error(err.message), + }); +``` + +## See + +[timeout](timeout.md) + +is triggered. When passed a Date, used as the exact time at which the timeout will be triggered if the first value does not arrive. + +## Deprecated + +Replaced with [timeout](timeout.md). Instead of `timeoutWith(100, a$, scheduler)`, use [timeout](timeout.md) with the configuration +object: `timeout({ each: 100, with: () => a$, scheduler })`. Instead of `timeoutWith(someDate, a$, scheduler)`, use [timeout](timeout.md) +with the configuration object: `timeout({ first: someDate, with: () => a$, scheduler })`. Will be removed in v8. + +## Parameters + +### `due` + +When passed a number, used as the time (in milliseconds) allowed between each value from the source before timeout + +### `withObservable` + +The observable to switch to when timeout occurs. + +### `scheduler` + +The scheduler to use with time-related operations within this operator. Defaults to [asyncScheduler](../variables/asyncScheduler.md) + +## Returns + +`A function that returns an Observable that mirrors behaviour of the +source Observable, unless timeout happens when it starts emitting values +from the` + +passed as a second parameter. + +## Call Signature + +```ts +function timeoutWith<>(dueBy: Date, switchTo: ObservableInput, scheduler?: SchedulerLike): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/timeoutWith.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/timeoutWith.ts#L8) + +### Parameters + +| Parameter | Type | +| ------------ | -------------------------------------------------------------- | +| `dueBy` | `Date` | +| `switchTo` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`R`\> | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `R`\> + +### Deprecated + +Replaced with [timeout](timeout.md). Instead of `timeoutWith(someDate, a$, scheduler)`, use the configuration object +`timeout({ first: someDate, with: () => a$, scheduler })`. Will be removed in v8. + +## Call Signature + +```ts +function timeoutWith<>(waitFor: number, switchTo: ObservableInput, scheduler?: SchedulerLike): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/timeoutWith.ts:11](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/timeoutWith.ts#L11) + +### Parameters + +| Parameter | Type | +| ------------ | -------------------------------------------------------------- | +| `waitFor` | `number` | +| `switchTo` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`R`\> | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T` \| `R`\> + +### Deprecated + +Replaced with [timeout](timeout.md). Instead of `timeoutWith(100, a$, scheduler)`, use the configuration object +`timeout({ each: 100, with: () => a$, scheduler })`. Will be removed in v8. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/timer.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/timer.md new file mode 100644 index 0000000000..913035c50e --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/timer.md @@ -0,0 +1,169 @@ +[API](../../index.md) / [rxjs](../index.md) / timer + +# Function: timer() + +## Call Signature + +```ts +function timer(due: number | Date, scheduler?: SchedulerLike): Observable<0>; +``` + +Defined in: [rxjs/src/internal/observable/timer.ts:85](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/timer.ts#L85) + +Creates an observable that will wait for a specified time period, or exact date, before +emitting the number 0. + +Used to emit a notification after a delay. + +This observable is useful for creating delays in code, or racing against other values +for ad-hoc timeouts. + +The `delay` is specified by default in milliseconds, however providing a custom scheduler could +create a different behavior. + +### Parameters + +| Parameter | Type | Description | +| ------------ | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | +| `due` | `number` \| `Date` | If a `number`, the amount of time in milliseconds to wait before emitting. If a `Date`, the exact time at which to emit. | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | The scheduler to use to schedule the delay. Defaults to [asyncScheduler](../variables/asyncScheduler.md). | + +### Returns + +[`Observable`](../classes/Observable.md)\<`0`\> + +### Example + +Wait 3 seconds and start another observable + +You might want to use `timer` to delay subscription to an +observable by a set amount of time. Here we use a timer with +[concatMapTo](concatMapTo.md) or [concatMap](concatMap.md) in order to wait +a few seconds and start a subscription to a source. + +```ts +import { of, timer, concatMap } from 'rxjs'; + +// This could be any observable +const source = of(1, 2, 3); + +timer(3000) + .pipe(concatMap(() => source)) + .subscribe(console.log); +``` + +Take all values until the start of the next minute + +Using a `Date` as the trigger for the first emission, you can +do things like wait until midnight to fire an event, or in this case, +wait until a new minute starts (chosen so the example wouldn't take +too long to run) in order to stop watching a stream. Leveraging +[takeUntil](takeUntil.md). + +```ts +import { interval, takeUntil, timer } from 'rxjs'; + +// Build a Date object that marks the +// next minute. +const currentDate = new Date(); +const startOfNextMinute = new Date( + currentDate.getFullYear(), + currentDate.getMonth(), + currentDate.getDate(), + currentDate.getHours(), + currentDate.getMinutes() + 1 +); + +// This could be any observable stream +const source = interval(1000); + +const result = source.pipe(takeUntil(timer(startOfNextMinute))); + +result.subscribe(console.log); +``` + +### Known Limitations + +- The [asyncScheduler](../variables/asyncScheduler.md) uses `setTimeout` which has limitations for how far in the future it can be scheduled. + +- If a `scheduler` is provided that returns a timestamp other than an epoch from `now()`, and + a `Date` object is passed to the `dueTime` argument, the calculation for when the first emission + should occur will be incorrect. In this case, it would be best to do your own calculations + ahead of time, and pass a `number` in as the `dueTime`. + +## Call Signature + +```ts +function timer(startDue: number | Date, intervalDuration: number, scheduler?: SchedulerLike): Observable; +``` + +Defined in: [rxjs/src/internal/observable/timer.ts:127](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/timer.ts#L127) + +Creates an observable that starts an interval after a specified delay, emitting incrementing numbers -- starting at `0` -- +on each interval afterwards. + +The `delay` and `intervalDuration` are specified by default in milliseconds, however providing a custom scheduler could +create a different behavior. + +### Parameters + +| Parameter | Type | Description | +| ------------------ | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `startDue` | `number` \| `Date` | If a `number`, is the time to wait before starting the interval. If a `Date`, is the exact time at which to start the interval. | +| `intervalDuration` | `number` | The delay between each value emitted in the interval. Passing a negative number here will result in immediate completion after the first value is emitted, as though no `intervalDuration` was passed at all. | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | The scheduler to use to schedule the delay. Defaults to [asyncScheduler](../variables/asyncScheduler.md). | + +### Returns + +[`Observable`](../classes/Observable.md)\<`number`\> + +### Example + +### Start an interval that starts right away + +Since [interval](interval.md) waits for the passed delay before starting, +sometimes that's not ideal. You may want to start an interval immediately. +`timer` works well for this. Here we have both side-by-side so you can +see them in comparison. + +Note that this observable will never complete. + +```ts +import { timer, interval } from 'rxjs'; + +timer(0, 1000).subscribe((n) => console.log('timer', n)); +interval(1000).subscribe((n) => console.log('interval', n)); +``` + +### Known Limitations + +- The [asyncScheduler](../variables/asyncScheduler.md) uses `setTimeout` which has limitations for how far in the future it can be scheduled. + +- If a `scheduler` is provided that returns a timestamp other than an epoch from `now()`, and + a `Date` object is passed to the `dueTime` argument, the calculation for when the first emission + should occur will be incorrect. In this case, it would be best to do your own calculations + ahead of time, and pass a `number` in as the `startDue`. + +## Call Signature + +```ts +function timer(dueTime: number | Date, unused: undefined, scheduler?: SchedulerLike): Observable<0>; +``` + +Defined in: [rxjs/src/internal/observable/timer.ts:132](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/timer.ts#L132) + +### Parameters + +| Parameter | Type | +| ------------ | ------------------------------------------------- | +| `dueTime` | `number` \| `Date` | +| `unused` | `undefined` | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +[`Observable`](../classes/Observable.md)\<`0`\> + +### Deprecated + +The signature allowing `undefined` to be passed for `intervalDuration` will be removed in v8. Use the `timer(dueTime, scheduler?)` signature instead. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/timestamp.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/timestamp.md new file mode 100644 index 0000000000..ff1407d336 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/timestamp.md @@ -0,0 +1,47 @@ +[API](../../index.md) / [rxjs](../index.md) / timestamp + +# Function: timestamp() + +```ts +function timestamp<>(timestampProvider: TimestampProvider): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/timestamp.ts:37](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/timestamp.ts#L37) + +Attaches a timestamp to each item emitted by an observable indicating when it was emitted + +The `timestamp` operator maps the _source_ observable stream to an object of type +`{value: T, timestamp: R}`. The properties are generically typed. The `value` property contains the value +and type of the _source_ observable. The `timestamp` is generated by the schedulers `now` function. By +default, it uses the `asyncScheduler` which simply returns `Date.now()` (milliseconds since 1970/01/01 +00:00:00:000) and therefore is of type `number`. + +![](/images/marble-diagrams/timestamp.png) + +## Parameters + +| Parameter | Type | Default value | Description | +| ------------------- | --------------------------------------------------------- | ----------------------- | ------------------------------------------------------------------ | +| `timestampProvider` | [`TimestampProvider`](../interfaces/TimestampProvider.md) | `dateTimestampProvider` | An object with a `now()` method used to get the current timestamp. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`Timestamp`](../interfaces/Timestamp.md)\<`T`\>\> + +A function that returns an Observable that attaches a timestamp to +each item emitted by the source Observable indicating when it was emitted. + +## Example + +In this example there is a timestamp attached to the document's click events + +```ts +import { fromEvent, timestamp } from 'rxjs'; + +const clickWithTimestamp = fromEvent(document, 'click').pipe(timestamp()); + +// Emits data of type { value: PointerEvent, timestamp: number } +clickWithTimestamp.subscribe((data) => { + console.log(data); +}); +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/toArray.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/toArray.md new file mode 100644 index 0000000000..115d02d59b --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/toArray.md @@ -0,0 +1,39 @@ +[API](../../index.md) / [rxjs](../index.md) / toArray + +# Function: toArray() + +```ts +function toArray<>(): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/toArray.ts:37](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/toArray.ts#L37) + +Collects all source emissions and emits them as an array when the source completes. + +Get all values inside an array when the source completes + +![](/images/marble-diagrams/toArray.png) + +`toArray` will wait until the source Observable completes before emitting +the array containing all emissions. When the source Observable errors no +array will be emitted. + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `T`[]\> + +A function that returns an Observable that emits an array of items +emitted by the source Observable when source completes. + +## Example + +```ts +import { interval, take, toArray } from 'rxjs'; + +const source = interval(1000); +const example = source.pipe(take(10), toArray()); + +example.subscribe((value) => console.log(value)); + +// output: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/using.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/using.md new file mode 100644 index 0000000000..c8f0bb2290 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/using.md @@ -0,0 +1,48 @@ +[API](../../index.md) / [rxjs](../index.md) / using + +# Function: using() + +```ts +function using<>( + resourceFactory: () => void | Unsubscribable, + observableFactory: (resource: void | Unsubscribable) => void | T +): Observable>; +``` + +Defined in: [rxjs/src/internal/observable/using.ts:31](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/using.ts#L31) + +Creates an Observable that uses a resource which will be disposed at the same time as the Observable. + +Use it when you catch yourself cleaning up after an Observable. + +`using` is a factory operator, which accepts two functions. First function returns a disposable resource. +It can be an arbitrary object that implements `unsubscribe` method. Second function will be injected with +that object and should return an Observable. That Observable can use resource object during its execution. +Both functions passed to `using` will be called every time someone subscribes - neither an Observable nor +resource object will be shared in any way between subscriptions. + +When Observable returned by `using` is subscribed, Observable returned from the second function will be subscribed +as well. All its notifications (nexted values, completion and error events) will be emitted unchanged by the output +Observable. If however someone unsubscribes from the Observable or source Observable completes or errors by itself, +the `unsubscribe` method on resource object will be called. This can be used to do any necessary clean up, which +otherwise would have to be handled by hand. Note that complete or error notifications are not emitted when someone +cancels subscription to an Observable via `unsubscribe`, so `using` can be used as a hook, allowing you to make +sure that all resources which need to exist during an Observable execution will be disposed at appropriate time. + +## Parameters + +| Parameter | Type | Description | +| ------------------- | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `resourceFactory` | () => `void` \| [`Unsubscribable`](../interfaces/Unsubscribable.md) | A function which creates any resource object that implements `unsubscribe` method. | +| `observableFactory` | (`resource`: `void` \| [`Unsubscribable`](../interfaces/Unsubscribable.md)) => `void` \| `T` | A function which creates an Observable, that can use injected resource object. | + +## Returns + +[`Observable`](../classes/Observable.md)\<[`ObservedValueOf`](../type-aliases/ObservedValueOf.md)\<`T`\>\> + +An Observable that behaves the same as Observable returned by `observableFactory`, but +which - when completed, errored or unsubscribed - will also call `unsubscribe` on created resource object. + +## See + +[defer](defer.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/window.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/window.md new file mode 100644 index 0000000000..4927e25518 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/window.md @@ -0,0 +1,62 @@ +[API](../../index.md) / [rxjs](../index.md) / window + +# Function: window() + +```ts +function window<>(windowBoundaries: ObservableInput): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/window.ts:50](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/window.ts#L50) + +Branch out the source Observable values as a nested Observable whenever +`windowBoundaries` emits. + +It's like [buffer](buffer.md), but emits a nested Observable +instead of an array. + +![](/images/marble-diagrams/window.png) + +Returns an Observable that emits windows of items it collects from the source +Observable. The output Observable emits connected, non-overlapping +windows. It emits the current window and opens a new one whenever the +`windowBoundaries` emits an item. `windowBoundaries` can be any type that +`ObservableInput` accepts. It internally gets converted to an Observable. +Because each window is an Observable, the output is a higher-order Observable. + +## Parameters + +| Parameter | Type | Description | +| ------------------ | ---------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `windowBoundaries` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | An `ObservableInput` that completes the previous window and starts a new window. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`Observable`](../classes/Observable.md)\<`T`\>\> + +A function that returns an Observable of windows, which are +Observables emitting values of the source Observable. + +## Example + +In every window of 1 second each, emit at most 2 click events + +```ts +import { fromEvent, interval, window, map, take, mergeAll } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const sec = interval(1000); +const result = clicks.pipe( + window(sec), + map((win) => win.pipe(take(2))), // take at most 2 emissions from each window + mergeAll() // flatten the Observable-of-Observables +); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [windowCount](windowCount.md) +- [windowTime](windowTime.md) +- [windowToggle](windowToggle.md) +- [windowWhen](windowWhen.md) +- [buffer](buffer.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/windowCount.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/windowCount.md new file mode 100644 index 0000000000..20a38816f4 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/windowCount.md @@ -0,0 +1,77 @@ +[API](../../index.md) / [rxjs](../index.md) / windowCount + +# Function: windowCount() + +```ts +function windowCount<>(windowSize: number, startWindowEvery: number): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/windowCount.ts:66](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/windowCount.ts#L66) + +Branch out the source Observable values as a nested Observable with each +nested Observable emitting at most `windowSize` values. + +It's like [bufferCount](bufferCount.md), but emits a nested +Observable instead of an array. + +![](/images/marble-diagrams/windowCount.png) + +Returns an Observable that emits windows of items it collects from the source +Observable. The output Observable emits windows every `startWindowEvery` +items, each containing no more than `windowSize` items. When the source +Observable completes or encounters an error, the output Observable emits +the current window and propagates the notification from the source +Observable. If `startWindowEvery` is not provided, then new windows are +started immediately at the start of the source and when each window completes +with size `windowSize`. + +## Parameters + +| Parameter | Type | Default value | Description | +| ------------------ | -------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `windowSize` | `number` | `undefined` | The maximum number of values emitted by each window. | +| `startWindowEvery` | `number` | `0` | Interval at which to start a new window. For example if `startWindowEvery` is `2`, then a new window will be started on every other value from the source. A new window is started at the beginning of the source by default. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`Observable`](../classes/Observable.md)\<`T`\>\> + +A function that returns an Observable of windows, which in turn are +Observable of values. + +## Example + +Ignore every 3rd click event, starting from the first one + +```ts +import { fromEvent, windowCount, map, skip, mergeAll } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe( + windowCount(3), + map((win) => win.pipe(skip(1))), // skip first of every 3 clicks + mergeAll() // flatten the Observable-of-Observables +); +result.subscribe((x) => console.log(x)); +``` + +Ignore every 3rd click event, starting from the third one + +```ts +import { fromEvent, windowCount, mergeAll } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe( + windowCount(2, 3), + mergeAll() // flatten the Observable-of-Observables +); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [window](window.md) +- [windowTime](windowTime.md) +- [windowToggle](windowToggle.md) +- [windowWhen](windowWhen.md) +- [bufferCount](bufferCount.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/windowTime.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/windowTime.md new file mode 100644 index 0000000000..b6dd8b5001 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/windowTime.md @@ -0,0 +1,176 @@ +[API](../../index.md) / [rxjs](../index.md) / windowTime + +# Function: windowTime() + +> Branch out the source Observable values as a nested Observable periodically +> in time. + +## Description + +It's like [bufferTime](bufferTime.md), but emits a nested +Observable instead of an array. + +![](/images/marble-diagrams/windowTime.png) + +Returns an Observable that emits windows of items it collects from the source +Observable. The output Observable starts a new window periodically, as +determined by the `windowCreationInterval` argument. It emits each window +after a fixed timespan, specified by the `windowTimeSpan` argument. When the +source Observable completes or encounters an error, the output Observable +emits the current window and propagates the notification from the source +Observable. If `windowCreationInterval` is not provided, the output +Observable starts a new window when the previous window of duration +`windowTimeSpan` completes. If `maxWindowCount` is provided, each window +will emit at most fixed number of values. Window will complete immediately +after emitting last value and next one still will open as specified by +`windowTimeSpan` and `windowCreationInterval` arguments. + +## Example + +In every window of 1 second each, emit at most 2 click events + +```ts +import { fromEvent, windowTime, map, take, mergeAll } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe( + windowTime(1000), + map((win) => win.pipe(take(2))), // take at most 2 emissions from each window + mergeAll() // flatten the Observable-of-Observables +); +result.subscribe((x) => console.log(x)); +``` + +Every 5 seconds start a window 1 second long, and emit at most 2 click events per window + +```ts +import { fromEvent, windowTime, map, take, mergeAll } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe( + windowTime(1000, 5000), + map((win) => win.pipe(take(2))), // take at most 2 emissions from each window + mergeAll() // flatten the Observable-of-Observables +); +result.subscribe((x) => console.log(x)); +``` + +Same as example above but with `maxWindowCount` instead of `take` + +```ts +import { fromEvent, windowTime, mergeAll } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe( + windowTime(1000, 5000, 2), // take at most 2 emissions from each window + mergeAll() // flatten the Observable-of-Observables +); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [window](window.md) +- [windowCount](windowCount.md) +- [windowToggle](windowToggle.md) +- [windowWhen](windowWhen.md) +- [bufferTime](bufferTime.md) + +windows. + +values each window can emit before completion. + +intervals that determine window boundaries. + +## Parameters + +### `windowTimeSpan` + +The amount of time, in milliseconds, to fill each window. + +### `windowCreationInterval` + +The interval at which to start new + +### `maxWindowSize` + +Max number of + +### `scheduler` + +The scheduler on which to schedule the + +## Returns + +`A` + +function that returns an Observable of windows, which in turn are Observables. + +## Call Signature + +```ts +function windowTime<>(windowTimeSpan: number, scheduler?: SchedulerLike): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/windowTime.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/windowTime.ts#L9) + +### Parameters + +| Parameter | Type | +| ---------------- | ------------------------------------------------- | +| `windowTimeSpan` | `number` | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`Observable`](../classes/Observable.md)\<`T`\>\> + +## Call Signature + +```ts +function windowTime<>( + windowTimeSpan: number, + windowCreationInterval: number, + scheduler?: SchedulerLike +): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/windowTime.ts:10](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/windowTime.ts#L10) + +### Parameters + +| Parameter | Type | +| ------------------------ | ------------------------------------------------- | +| `windowTimeSpan` | `number` | +| `windowCreationInterval` | `number` | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`Observable`](../classes/Observable.md)\<`T`\>\> + +## Call Signature + +```ts +function windowTime<>( + windowTimeSpan: number, + windowCreationInterval: number | void | null, + maxWindowSize: number, + scheduler?: SchedulerLike +): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/windowTime.ts:15](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/windowTime.ts#L15) + +### Parameters + +| Parameter | Type | +| ------------------------ | ------------------------------------------------- | +| `windowTimeSpan` | `number` | +| `windowCreationInterval` | `number` \| `void` \| `null` | +| `maxWindowSize` | `number` | +| `scheduler?` | [`SchedulerLike`](../interfaces/SchedulerLike.md) | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`Observable`](../classes/Observable.md)\<`T`\>\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/windowToggle.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/windowToggle.md new file mode 100644 index 0000000000..78f86cdf20 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/windowToggle.md @@ -0,0 +1,65 @@ +[API](../../index.md) / [rxjs](../index.md) / windowToggle + +# Function: windowToggle() + +```ts +function windowToggle<>( + openings: ObservableInput, + closingSelector: (openValue: O) => ObservableInput +): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/windowToggle.ts:52](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/windowToggle.ts#L52) + +Branch out the source Observable values as a nested Observable starting from +an emission from `openings` and ending when the output of `closingSelector` +emits. + +It's like [bufferToggle](bufferToggle.md), but emits a nested +Observable instead of an array. + +![](/images/marble-diagrams/windowToggle.png) + +Returns an Observable that emits windows of items it collects from the source +Observable. The output Observable emits windows that contain those items +emitted by the source Observable between the time when the `openings` +Observable emits an item and when the Observable returned by +`closingSelector` emits an item. + +## Parameters + +| Parameter | Type | Description | +| ----------------- | -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `openings` | [`ObservableInput`](../type-aliases/ObservableInput.md)\<`O`\> | An observable of notifications to start new windows. | +| `closingSelector` | (`openValue`: `O`) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | A function that takes the value emitted by the `openings` observable and returns an Observable, which, when it emits a next notification, signals that the associated window should complete. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`Observable`](../classes/Observable.md)\<`T`\>\> + +A function that returns an Observable of windows, which in turn are +Observables. + +## Example + +Every other second, emit the click events from the next 500ms + +```ts +import { fromEvent, interval, windowToggle, EMPTY, mergeAll } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const openings = interval(1000); +const result = clicks.pipe( + windowToggle(openings, (i) => (i % 2 ? interval(500) : EMPTY)), + mergeAll() +); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [window](window.md) +- [windowCount](windowCount.md) +- [windowTime](windowTime.md) +- [windowWhen](windowWhen.md) +- [bufferToggle](bufferToggle.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/windowWhen.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/windowWhen.md new file mode 100644 index 0000000000..19230fa6c6 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/windowWhen.md @@ -0,0 +1,64 @@ +[API](../../index.md) / [rxjs](../index.md) / windowWhen + +# Function: windowWhen() + +```ts +function windowWhen<>(closingSelector: () => ObservableInput): OperatorFunction>; +``` + +Defined in: [rxjs/src/internal/operators/windowWhen.ts:54](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/windowWhen.ts#L54) + +Branch out the source Observable values as a nested Observable using a +factory function of closing Observables to determine when to start a new +window. + +It's like [bufferWhen](bufferWhen.md), but emits a nested +Observable instead of an array. + +
Marble diagram +Marble diagram
+ +Returns an Observable that emits Observable windows of items it collects from +the source Observable. The output Observable emits connected, non-overlapping +windows. It emits the current window immediately when subscribing to the source +Observable and opens a new one whenever the Observable produced by the specified +`closingSelector` function emits `next`. When an Observable returned by the +`closingSelector` emits `next`, the previous window completes and a new window +is emitted to the output subscriber. + +## Parameters + +| Parameter | Type | Description | +| ----------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `closingSelector` | () => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | A function that takes no arguments and returns an [ObservableInput](../type-aliases/ObservableInput.md) (that gets converted to Observable) that signals when to close the previous window and start a new one. Note that a value (any value) must be observed to signal window closure. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, [`Observable`](../classes/Observable.md)\<`T`\>\> + +A function that returns an Observable of windows, which in turn are +Observables. + +## Example + +Emit only the first two clicks events in every window of [1-5] random seconds + +```ts +import { fromEvent, windowWhen, interval, map, take, mergeAll } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const result = clicks.pipe( + windowWhen(() => interval(1000 + Math.random() * 4000)), + map((win) => win.pipe(take(2))), // take at most 2 emissions from each window + mergeAll() // flatten the Observable-of-Observables +); +result.subscribe((x) => console.log(x)); +``` + +## See + +- [window](window.md) +- [windowCount](windowCount.md) +- [windowTime](windowTime.md) +- [windowToggle](windowToggle.md) +- [bufferWhen](bufferWhen.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/withLatestFrom.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/withLatestFrom.md new file mode 100644 index 0000000000..437e17760c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/withLatestFrom.md @@ -0,0 +1,94 @@ +[API](../../index.md) / [rxjs](../index.md) / withLatestFrom + +# Function: withLatestFrom() + +> Combines the source Observable with other Observables to create an Observable +> whose values are calculated from the latest values of each, only when the +> source emits. + +## Description + +Whenever the source Observable emits a value, it +computes a formula using that value plus the latest values from other input +Observables, then emits the output of that formula. + +![](/images/marble-diagrams/withLatestFrom.png) + +`withLatestFrom` combines each value from the source Observable (the +instance) with the latest values from the other input Observables only when +the source emits a value, optionally using a `project` function to determine +the value to be emitted on the output Observable. All input Observables must +emit at least one value before the output Observable will emit a value. + +## Example + +On every click event, emit an array with the latest timer event plus the click event + +```ts +import { fromEvent, interval, withLatestFrom } from 'rxjs'; + +const clicks = fromEvent(document, 'click'); +const timer = interval(1000); +const result = clicks.pipe(withLatestFrom(timer)); +result.subscribe((x) => console.log(x)); +``` + +## See + +[combineLatest](combineLatest.md) + +than one input Observables may be given as argument. If the last parameter is +a function, it will be used as a projection function for combining values +together. When the function is called, it receives all values in order of the +Observables passed, where the first parameter is a value from the source +Observable. (e.g. +`a.pipe(withLatestFrom(b, c), map(([a1, b1, c1]) => a1 + b1 + c1))`). If this +is not passed, arrays will be emitted on the output Observable. + +## Parameters + +### `inputs` + +An input Observable to combine with the source Observable. More + +## Returns + +`A` + +function that returns an Observable of projected values from the most recent values from each input Observable, or an array of the most recent values from each input Observable. + +## Call Signature + +```ts +function withLatestFrom<>(...inputs: [...ObservableInputTuple[]]): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/withLatestFrom.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/withLatestFrom.ts#L7) + +### Parameters + +| Parameter | Type | +| ----------- | ---------------------------------- | +| ...`inputs` | \[`...ObservableInputTuple[]`\] | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, \[`T`, `...O[]`\]\> + +## Call Signature + +```ts +function withLatestFrom<>(...inputs: [...ObservableInputTuple[], (...value: [T, ...O[]]) => R]): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/withLatestFrom.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/withLatestFrom.ts#L9) + +### Parameters + +| Parameter | Type | +| ----------- | -------------------------------------------------------------------------- | +| ...`inputs` | \[`...ObservableInputTuple[]`, (...`value`: \[`T`, `...O[]`\]) => `R`\] | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, `R`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/zip.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/zip.md new file mode 100644 index 0000000000..e9fb5628de --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/zip.md @@ -0,0 +1,119 @@ +[API](../../index.md) / [rxjs](../index.md) / zip + +# Function: zip() + +> Combines multiple Observables to create an Observable whose values are calculated from the values, in order, of each +> of its input Observables. + +## Description + +If the last parameter is a function, this function is used to compute the created value from the input values. +Otherwise, an array of the input values is returned. + +## Example + +Combine age and name from different sources + +```ts +import { of, zip, map } from 'rxjs'; + +const age$ = of(27, 25, 29); +const name$ = of('Foo', 'Bar', 'Beer'); +const isDev$ = of(true, true, false); + +zip(age$, name$, isDev$) + .pipe(map(([age, name, isDev]) => ({ age, name, isDev }))) + .subscribe((x) => console.log(x)); + +// Outputs +// { age: 27, name: 'Foo', isDev: true } +// { age: 25, name: 'Bar', isDev: true } +// { age: 29, name: 'Beer', isDev: false } +``` + +to combine with each other. + +## Parameters + +### `args` + +Any number of `ObservableInput`s provided either as an array or as an object + +## Returns + +`An` + +Observable of array values of the values emitted at the same index from each individual . + +## Call Signature + +```ts +function zip<>(sources: [...ObservableInputTuple
[]]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/zip.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/zip.ts#L7) + +### Parameters + +| Parameter | Type | +| --------- | ---------------------------------- | +| `sources` | \[`...ObservableInputTuple[]`\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`A`\> + +## Call Signature + +```ts +function zip<>(sources: [...ObservableInputTuple[]], resultSelector: (...values: A) => R): Observable; +``` + +Defined in: [rxjs/src/internal/observable/zip.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/zip.ts#L8) + +### Parameters + +| Parameter | Type | +| ---------------- | ---------------------------------- | +| `sources` | \[`...ObservableInputTuple[]`\] | +| `resultSelector` | (...`values`: `A`) => `R` | + +### Returns + +[`Observable`](../classes/Observable.md)\<`R`\> + +## Call Signature + +```ts +function zip<>(...sources: [...ObservableInputTuple[]]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/zip.ts:12](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/zip.ts#L12) + +### Parameters + +| Parameter | Type | +| ------------ | ---------------------------------- | +| ...`sources` | \[`...ObservableInputTuple[]`\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`A`\> + +## Call Signature + +```ts +function zip<>(...sourcesAndResultSelector: [...ObservableInputTuple[], (...values: A) => R]): Observable; +``` + +Defined in: [rxjs/src/internal/observable/zip.ts:13](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/zip.ts#L13) + +### Parameters + +| Parameter | Type | +| ----------------------------- | ------------------------------------------------------------- | +| ...`sourcesAndResultSelector` | \[`...ObservableInputTuple[]`, (...`values`: `A`) => `R`\] | + +### Returns + +[`Observable`](../classes/Observable.md)\<`R`\> diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/zipAll.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/zipAll.md new file mode 100644 index 0000000000..13b94f1c3c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/zipAll.md @@ -0,0 +1,99 @@ +[API](../../index.md) / [rxjs](../index.md) / zipAll + +# Function: zipAll() + +## Call Signature + +```ts +function zipAll<>(): OperatorFunction, T[]>; +``` + +Defined in: [rxjs/src/internal/operators/zipAll.ts:13](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/zipAll.ts#L13) + +Collects all observable inner sources from the source, once the source completes, +it will subscribe to all inner sources, combining their values by index and emitting +them. + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<[`ObservableInput`](../type-aliases/ObservableInput.md)\<`T`\>, `T`[]\> + +### See + +- [zipWith](zipWith.md) +- [zip](zip.md) + +## Call Signature + +```ts +function zipAll<>(): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/zipAll.ts:14](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/zipAll.ts#L14) + +Collects all observable inner sources from the source, once the source completes, +it will subscribe to all inner sources, combining their values by index and emitting +them. + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`any`, `T`[]\> + +### See + +- [zipWith](zipWith.md) +- [zip](zip.md) + +## Call Signature + +```ts +function zipAll<>(project: (...values: T[]) => R): OperatorFunction, R>; +``` + +Defined in: [rxjs/src/internal/operators/zipAll.ts:15](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/zipAll.ts#L15) + +Collects all observable inner sources from the source, once the source completes, +it will subscribe to all inner sources, combining their values by index and emitting +them. + +### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `project` | (...`values`: `T`[]) => `R` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<[`ObservableInput`](../type-aliases/ObservableInput.md)\<`T`\>, `R`\> + +### See + +- [zipWith](zipWith.md) +- [zip](zip.md) + +## Call Signature + +```ts +function zipAll<>(project: (...values: any[]) => R): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/zipAll.ts:16](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/zipAll.ts#L16) + +Collects all observable inner sources from the source, once the source completes, +it will subscribe to all inner sources, combining their values by index and emitting +them. + +### Parameters + +| Parameter | Type | +| --------- | ----------------------------- | +| `project` | (...`values`: `any`[]) => `R` | + +### Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`any`, `R`\> + +### See + +- [zipWith](zipWith.md) +- [zip](zip.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/functions/zipWith.md b/apps/rxjs.dev-next/docs/api/rxjs/functions/zipWith.md new file mode 100644 index 0000000000..e70e729f5a --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/functions/zipWith.md @@ -0,0 +1,40 @@ +[API](../../index.md) / [rxjs](../index.md) / zipWith + +# Function: zipWith() + +```ts +function zipWith<>(...otherInputs: [...ObservableInputTuple[]]): OperatorFunction; +``` + +Defined in: [rxjs/src/internal/operators/zipWith.ts:28](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/zipWith.ts#L28) + +Subscribes to the source, and the observable inputs provided as arguments, and combines their values, by index, into arrays. + +What is meant by "combine by index": The first value from each will be made into a single array, then emitted, +then the second value from each will be combined into a single array and emitted, then the third value +from each will be combined into a single array and emitted, and so on. + +This will continue until it is no longer able to combine values of the same index into an array. + +After the last value from any one completed source is emitted in an array, the resulting observable will complete, +as there is no way to continue "zipping" values together by index. + +Use-cases for this operator are limited. There are memory concerns if one of the streams is emitting +values at a much faster rate than the others. Usage should likely be limited to streams that emit +at a similar pace, or finite streams of known length. + +In many cases, authors want `combineLatestWith` and not `zipWith`. + +## Parameters + +| Parameter | Type | Description | +| ---------------- | ---------------------------------- | ----------------------------------------------- | +| ...`otherInputs` | \[`...ObservableInputTuple[]`\] | other observable inputs to collate values from. | + +## Returns + +[`OperatorFunction`](../interfaces/OperatorFunction.md)\<`T`, \[`T`, `...rest: A[]`\]\> + +A function that returns an Observable that emits items by index +combined from the source Observable and provided Observables, in form of an +array. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/index.md b/apps/rxjs.dev-next/docs/api/rxjs/index.md new file mode 100644 index 0000000000..d1944c4392 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/index.md @@ -0,0 +1,224 @@ +[API](../index.md) / rxjs + +# rxjs + +## Classes + +- [ArgumentOutOfRangeError](classes/ArgumentOutOfRangeError.md) +- [AsyncSubject](classes/AsyncSubject.md) +- [BehaviorSubject](classes/BehaviorSubject.md) +- [EmptyError](classes/EmptyError.md) +- [NotFoundError](classes/NotFoundError.md) +- [Observable](classes/Observable.md) +- [ReplaySubject](classes/ReplaySubject.md) +- [~~Scheduler~~](classes/Scheduler.md) +- [SequenceError](classes/SequenceError.md) +- [Subject](classes/Subject.md) +- [Subscriber](classes/Subscriber.md) +- [Subscription](classes/Subscription.md) +- [TimeoutError](classes/TimeoutError.md) +- [UnsubscriptionError](classes/UnsubscriptionError.md) +- [VirtualAction](classes/VirtualAction.md) +- [VirtualTimeScheduler](classes/VirtualTimeScheduler.md) + +## Interfaces + +- [BasicGroupByOptions](interfaces/BasicGroupByOptions.md) +- [CompleteNotification](interfaces/CompleteNotification.md) +- [CompletionObserver](interfaces/CompletionObserver.md) +- [Connectable](interfaces/Connectable.md) +- [ConnectConfig](interfaces/ConnectConfig.md) +- [ErrorNotification](interfaces/ErrorNotification.md) +- [ErrorObserver](interfaces/ErrorObserver.md) +- [GlobalConfig](interfaces/GlobalConfig.md) +- [GroupByOptionsWithElement](interfaces/GroupByOptionsWithElement.md) +- [GroupedObservable](interfaces/GroupedObservable.md) +- [InteropObservable](interfaces/InteropObservable.md) +- [MonoTypeOperatorFunction](interfaces/MonoTypeOperatorFunction.md) +- [NextNotification](interfaces/NextNotification.md) +- [NextObserver](interfaces/NextObserver.md) +- [Observer](interfaces/Observer.md) +- [~~Operator~~](interfaces/Operator.md) +- [OperatorFunction](interfaces/OperatorFunction.md) +- [RepeatConfig](interfaces/RepeatConfig.md) +- [RetryConfig](interfaces/RetryConfig.md) +- [SchedulerAction](interfaces/SchedulerAction.md) +- [SchedulerLike](interfaces/SchedulerLike.md) +- [ShareConfig](interfaces/ShareConfig.md) +- [ShareReplayConfig](interfaces/ShareReplayConfig.md) +- [SubjectLike](interfaces/SubjectLike.md) +- [Subscribable](interfaces/Subscribable.md) +- [SubscriberOverrides](interfaces/SubscriberOverrides.md) +- [SubscriptionLike](interfaces/SubscriptionLike.md) +- [TapObserver](interfaces/TapObserver.md) +- [ThrottleConfig](interfaces/ThrottleConfig.md) +- [TimeInterval](interfaces/TimeInterval.md) +- [TimeoutConfig](interfaces/TimeoutConfig.md) +- [TimeoutInfo](interfaces/TimeoutInfo.md) +- [Timestamp](interfaces/Timestamp.md) +- [TimestampProvider](interfaces/TimestampProvider.md) +- [UnaryFunction](interfaces/UnaryFunction.md) +- [Unsubscribable](interfaces/Unsubscribable.md) + +## Type Aliases + +- [Cons](type-aliases/Cons.md) +- [FactoryOrValue](type-aliases/FactoryOrValue.md) +- [Falsy](type-aliases/Falsy.md) +- [Head](type-aliases/Head.md) +- [ObservableInput](type-aliases/ObservableInput.md) +- [ObservableInputTuple](type-aliases/ObservableInputTuple.md) +- [ObservableNotification](type-aliases/ObservableNotification.md) +- [ObservedValueOf](type-aliases/ObservedValueOf.md) +- [ObservedValueTupleFromArray](type-aliases/ObservedValueTupleFromArray.md) +- [ObservedValueUnionFromArray](type-aliases/ObservedValueUnionFromArray.md) +- [PartialObserver](type-aliases/PartialObserver.md) +- [ReadableStreamLike](type-aliases/ReadableStreamLike.md) +- [Tail](type-aliases/Tail.md) +- [TeardownLogic](type-aliases/TeardownLogic.md) +- [TruthyTypesOf](type-aliases/TruthyTypesOf.md) +- [ValueFromArray](type-aliases/ValueFromArray.md) +- [ValueFromNotification](type-aliases/ValueFromNotification.md) + +## Variables + +- [animationFrameScheduler](variables/animationFrameScheduler.md) +- [asapScheduler](variables/asapScheduler.md) +- [asyncScheduler](variables/asyncScheduler.md) +- [config](variables/config.md) +- [EMPTY](variables/EMPTY.md) +- [NEVER](variables/NEVER.md) +- [queueScheduler](variables/queueScheduler.md) + +## Functions + +- [animationFrames](functions/animationFrames.md) +- [audit](functions/audit.md) +- [auditTime](functions/auditTime.md) +- [bindCallback](functions/bindCallback.md) +- [bindNodeCallback](functions/bindNodeCallback.md) +- [buffer](functions/buffer.md) +- [bufferCount](functions/bufferCount.md) +- [bufferTime](functions/bufferTime.md) +- [bufferToggle](functions/bufferToggle.md) +- [bufferWhen](functions/bufferWhen.md) +- [catchError](functions/catchError.md) +- [combineLatest](functions/combineLatest.md) +- [combineLatestAll](functions/combineLatestAll.md) +- [combineLatestWith](functions/combineLatestWith.md) +- [concat](functions/concat.md) +- [concatAll](functions/concatAll.md) +- [concatMap](functions/concatMap.md) +- [~~concatMapTo~~](functions/concatMapTo.md) +- [concatWith](functions/concatWith.md) +- [connect](functions/connect.md) +- [connectable](functions/connectable.md) +- [count](functions/count.md) +- [debounce](functions/debounce.md) +- [debounceTime](functions/debounceTime.md) +- [defaultIfEmpty](functions/defaultIfEmpty.md) +- [defer](functions/defer.md) +- [delay](functions/delay.md) +- [~~delayWhen~~](functions/delayWhen.md) +- [dematerialize](functions/dematerialize.md) +- [distinct](functions/distinct.md) +- [distinctUntilChanged](functions/distinctUntilChanged.md) +- [distinctUntilKeyChanged](functions/distinctUntilKeyChanged.md) +- [elementAt](functions/elementAt.md) +- [endWith](functions/endWith.md) +- [every](functions/every.md) +- [exhaustAll](functions/exhaustAll.md) +- [exhaustMap](functions/exhaustMap.md) +- [expand](functions/expand.md) +- [~~filter~~](functions/filter.md) +- [finalize](functions/finalize.md) +- [find](functions/find.md) +- [findIndex](functions/findIndex.md) +- [first](functions/first.md) +- [firstValueFrom](functions/firstValueFrom.md) +- [forkJoin](functions/forkJoin.md) +- [from](functions/from.md) +- [fromEvent](functions/fromEvent.md) +- [fromEventPattern](functions/fromEventPattern.md) +- [generate](functions/generate.md) +- [groupBy](functions/groupBy.md) +- [identity](functions/identity.md) +- [ignoreElements](functions/ignoreElements.md) +- [iif](functions/iif.md) +- [interval](functions/interval.md) +- [isEmpty](functions/isEmpty.md) +- [isObservable](functions/isObservable.md) +- [last](functions/last.md) +- [lastValueFrom](functions/lastValueFrom.md) +- [map](functions/map.md) +- [~~mapTo~~](functions/mapTo.md) +- [materialize](functions/materialize.md) +- [max](functions/max.md) +- [merge](functions/merge.md) +- [mergeAll](functions/mergeAll.md) +- [mergeMap](functions/mergeMap.md) +- [~~mergeMapTo~~](functions/mergeMapTo.md) +- [mergeScan](functions/mergeScan.md) +- [mergeWith](functions/mergeWith.md) +- [min](functions/min.md) +- [noop](functions/noop.md) +- [observeOn](functions/observeOn.md) +- [of](functions/of.md) +- [onErrorResumeNext](functions/onErrorResumeNext.md) +- [onErrorResumeNextWith](functions/onErrorResumeNextWith.md) +- [operate](functions/operate.md) +- [pairwise](functions/pairwise.md) +- [~~partition~~](functions/partition.md) +- [pipe](functions/pipe.md) +- [race](functions/race.md) +- [raceWith](functions/raceWith.md) +- [range](functions/range.md) +- [reduce](functions/reduce.md) +- [repeat](functions/repeat.md) +- [~~repeatWhen~~](functions/repeatWhen.md) +- [retry](functions/retry.md) +- [~~retryWhen~~](functions/retryWhen.md) +- [rx](functions/rx.md) +- [sample](functions/sample.md) +- [sampleTime](functions/sampleTime.md) +- [scan](functions/scan.md) +- [scheduled](functions/scheduled.md) +- [sequenceEqual](functions/sequenceEqual.md) +- [share](functions/share.md) +- [shareReplay](functions/shareReplay.md) +- [single](functions/single.md) +- [skip](functions/skip.md) +- [skipLast](functions/skipLast.md) +- [skipUntil](functions/skipUntil.md) +- [skipWhile](functions/skipWhile.md) +- [startWith](functions/startWith.md) +- [subscribeOn](functions/subscribeOn.md) +- [switchAll](functions/switchAll.md) +- [switchMap](functions/switchMap.md) +- [~~switchMapTo~~](functions/switchMapTo.md) +- [switchScan](functions/switchScan.md) +- [take](functions/take.md) +- [takeLast](functions/takeLast.md) +- [takeUntil](functions/takeUntil.md) +- [takeWhile](functions/takeWhile.md) +- [tap](functions/tap.md) +- [throttle](functions/throttle.md) +- [throttleTime](functions/throttleTime.md) +- [throwError](functions/throwError.md) +- [throwIfEmpty](functions/throwIfEmpty.md) +- [timeInterval](functions/timeInterval.md) +- [timeout](functions/timeout.md) +- [~~timeoutWith~~](functions/timeoutWith.md) +- [timer](functions/timer.md) +- [timestamp](functions/timestamp.md) +- [toArray](functions/toArray.md) +- [using](functions/using.md) +- [window](functions/window.md) +- [windowCount](functions/windowCount.md) +- [windowTime](functions/windowTime.md) +- [windowToggle](functions/windowToggle.md) +- [windowWhen](functions/windowWhen.md) +- [withLatestFrom](functions/withLatestFrom.md) +- [zip](functions/zip.md) +- [zipAll](functions/zipAll.md) +- [zipWith](functions/zipWith.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/BasicGroupByOptions.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/BasicGroupByOptions.md new file mode 100644 index 0000000000..b412ec6408 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/BasicGroupByOptions.md @@ -0,0 +1,13 @@ +[API](../../index.md) / [rxjs](../index.md) / BasicGroupByOptions + +# Interface: BasicGroupByOptions + +Defined in: [rxjs/src/internal/operators/groupBy.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/groupBy.ts#L5) + +## Properties + +| Property | Type | +| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `connector?` | () => [`SubjectLike`](SubjectLike.md)\<`T`\> | +| `duration?` | (`grouped`: [`GroupedObservable`](GroupedObservable.md)\<`K`, `T`\>) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | +| `element?` | `undefined` | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/CompleteNotification.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/CompleteNotification.md new file mode 100644 index 0000000000..a430f9a239 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/CompleteNotification.md @@ -0,0 +1,19 @@ +[API](../../index.md) / [rxjs](../index.md) / CompleteNotification + +# Interface: CompleteNotification + +## Description + +A notification representing a "completion" from an observable. +Can be used with [dematerialize](../functions/dematerialize.md). + +Defined in: [rxjs/src/internal/types.ts:140](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L140) + +A notification representing a "completion" from an observable. +Can be used with [dematerialize](../functions/dematerialize.md). + +## Properties + +| Property | Type | +| ------------------------ | ----- | +| `kind` | `"C"` | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/CompletionObserver.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/CompletionObserver.md new file mode 100644 index 0000000000..d7750fa401 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/CompletionObserver.md @@ -0,0 +1,14 @@ +[API](../../index.md) / [rxjs](../index.md) / CompletionObserver + +# Interface: CompletionObserver + +Defined in: [rxjs/src/internal/types.ts:165](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L165) + +## Properties + +| Property | Type | +| -------------------------------- | ------------------------ | +| `closed?` | `boolean` | +| `complete` | () => `void` | +| `error?` | (`err`: `any`) => `void` | +| `next?` | (`value`: `T`) => `void` | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ConnectConfig.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ConnectConfig.md new file mode 100644 index 0000000000..6b587c142d --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ConnectConfig.md @@ -0,0 +1,17 @@ +[API](../../index.md) / [rxjs](../index.md) / ConnectConfig + +# Interface: ConnectConfig + +## Description + +An object used to configure [connect](../functions/connect.md) operator. + +Defined in: [rxjs/src/internal/operators/connect.ts:9](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/connect.ts#L9) + +An object used to configure [connect](../functions/connect.md) operator. + +## Properties + +| Property | Type | Description | +| ---------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `connector` | () => [`SubjectLike`](SubjectLike.md)\<`T`\> | A factory function used to create the Subject through which the source is multicast. By default, this creates a [Subject](../classes/Subject.md). | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Connectable.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Connectable.md new file mode 100644 index 0000000000..8007dc7267 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Connectable.md @@ -0,0 +1,610 @@ +[API](../../index.md) / [rxjs](../index.md) / Connectable + +# Interface: Connectable + +## Description + +An observable with a `connect` method that is used to create a subscription +to an underlying source, connecting it with all consumers via a multicast. + +Defined in: [rxjs/src/internal/types.ts:329](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L329) + +An observable with a `connect` method that is used to create a subscription +to an underlying source, connecting it with all consumers via a multicast. + +## Extends + +- [`Observable`](../classes/Observable.md)\<`T`\> + +## Methods + +### \[asyncIterator\]() + +```ts +asyncIterator: AsyncGenerator; +``` + +Defined in: [observable/src/observable.ts:922](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L922) + +Observable is async iterable, so it can be used in `for await` loop. This method +of subscription is cancellable by breaking the for await loop. Although it's not +recommended to use Observable's AsyncIterable contract outside of `for await`, if +you're consuming the Observable as an AsyncIterable, and you're _not_ using `for await`, +you can use the `throw` or `return` methods on the `AsyncGenerator` we return to +cancel the subscription. Note that the subscription to the observable does not start +until the first value is requested from the AsyncIterable. + +Functionally, this is equivalent to using a [concatMap](../functions/concatMap.md) with an `async` function. +That means that while the body of the `for await` loop is executing, any values that arrive +from the observable source will be queued up, so they can be processed by the `for await` +loop in order. So, like [concatMap](../functions/concatMap.md) it's important to understand the speed your +source emits at, and the speed of the body of your `for await` loop. + +#### Returns + +`AsyncGenerator`\<`T`, `void`, `void`\> + +#### Example + +```ts +import { interval } from 'rxjs'; + +async function main() { + // Subscribe to the observable using for await. + for await (const value of interval(1000)) { + console.log(value); + + if (value > 5) { + // Unsubscribe from the interval if we get a value greater than 5 + break; + } + } +} + +main(); +``` + +#### Inherited from + +[`Observable`](../classes/Observable.md).[`[asyncIterator]`](../classes/Observable.md#asynciterator) + +### connect() + +```ts +connect(): Subscription; +``` + +Defined in: [rxjs/src/internal/types.ts:336](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L336) + +(Idempotent) Calling this method will connect the underlying source observable to all subscribed consumers +through an underlying [Subject](../classes/Subject.md). + +#### Returns + +[`Subscription`](../classes/Subscription.md) + +A subscription, that when unsubscribed, will "disconnect" the source from the connector subject, +severing notifications to all consumers. + +### forEach() + +```ts +forEach(next: (value: T) => void): Promise; +``` + +Defined in: [observable/src/observable.ts:757](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L757) + +Used as a NON-CANCELLABLE means of subscribing to an observable, for use with +APIs that expect promises, like `async/await`. You cannot unsubscribe from this. + +**WARNING**: Only use this with observables you _know_ will complete. If the source +observable does not complete, you will end up with a promise that is hung up, and +potentially all of the state of an async function hanging out in memory. To avoid +this situation, look into adding something like [timeout](../functions/timeout.md), [take](../functions/take.md), +[takeWhile](../functions/takeWhile.md), or [takeUntil](../functions/takeUntil.md) amongst others. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ------------------------ | --------------------------------------------------- | +| `next` | (`value`: `T`) => `void` | A handler for each value emitted by the observable. | + +#### Returns + +`Promise`\<`void`\> + +A promise that either resolves on observable completion or +rejects with the handled error. + +#### Example + +```ts +import { interval, take } from 'rxjs'; + +const source$ = interval(1000).pipe(take(4)); + +async function getTotal() { + let total = 0; + + await source$.forEach((value) => { + total += value; + console.log('observable -> ' + value); + }); + + return total; +} + +getTotal().then((total) => console.log('Total: ' + total)); + +// Expected: +// 'observable -> 0' +// 'observable -> 1' +// 'observable -> 2' +// 'observable -> 3' +// 'Total: 6' +``` + +#### Inherited from + +[`Observable`](../classes/Observable.md).[`forEach`](../classes/Observable.md#foreach) + +### pipe() + +Used to stitch together functional operators into a chain. + +#### Example + +```ts +import { interval, filter, map, scan } from 'rxjs'; + +interval(1000) + .pipe( + filter((x) => x % 2 === 0), + map((x) => x + x), + scan((acc, x) => acc + x) + ) + .subscribe((x) => console.log(x)); +``` + +#### Call Signature + +```ts +pipe(): Observable; +``` + +Defined in: [observable/src/observable.ts:788](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L788) + +##### Returns + +[`Observable`](../classes/Observable.md)\<`T`\> + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>): A; +``` + +Defined in: [observable/src/observable.ts:789](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L789) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | + +##### Returns + +`A` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>, op2: UnaryFunction): B; +``` + +Defined in: [observable/src/observable.ts:790](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L790) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | + +##### Returns + +`B` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction): C; +``` + +Defined in: [observable/src/observable.ts:791](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L791) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | + +##### Returns + +`C` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction): D; +``` + +Defined in: [observable/src/observable.ts:792](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L792) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | + +##### Returns + +`D` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction): E; +``` + +Defined in: [observable/src/observable.ts:793](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L793) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | + +##### Returns + +`E` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction): F; +``` + +Defined in: [observable/src/observable.ts:800](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L800) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | + +##### Returns + +`F` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction): G; +``` + +Defined in: [observable/src/observable.ts:808](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L808) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | + +##### Returns + +`G` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction): H; +``` + +Defined in: [observable/src/observable.ts:817](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L817) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | + +##### Returns + +`H` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction): I; +``` + +Defined in: [observable/src/observable.ts:827](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L827) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | + +##### Returns + +`I` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... +operations: OperatorFunction[]): Observable; +``` + +Defined in: [observable/src/observable.ts:838](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L838) + +##### Parameters + +| Parameter | Type | +| --------------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `OperatorFunction`\<`any`, `any`\>[] | + +##### Returns + +[`Observable`](../classes/Observable.md)\<`unknown`\> + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... + operations: UnaryFunction[]): unknown; +``` + +Defined in: [observable/src/observable.ts:850](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L850) + +##### Parameters + +| Parameter | Type | +| --------------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `UnaryFunction`\<`any`, `any`\>[] | + +##### Returns + +`unknown` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +### subscribe() + +```ts +subscribe(observerOrNext?: Partial> | (value: T) => void | null): Subscription; +``` + +Defined in: [observable/src/observable.ts:695](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L695) + +Invokes an execution of an Observable and registers Observer handlers for notifications it will emit. + +Use it when you have all these Observables, but still nothing is happening. + +`subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It +might be for example a function that you passed to Observable's constructor, but most of the time it is +a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means +that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often +the thought. + +Apart from starting the execution of an Observable, this method allows you to listen for values +that an Observable emits, as well as for when it completes or errors. You can achieve this in two +of the following ways. + +The first way is creating an object that implements [Observer](Observer.md) interface. It should have methods +defined by that interface, but note that it should be just a regular JavaScript object, which you can create +yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do +not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also +that your object does not have to implement all methods. If you find yourself creating a method that doesn't +do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens, +it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead, +use the [onUnhandledError](GlobalConfig.md#onunhandlederror) configuration option or use a runtime handler (like `window.onerror` or +`process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide +an `error` method to avoid missing thrown errors. + +The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods. +This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent +of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer, +if you do not need to listen for something, you can omit a function by passing `undefined` or `null`, +since `subscribe` recognizes these functions by where they were placed in function call. When it comes +to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously. + +You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events +and you also handled emissions internally by using operators (e.g. using `tap`). + +Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object. +This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean +up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback +provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable. + +Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously. +It is an Observable itself that decides when these functions will be called. For example [of](../functions/of.md) +by default emits all its values synchronously. Always check documentation for how given Observable +will behave when subscribed and if its default behavior can be modified with a `scheduler`. + +#### Parameters + +| Parameter | Type | Description | +| ----------------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `observerOrNext?` | `Partial`\<`Observer`\<`T`\>\> \| (`value`: `T`) => `void` \| `null` | Either an [Observer](Observer.md) with some or all callback methods, or the `next` handler that is called for each value emitted from the subscribed Observable. | + +#### Returns + +[`Subscription`](../classes/Subscription.md) + +A subscription reference to the registered handlers. + +#### Inherited from + +[`Observable`](../classes/Observable.md).[`subscribe`](../classes/Observable.md#subscribe) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ErrorNotification.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ErrorNotification.md new file mode 100644 index 0000000000..aad440dec8 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ErrorNotification.md @@ -0,0 +1,20 @@ +[API](../../index.md) / [rxjs](../index.md) / ErrorNotification + +# Interface: ErrorNotification + +## Description + +A notification representing an "error" from an observable. +Can be used with [dematerialize](../functions/dematerialize.md). + +Defined in: [rxjs/src/internal/types.ts:130](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L130) + +A notification representing an "error" from an observable. +Can be used with [dematerialize](../functions/dematerialize.md). + +## Properties + +| Property | Type | Description | +| -------------------------- | ----- | ------------------------------------ | +| `error` | `any` | - | +| `kind` | `"E"` | The kind of notification. Always "E" | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ErrorObserver.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ErrorObserver.md new file mode 100644 index 0000000000..68d2b7dc8a --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ErrorObserver.md @@ -0,0 +1,14 @@ +[API](../../index.md) / [rxjs](../index.md) / ErrorObserver + +# Interface: ErrorObserver + +Defined in: [rxjs/src/internal/types.ts:158](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L158) + +## Properties + +| Property | Type | +| --------------------------------- | ------------------------ | +| `closed?` | `boolean` | +| `complete?` | () => `void` | +| `error` | (`err`: `any`) => `void` | +| `next?` | (`value`: `T`) => `void` | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/GlobalConfig.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/GlobalConfig.md new file mode 100644 index 0000000000..038d8cc71b --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/GlobalConfig.md @@ -0,0 +1,22 @@ +[API](../../index.md) / [rxjs](../index.md) / GlobalConfig + +# Interface: GlobalConfig + +## Description + +The global configuration object for RxJS, used to configure things +like how to react on unhandled errors. Accessible via [config](../variables/config.md) +object. + +Defined in: [observable/src/observable.ts:397](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L397) + +The global configuration object for RxJS, used to configure things +like how to react on unhandled errors. Accessible via [config](../variables/config.md) +object. + +## Properties + +| Property | Type | Description | +| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `onStoppedNotification` | \| (`notification`: `ObservableNotification`\<`any`\>, `subscriber`: [`Subscriber`](../classes/Subscriber.md)\<`any`\>) => `void` \| `null` | A registration point for notifications that cannot be sent to subscribers because they have completed, errored or have been explicitly unsubscribed. By default, next, complete and error notifications sent to stopped subscribers are noops. However, sometimes callers might want a different behavior. For example, with sources that attempt to report errors to stopped subscribers, a caller can configure RxJS to throw an unhandled error instead. This will _always_ be called asynchronously on another job in the runtime. This is because we do not want errors thrown in this user-configured handler to interfere with the behavior of the library. | +| `onUnhandledError` | (`err`: `any`) => `void` \| `null` | A registration point for unhandled errors from RxJS. These are errors that cannot were not handled by consuming code in the usual subscription path. For example, if you have this configured, and you subscribe to an observable without providing an error handler, errors from that subscription will end up here. This will _always_ be called asynchronously on another job in the runtime. This is because we do not want errors thrown in this user-configured handler to interfere with the behavior of the library. | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/GroupByOptionsWithElement.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/GroupByOptionsWithElement.md new file mode 100644 index 0000000000..674e2e9e2c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/GroupByOptionsWithElement.md @@ -0,0 +1,13 @@ +[API](../../index.md) / [rxjs](../index.md) / GroupByOptionsWithElement + +# Interface: GroupByOptionsWithElement + +Defined in: [rxjs/src/internal/operators/groupBy.ts:11](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/groupBy.ts#L11) + +## Properties + +| Property | Type | +| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `connector?` | () => [`SubjectLike`](SubjectLike.md)\<`E`\> | +| `duration?` | (`grouped`: [`GroupedObservable`](GroupedObservable.md)\<`K`, `E`\>) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | +| `element` | (`value`: `T`) => `E` | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/GroupedObservable.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/GroupedObservable.md new file mode 100644 index 0000000000..da8e445e49 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/GroupedObservable.md @@ -0,0 +1,598 @@ +[API](../../index.md) / [rxjs](../index.md) / GroupedObservable + +# Interface: GroupedObservable + +## Description + +An observable of values that is the emitted by the result of a [groupBy](../functions/groupBy.md) operator, +contains a `key` property for the grouping. + +Defined in: [rxjs/src/internal/operators/groupBy.ts:252](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/groupBy.ts#L252) + +An observable of values that is the emitted by the result of a [groupBy](../functions/groupBy.md) operator, +contains a `key` property for the grouping. + +## Extends + +- [`Observable`](../classes/Observable.md)\<`T`\> + +## Properties + +| Property | Type | Description | +| ---------------------- | ---- | -------------------------------------------- | +| `key` | `K` | The key value for the grouped notifications. | + +## Methods + +### \[asyncIterator\]() + +```ts +asyncIterator: AsyncGenerator; +``` + +Defined in: [observable/src/observable.ts:922](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L922) + +Observable is async iterable, so it can be used in `for await` loop. This method +of subscription is cancellable by breaking the for await loop. Although it's not +recommended to use Observable's AsyncIterable contract outside of `for await`, if +you're consuming the Observable as an AsyncIterable, and you're _not_ using `for await`, +you can use the `throw` or `return` methods on the `AsyncGenerator` we return to +cancel the subscription. Note that the subscription to the observable does not start +until the first value is requested from the AsyncIterable. + +Functionally, this is equivalent to using a [concatMap](../functions/concatMap.md) with an `async` function. +That means that while the body of the `for await` loop is executing, any values that arrive +from the observable source will be queued up, so they can be processed by the `for await` +loop in order. So, like [concatMap](../functions/concatMap.md) it's important to understand the speed your +source emits at, and the speed of the body of your `for await` loop. + +#### Returns + +`AsyncGenerator`\<`T`, `void`, `void`\> + +#### Example + +```ts +import { interval } from 'rxjs'; + +async function main() { + // Subscribe to the observable using for await. + for await (const value of interval(1000)) { + console.log(value); + + if (value > 5) { + // Unsubscribe from the interval if we get a value greater than 5 + break; + } + } +} + +main(); +``` + +#### Inherited from + +[`Observable`](../classes/Observable.md).[`[asyncIterator]`](../classes/Observable.md#asynciterator) + +### forEach() + +```ts +forEach(next: (value: T) => void): Promise; +``` + +Defined in: [observable/src/observable.ts:757](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L757) + +Used as a NON-CANCELLABLE means of subscribing to an observable, for use with +APIs that expect promises, like `async/await`. You cannot unsubscribe from this. + +**WARNING**: Only use this with observables you _know_ will complete. If the source +observable does not complete, you will end up with a promise that is hung up, and +potentially all of the state of an async function hanging out in memory. To avoid +this situation, look into adding something like [timeout](../functions/timeout.md), [take](../functions/take.md), +[takeWhile](../functions/takeWhile.md), or [takeUntil](../functions/takeUntil.md) amongst others. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ------------------------ | --------------------------------------------------- | +| `next` | (`value`: `T`) => `void` | A handler for each value emitted by the observable. | + +#### Returns + +`Promise`\<`void`\> + +A promise that either resolves on observable completion or +rejects with the handled error. + +#### Example + +```ts +import { interval, take } from 'rxjs'; + +const source$ = interval(1000).pipe(take(4)); + +async function getTotal() { + let total = 0; + + await source$.forEach((value) => { + total += value; + console.log('observable -> ' + value); + }); + + return total; +} + +getTotal().then((total) => console.log('Total: ' + total)); + +// Expected: +// 'observable -> 0' +// 'observable -> 1' +// 'observable -> 2' +// 'observable -> 3' +// 'Total: 6' +``` + +#### Inherited from + +[`Observable`](../classes/Observable.md).[`forEach`](../classes/Observable.md#foreach) + +### pipe() + +Used to stitch together functional operators into a chain. + +#### Example + +```ts +import { interval, filter, map, scan } from 'rxjs'; + +interval(1000) + .pipe( + filter((x) => x % 2 === 0), + map((x) => x + x), + scan((acc, x) => acc + x) + ) + .subscribe((x) => console.log(x)); +``` + +#### Call Signature + +```ts +pipe(): Observable; +``` + +Defined in: [observable/src/observable.ts:788](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L788) + +##### Returns + +[`Observable`](../classes/Observable.md)\<`T`\> + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>): A; +``` + +Defined in: [observable/src/observable.ts:789](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L789) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | + +##### Returns + +`A` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>, op2: UnaryFunction): B; +``` + +Defined in: [observable/src/observable.ts:790](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L790) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | + +##### Returns + +`B` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction): C; +``` + +Defined in: [observable/src/observable.ts:791](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L791) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | + +##### Returns + +`C` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction): D; +``` + +Defined in: [observable/src/observable.ts:792](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L792) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | + +##### Returns + +`D` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction): E; +``` + +Defined in: [observable/src/observable.ts:793](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L793) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | + +##### Returns + +`E` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction): F; +``` + +Defined in: [observable/src/observable.ts:800](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L800) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | + +##### Returns + +`F` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction): G; +``` + +Defined in: [observable/src/observable.ts:808](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L808) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | + +##### Returns + +`G` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction): H; +``` + +Defined in: [observable/src/observable.ts:817](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L817) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | + +##### Returns + +`H` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction): I; +``` + +Defined in: [observable/src/observable.ts:827](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L827) + +##### Parameters + +| Parameter | Type | +| --------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | + +##### Returns + +`I` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... +operations: OperatorFunction[]): Observable; +``` + +Defined in: [observable/src/observable.ts:838](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L838) + +##### Parameters + +| Parameter | Type | +| --------------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `OperatorFunction`\<`any`, `any`\>[] | + +##### Returns + +[`Observable`](../classes/Observable.md)\<`unknown`\> + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... + operations: UnaryFunction[]): unknown; +``` + +Defined in: [observable/src/observable.ts:850](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L850) + +##### Parameters + +| Parameter | Type | +| --------------- | ----------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../classes/Observable.md)\<`T`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `UnaryFunction`\<`any`, `any`\>[] | + +##### Returns + +`unknown` + +##### Inherited from + +[`Observable`](../classes/Observable.md).[`pipe`](../classes/Observable.md#pipe) + +### subscribe() + +```ts +subscribe(observerOrNext?: Partial> | (value: T) => void | null): Subscription; +``` + +Defined in: [observable/src/observable.ts:695](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L695) + +Invokes an execution of an Observable and registers Observer handlers for notifications it will emit. + +Use it when you have all these Observables, but still nothing is happening. + +`subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It +might be for example a function that you passed to Observable's constructor, but most of the time it is +a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means +that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often +the thought. + +Apart from starting the execution of an Observable, this method allows you to listen for values +that an Observable emits, as well as for when it completes or errors. You can achieve this in two +of the following ways. + +The first way is creating an object that implements [Observer](Observer.md) interface. It should have methods +defined by that interface, but note that it should be just a regular JavaScript object, which you can create +yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do +not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also +that your object does not have to implement all methods. If you find yourself creating a method that doesn't +do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens, +it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead, +use the [onUnhandledError](GlobalConfig.md#onunhandlederror) configuration option or use a runtime handler (like `window.onerror` or +`process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide +an `error` method to avoid missing thrown errors. + +The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods. +This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent +of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer, +if you do not need to listen for something, you can omit a function by passing `undefined` or `null`, +since `subscribe` recognizes these functions by where they were placed in function call. When it comes +to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously. + +You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events +and you also handled emissions internally by using operators (e.g. using `tap`). + +Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object. +This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean +up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback +provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable. + +Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously. +It is an Observable itself that decides when these functions will be called. For example [of](../functions/of.md) +by default emits all its values synchronously. Always check documentation for how given Observable +will behave when subscribed and if its default behavior can be modified with a `scheduler`. + +#### Parameters + +| Parameter | Type | Description | +| ----------------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `observerOrNext?` | `Partial`\<`Observer`\<`T`\>\> \| (`value`: `T`) => `void` \| `null` | Either an [Observer](Observer.md) with some or all callback methods, or the `next` handler that is called for each value emitted from the subscribed Observable. | + +#### Returns + +[`Subscription`](../classes/Subscription.md) + +A subscription reference to the registered handlers. + +#### Inherited from + +[`Observable`](../classes/Observable.md).[`subscribe`](../classes/Observable.md#subscribe) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/InteropObservable.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/InteropObservable.md new file mode 100644 index 0000000000..fbd90c03b9 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/InteropObservable.md @@ -0,0 +1,17 @@ +[API](../../index.md) / [rxjs](../index.md) / InteropObservable + +# Interface: InteropObservable + +## Description + +An object that implements the `Symbol.observable` interface. + +Defined in: [rxjs/src/internal/types.ts:109](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L109) + +An object that implements the `Symbol.observable` interface. + +## Properties + +| Property | Type | +| -------------------------------------- | ---------------------------------------------- | +| `[observable]` | () => [`Subscribable`](Subscribable.md)\<`T`\> | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/MonoTypeOperatorFunction.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/MonoTypeOperatorFunction.md new file mode 100644 index 0000000000..0d7b6a18dc --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/MonoTypeOperatorFunction.md @@ -0,0 +1,31 @@ +[API](../../index.md) / [rxjs](../index.md) / MonoTypeOperatorFunction + +# Interface: MonoTypeOperatorFunction() + +> A function type interface that describes a function that accepts and returns a parameter of the same type. + +## Description + +Used to describe [OperatorFunction](OperatorFunction.md) with the only one type: `OperatorFunction`. + +Defined in: [rxjs/src/internal/types.ts:39](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L39) + +## Extends + +- [`OperatorFunction`](OperatorFunction.md)\<`T`, `T`\> + +```ts +MonoTypeOperatorFunction(source: Observable): Observable; +``` + +Defined in: [rxjs/src/internal/types.ts:39](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L39) + +## Parameters + +| Parameter | Type | +| --------- | ---------------------------------------- | +| `source` | [`Observable`](../classes/Observable.md) | + +## Returns + +[`Observable`](../classes/Observable.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/NextNotification.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/NextNotification.md new file mode 100644 index 0000000000..ba378e3942 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/NextNotification.md @@ -0,0 +1,20 @@ +[API](../../index.md) / [rxjs](../index.md) / NextNotification + +# Interface: NextNotification + +## Description + +A notification representing a "next" from an observable. +Can be used with [dematerialize](../functions/dematerialize.md). + +Defined in: [rxjs/src/internal/types.ts:119](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L119) + +A notification representing a "next" from an observable. +Can be used with [dematerialize](../functions/dematerialize.md). + +## Properties + +| Property | Type | Description | +| -------------------------- | ----- | ------------------------------------ | +| `kind` | `"N"` | The kind of notification. Always "N" | +| `value` | `T` | The value of the notification. | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/NextObserver.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/NextObserver.md new file mode 100644 index 0000000000..b1f1fc0a31 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/NextObserver.md @@ -0,0 +1,14 @@ +[API](../../index.md) / [rxjs](../index.md) / NextObserver + +# Interface: NextObserver + +Defined in: [rxjs/src/internal/types.ts:151](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L151) + +## Properties + +| Property | Type | +| --------------------------------- | ------------------------ | +| `closed?` | `boolean` | +| `complete?` | () => `void` | +| `error?` | (`err`: `any`) => `void` | +| `next` | (`value`: `T`) => `void` | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Observer.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Observer.md new file mode 100644 index 0000000000..11ace86324 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Observer.md @@ -0,0 +1,25 @@ +[API](../../index.md) / [rxjs](../index.md) / Observer + +# Interface: Observer + +> An object interface that defines a set of callback functions a user can use to get +> notified of any set of [Observable](../classes/Observable.md) > [notification](https://rxjs.dev/guide/glossary-and-semantics#notification) events. + +## Description + +For more info, please refer to [this \| guide](https://rxjs.dev/guide/observer). + +Defined in: [rxjs/src/internal/types.ts:181](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L181) + +## Extended by + +- [`SubjectLike`](SubjectLike.md) +- [`TapObserver`](TapObserver.md) + +## Properties + +| Property | Type | Description | +| -------------------------------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `complete` | () => `void` | A callback function that gets called by the producer if and when it has no more values to provide (by calling `next` callback function). This means that no error has happened. This callback can't be called more than one time, it can't be called if the `error` callback function have been called previously, nor it can't be called if the consumer has unsubscribed. For more info, please refer to [this \| guide](https://rxjs.dev/guide/glossary-and-semantics#complete). | +| `error` | (`err`: `any`) => `void` | A callback function that gets called by the producer if and when it encountered a problem of any kind. The errored value will be provided through the `err` parameter. This callback can't be called more than one time, it can't be called if the `complete` callback function have been called previously, nor it can't be called if the consumer has unsubscribed. For more info, please refer to [this \| guide](https://rxjs.dev/guide/glossary-and-semantics#error). | +| `next` | (`value`: `T`) => `void` | A callback function that gets called by the producer during the subscription when the producer "has" the `value`. It won't be called if `error` or `complete` callback functions have been called, nor after the consumer has unsubscribed. For more info, please refer to [this \| guide](https://rxjs.dev/guide/glossary-and-semantics#next). | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Operator.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Operator.md new file mode 100644 index 0000000000..b89413ca81 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Operator.md @@ -0,0 +1,30 @@ +[API](../../index.md) / [rxjs](../index.md) / Operator + +# ~~Interface: Operator~~ + +Defined in: [rxjs/src/internal/Operator.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Operator.ts#L7) + +## Deprecated + +Internal implementation detail, do not use directly. Will be made internal in v8. + +## Methods + +### ~~call()~~ + +```ts +call(subscriber: Subscriber, source: any): TeardownLogic; +``` + +Defined in: [rxjs/src/internal/Operator.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Operator.ts#L8) + +#### Parameters + +| Parameter | Type | +| ------------ | ----------------------------------------------- | +| `subscriber` | [`Subscriber`](../classes/Subscriber.md)\<`R`\> | +| `source` | `any` | + +#### Returns + +[`TeardownLogic`](../type-aliases/TeardownLogic.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/OperatorFunction.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/OperatorFunction.md new file mode 100644 index 0000000000..77078509f5 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/OperatorFunction.md @@ -0,0 +1,37 @@ +[API](../../index.md) / [rxjs](../index.md) / OperatorFunction + +# Interface: OperatorFunction() + +> A function type interface that describes a function that accepts one parameter `T` +> and returns another parameter `R`. + +## Description + +Usually used to describe OperatorFunction - it always takes a single +parameter (the source Observable) and returns another Observable. + +Defined in: [rxjs/src/internal/types.ts:29](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L29) + +## Extends + +- [`UnaryFunction`](UnaryFunction.md)\<[`Observable`](../classes/Observable.md)\<`T`\>, [`Observable`](../classes/Observable.md)\<`R`\>\> + +## Extended by + +- [`MonoTypeOperatorFunction`](MonoTypeOperatorFunction.md) + +```ts +OperatorFunction(source: Observable): Observable; +``` + +Defined in: [rxjs/src/internal/types.ts:29](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L29) + +## Parameters + +| Parameter | Type | +| --------- | ---------------------------------------- | +| `source` | [`Observable`](../classes/Observable.md) | + +## Returns + +[`Observable`](../classes/Observable.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/RepeatConfig.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/RepeatConfig.md new file mode 100644 index 0000000000..19aa3a4359 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/RepeatConfig.md @@ -0,0 +1,12 @@ +[API](../../index.md) / [rxjs](../index.md) / RepeatConfig + +# Interface: RepeatConfig + +Defined in: [rxjs/src/internal/operators/repeat.ts:7](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/repeat.ts#L7) + +## Properties + +| Property | Type | Description | +| --------------------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `count?` | `number` | The number of times to repeat the source. Defaults to `Infinity`. | +| `delay?` | \| `number` \| (`count`: `number`) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | If a `number`, will delay the repeat of the source by that number of milliseconds. If a function, it will provide the number of times the source has been subscribed to, and the return value should be a valid observable input that will notify when the source should be repeated. If the notifier observable is empty, the result will complete. | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/RetryConfig.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/RetryConfig.md new file mode 100644 index 0000000000..26681844ca --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/RetryConfig.md @@ -0,0 +1,21 @@ +[API](../../index.md) / [rxjs](../index.md) / RetryConfig + +# Interface: RetryConfig + +## Description + +The [retry](../functions/retry.md) operator configuration object. `retry` either accepts a `number` +or an object described by this interface. + +Defined in: [rxjs/src/internal/operators/retry.ts:11](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/retry.ts#L11) + +The [retry](../functions/retry.md) operator configuration object. `retry` either accepts a `number` +or an object described by this interface. + +## Properties + +| Property | Type | Description | +| --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `count?` | `number` | The maximum number of times to retry. If `count` is omitted, `retry` will try to resubscribe on errors infinite number of times. | +| `delay?` | \| `number` \| (`error`: `any`, `retryCount`: `number`) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | The number of milliseconds to delay before retrying, OR a function to return a notifier for delaying. If a function is given, that function should return a notifier that, when it emits will retry the source. If the notifier completes _without_ emitting, the resulting observable will complete without error, if the notifier errors, the error will be pushed to the result. | +| `resetOnSuccess?` | `boolean` | Whether or not to reset the retry counter when the retried subscription emits its first value. | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SchedulerAction.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SchedulerAction.md new file mode 100644 index 0000000000..3c538f23e4 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SchedulerAction.md @@ -0,0 +1,161 @@ +[API](../../index.md) / [rxjs](../index.md) / SchedulerAction + +# Interface: SchedulerAction + +> Represents a disposable resource, such as the execution of an Observable. A +> Subscription has one important method, `unsubscribe`, that takes no argument +> and just disposes the resource held by the subscription. + +## Description + +Additionally, subscriptions may be grouped together through the `add()` +method, which will attach a child Subscription to the current Subscription. +When a Subscription is unsubscribed, all its children (and its grandchildren) +will be unsubscribed as well. + +Defined in: [rxjs/src/internal/types.ts:222](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L222) + +## Extends + +- [`Subscription`](../classes/Subscription.md) + +## Properties + +| Property | Type | Default value | Description | Inherited from | +| ---------------------------- | --------- | ------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | +| `closed` | `boolean` | `false` | A flag to indicate whether this Subscription has already been unsubscribed. | [`Subscription`](../classes/Subscription.md).[`closed`](../classes/Subscription.md#closed) | + +## Methods + +### \[dispose\]() + +```ts +dispose: void; +``` + +Defined in: [observable/src/observable.ts:185](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L185) + +#### Returns + +`void` + +#### Inherited from + +[`Subscription`](../classes/Subscription.md).[`[dispose]`](../classes/Subscription.md#dispose) + +### add() + +```ts +add(teardown: TeardownLogic): void; +``` + +Defined in: [observable/src/observable.ts:134](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L134) + +Adds a finalizer to this subscription, so that finalization will be unsubscribed/called +when this subscription is unsubscribed. If this subscription is already [closed](../classes/Subscription.md#closed), +because it has already been unsubscribed, then whatever finalizer is passed to it +will automatically be executed (unless the finalizer itself is also a closed subscription). + +Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed +subscription to a any subscription will result in no operation. (A noop). + +Adding a subscription to itself, or adding `null` or `undefined` will not perform any +operation at all. (A noop). + +`Subscription` instances that are added to this instance will automatically remove themselves +if they are unsubscribed. Functions and [Unsubscribable](Unsubscribable.md) objects that you wish to remove +will need to be removed manually with [remove](../classes/Subscription.md#remove) + +#### Parameters + +| Parameter | Type | Description | +| ---------- | --------------- | --------------------------------------------------- | +| `teardown` | `TeardownLogic` | The finalization logic to add to this subscription. | + +#### Returns + +`void` + +#### Inherited from + +[`Subscription`](../classes/Subscription.md).[`add`](../classes/Subscription.md#add) + +### remove() + +```ts +remove(teardown: + | Unsubscribable + | Subscription + | () => void): void; +``` + +Defined in: [observable/src/observable.ts:176](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L176) + +Removes a finalizer from this subscription that was previously added with the [add](../classes/Subscription.md#add) method. + +Note that `Subscription` instances, when unsubscribed, will automatically remove themselves +from every other `Subscription` they have been added to. This means that using the `remove` method +is not a common thing and should be used thoughtfully. + +If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance +more than once, you will need to call `remove` the same number of times to remove all instances. + +All finalizer instances are removed to free up memory upon unsubscription. + +TIP: In instances you're adding and removing _Subscriptions from other Subscriptions_, you should +be sure to unsubscribe or otherwise get rid of the child subscription reference as soon as you remove it. +The child subscription has a reference to the parent it was added to via closure. In most cases, this +a non-issue, as child subscriptions are rarely long-lived. + +#### Parameters + +| Parameter | Type | Description | +| ---------- | ----------------------------------------------------------------------------------- | ---------------------------------------------- | +| `teardown` | \| `Unsubscribable` \| [`Subscription`](../classes/Subscription.md) \| () => `void` | The finalizer to remove from this subscription | + +#### Returns + +`void` + +#### Inherited from + +[`Subscription`](../classes/Subscription.md).[`remove`](../classes/Subscription.md#remove) + +### schedule() + +```ts +schedule(state?: T, delay?: number): Subscription; +``` + +Defined in: [rxjs/src/internal/types.ts:223](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L223) + +#### Parameters + +| Parameter | Type | +| --------- | -------- | +| `state?` | `T` | +| `delay?` | `number` | + +#### Returns + +[`Subscription`](../classes/Subscription.md) + +### unsubscribe() + +```ts +unsubscribe(): void; +``` + +Defined in: [observable/src/observable.ts:78](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L78) + +Disposes the resources held by the subscription. May, for instance, cancel +an ongoing Observable execution or cancel any other type of work that +started when the Subscription was created. + +#### Returns + +`void` + +#### Inherited from + +[`Subscription`](../classes/Subscription.md).[`unsubscribe`](../classes/Subscription.md#unsubscribe) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SchedulerLike.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SchedulerLike.md new file mode 100644 index 0000000000..55fc2fbc5e --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SchedulerLike.md @@ -0,0 +1,109 @@ +[API](../../index.md) / [rxjs](../index.md) / SchedulerLike + +# Interface: SchedulerLike + +## Description + +This is a type that provides a method to allow RxJS to create a numeric timestamp + +Defined in: [rxjs/src/internal/types.ts:216](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L216) + +This is a type that provides a method to allow RxJS to create a numeric timestamp + +## Extends + +- [`TimestampProvider`](TimestampProvider.md) + +## Methods + +### now() + +```ts +now(): number; +``` + +Defined in: [rxjs/src/internal/types.ts:236](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L236) + +Returns a timestamp as a number. + +This is used by types like `ReplaySubject` or operators like `timestamp` to calculate +the amount of time passed between events. + +#### Returns + +`number` + +#### Inherited from + +[`TimestampProvider`](TimestampProvider.md).[`now`](TimestampProvider.md#now) + +### schedule() + +#### Call Signature + +```ts +schedule<>( + work: (this: SchedulerAction, state: T) => void, + delay: number, + state: T): Subscription; +``` + +Defined in: [rxjs/src/internal/types.ts:217](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L217) + +##### Parameters + +| Parameter | Type | +| --------- | -------------------------------------------------------------------------------- | +| `work` | (`this`: [`SchedulerAction`](SchedulerAction.md)\<`T`\>, `state`: `T`) => `void` | +| `delay` | `number` | +| `state` | `T` | + +##### Returns + +[`Subscription`](../classes/Subscription.md) + +#### Call Signature + +```ts +schedule<>( + work: (this: SchedulerAction, state?: T) => void, + delay: number, + state?: T): Subscription; +``` + +Defined in: [rxjs/src/internal/types.ts:218](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L218) + +##### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------- | +| `work` | (`this`: [`SchedulerAction`](SchedulerAction.md)\<`T`\>, `state?`: `T`) => `void` | +| `delay` | `number` | +| `state?` | `T` | + +##### Returns + +[`Subscription`](../classes/Subscription.md) + +#### Call Signature + +```ts +schedule<>( + work: (this: SchedulerAction, state?: T) => void, + delay?: number, + state?: T): Subscription; +``` + +Defined in: [rxjs/src/internal/types.ts:219](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L219) + +##### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------- | +| `work` | (`this`: [`SchedulerAction`](SchedulerAction.md)\<`T`\>, `state?`: `T`) => `void` | +| `delay?` | `number` | +| `state?` | `T` | + +##### Returns + +[`Subscription`](../classes/Subscription.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ShareConfig.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ShareConfig.md new file mode 100644 index 0000000000..fca36acd3a --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ShareConfig.md @@ -0,0 +1,14 @@ +[API](../../index.md) / [rxjs](../index.md) / ShareConfig + +# Interface: ShareConfig + +Defined in: [rxjs/src/internal/operators/share.ts:6](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/share.ts#L6) + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `connector?` | () => [`SubjectLike`](SubjectLike.md)\<`T`\> | The factory used to create the subject that will connect the source observable to multicast consumers. | +| `resetOnComplete?` | \| `boolean` \| () => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | If `true`, the resulting observable will reset internal state on completion from source and return to a "cold" state. This allows the resulting observable to be "repeated" after it is done. If `false`, when the source completes, it will push the completion through the connecting subject, and the subject will remain the connecting subject, meaning the resulting observable will not go "cold" again, and subsequent repeats or resubscriptions will resubscribe to that same subject. It is also possible to pass a notifier factory returning an `ObservableInput` instead which grants more fine-grained control over how and when the reset should happen. This allows behaviors like conditional or delayed resets. | +| `resetOnError?` | \| `boolean` \| (`error`: `any`) => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | If `true`, the resulting observable will reset internal state on error from source and return to a "cold" state. This allows the resulting observable to be "retried" in the event of an error. If `false`, when an error comes from the source it will push the error into the connecting subject, and the subject will remain the connecting subject, meaning the resulting observable will not go "cold" again, and subsequent retries or resubscriptions will resubscribe to that same subject. In all cases, RxJS subjects will emit the same error again, however [ReplaySubject](../classes/ReplaySubject.md) will also push its buffered values before pushing the error. It is also possible to pass a notifier factory returning an `ObservableInput` instead which grants more fine-grained control over how and when the reset should happen. This allows behaviors like conditional or delayed resets. | +| `resetOnRefCountZero?` | \| `boolean` \| () => [`ObservableInput`](../type-aliases/ObservableInput.md)\<`any`\> | If `true`, when the number of subscribers to the resulting observable reaches zero due to those subscribers unsubscribing, the internal state will be reset and the resulting observable will return to a "cold" state. This means that the next time the resulting observable is subscribed to, a new subject will be created and the source will be subscribed to again. If `false`, when the number of subscribers to the resulting observable reaches zero due to unsubscription, the subject will remain connected to the source, and new subscriptions to the result will be connected through that same subject. It is also possible to pass a notifier factory returning an `ObservableInput` instead which grants more fine-grained control over how and when the reset should happen. This allows behaviors like conditional or delayed resets. | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ShareReplayConfig.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ShareReplayConfig.md new file mode 100644 index 0000000000..b4e5fa8475 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ShareReplayConfig.md @@ -0,0 +1,14 @@ +[API](../../index.md) / [rxjs](../index.md) / ShareReplayConfig + +# Interface: ShareReplayConfig + +Defined in: [rxjs/src/internal/operators/shareReplay.ts:5](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/shareReplay.ts#L5) + +## Properties + +| Property | Type | +| ------------------------------------- | ----------------------------------- | +| `bufferSize?` | `number` | +| `refCount` | `boolean` | +| `scheduler?` | [`SchedulerLike`](SchedulerLike.md) | +| `windowTime?` | `number` | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SubjectLike.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SubjectLike.md new file mode 100644 index 0000000000..bf020f076a --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SubjectLike.md @@ -0,0 +1,48 @@ +[API](../../index.md) / [rxjs](../index.md) / SubjectLike + +# Interface: SubjectLike + +> An object interface that defines a set of callback functions a user can use to get +> notified of any set of [Observable](../classes/Observable.md) > [notification](https://rxjs.dev/guide/glossary-and-semantics#notification) events. + +## Description + +For more info, please refer to [this \| guide](https://rxjs.dev/guide/observer). + +Defined in: [rxjs/src/internal/types.ts:212](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L212) + +## Extends + +- [`Observer`](Observer.md)\<`T`\>.[`Subscribable`](Subscribable.md)\<`T`\> + +## Properties + +| Property | Type | Description | Inherited from | +| -------------------------------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | +| `complete` | () => `void` | A callback function that gets called by the producer if and when it has no more values to provide (by calling `next` callback function). This means that no error has happened. This callback can't be called more than one time, it can't be called if the `error` callback function have been called previously, nor it can't be called if the consumer has unsubscribed. For more info, please refer to [this \| guide](https://rxjs.dev/guide/glossary-and-semantics#complete). | [`Observer`](Observer.md).[`complete`](Observer.md#complete) | +| `error` | (`err`: `any`) => `void` | A callback function that gets called by the producer if and when it encountered a problem of any kind. The errored value will be provided through the `err` parameter. This callback can't be called more than one time, it can't be called if the `complete` callback function have been called previously, nor it can't be called if the consumer has unsubscribed. For more info, please refer to [this \| guide](https://rxjs.dev/guide/glossary-and-semantics#error). | [`Observer`](Observer.md).[`error`](Observer.md#error) | +| `next` | (`value`: `T`) => `void` | A callback function that gets called by the producer during the subscription when the producer "has" the `value`. It won't be called if `error` or `complete` callback functions have been called, nor after the consumer has unsubscribed. For more info, please refer to [this \| guide](https://rxjs.dev/guide/glossary-and-semantics#next). | [`Observer`](Observer.md).[`next`](Observer.md#next) | + +## Methods + +### subscribe() + +```ts +subscribe(observer: Partial>): Unsubscribable; +``` + +Defined in: [rxjs/src/internal/types.ts:91](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L91) + +#### Parameters + +| Parameter | Type | +| ---------- | --------------------------------------------- | +| `observer` | `Partial`\<[`Observer`](Observer.md)\<`T`\>\> | + +#### Returns + +[`Unsubscribable`](Unsubscribable.md) + +#### Inherited from + +[`Subscribable`](Subscribable.md).[`subscribe`](Subscribable.md#subscribe) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Subscribable.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Subscribable.md new file mode 100644 index 0000000000..c3a12ded78 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Subscribable.md @@ -0,0 +1,29 @@ +[API](../../index.md) / [rxjs](../index.md) / Subscribable + +# Interface: Subscribable + +Defined in: [rxjs/src/internal/types.ts:90](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L90) + +## Extended by + +- [`SubjectLike`](SubjectLike.md) + +## Methods + +### subscribe() + +```ts +subscribe(observer: Partial>): Unsubscribable; +``` + +Defined in: [rxjs/src/internal/types.ts:91](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L91) + +#### Parameters + +| Parameter | Type | +| ---------- | --------------------------------------------- | +| `observer` | `Partial`\<[`Observer`](Observer.md)\<`T`\>\> | + +#### Returns + +[`Unsubscribable`](Unsubscribable.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SubscriberOverrides.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SubscriberOverrides.md new file mode 100644 index 0000000000..235e71a42e --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SubscriberOverrides.md @@ -0,0 +1,14 @@ +[API](../../index.md) / [rxjs](../index.md) / SubscriberOverrides + +# Interface: SubscriberOverrides + +Defined in: [observable/src/observable.ts:200](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L200) + +## Properties + +| Property | Type | Description | +| --------------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `complete?` | () => `void` | If provided, this function will be called whenever the [Subscriber](../classes/Subscriber.md)'s `complete` method is called. If an error is thrown within this function, it will be handled and passed to the destination's `error` method. | +| `error?` | (`err`: `any`) => `void` | If provided, this function will be called whenever the [Subscriber](../classes/Subscriber.md)'s `error` method is called, with the error that was passed to that call. If an error is thrown within this function, it will be handled and passed to the destination's `error` method. | +| `finalize?` | () => `void` | If provided, this function will be called after all teardown has occurred for this [Subscriber](../classes/Subscriber.md). This is generally used for cleanup purposes during operator development. | +| `next?` | (`value`: `T`) => `void` | If provided, this function will be called whenever the [Subscriber](../classes/Subscriber.md)'s `next` method is called, with the value that was passed to that call. If an error is thrown within this function, it will be handled and passed to the destination's `error` method. | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SubscriptionLike.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SubscriptionLike.md new file mode 100644 index 0000000000..9f2ea340b9 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/SubscriptionLike.md @@ -0,0 +1,33 @@ +[API](../../index.md) / [rxjs](../index.md) / SubscriptionLike + +# Interface: SubscriptionLike + +Defined in: [rxjs/src/internal/types.ts:83](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L83) + +## Extends + +- [`Unsubscribable`](Unsubscribable.md) + +## Properties + +| Property | Type | +| ---------------------------- | --------- | +| `closed` | `boolean` | + +## Methods + +### unsubscribe() + +```ts +unsubscribe(): void; +``` + +Defined in: [rxjs/src/internal/types.ts:84](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L84) + +#### Returns + +`void` + +#### Overrides + +[`Unsubscribable`](Unsubscribable.md).[`unsubscribe`](Unsubscribable.md#unsubscribe) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TapObserver.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TapObserver.md new file mode 100644 index 0000000000..396c344e82 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TapObserver.md @@ -0,0 +1,67 @@ +[API](../../index.md) / [rxjs](../index.md) / TapObserver + +# Interface: TapObserver + +> An extension to the [Observer](Observer.md) interface used only by the [tap](../functions/tap.md) operator. + +## Description + +It provides a useful set of callbacks a user can register to do side-effects in +cases other than what the usual [Observer](Observer.md) callbacks are +([next](https://rxjs.dev/guide/glossary-and-semantics#next), +[error](https://rxjs.dev/guide/glossary-and-semantics#error) and/or +[complete](https://rxjs.dev/guide/glossary-and-semantics#complete)). + +Defined in: [rxjs/src/internal/operators/tap.ts:50](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/tap.ts#L50) + +## Example + +```ts +import { fromEvent, switchMap, tap, interval, take } from 'rxjs'; + +const source$ = fromEvent(document, 'click'); +const result$ = source$.pipe( + switchMap((_, i) => + i % 2 === 0 + ? fromEvent(document, 'mousemove').pipe( + tap({ + subscribe: () => console.log('Subscribed to the mouse move events after click #' + i), + unsubscribe: () => console.log('Mouse move events #' + i + ' unsubscribed'), + finalize: () => console.log('Mouse move events #' + i + ' finalized'), + }) + ) + : interval(1_000).pipe( + take(5), + tap({ + subscribe: () => console.log('Subscribed to the 1-second interval events after click #' + i), + unsubscribe: () => console.log('1-second interval events #' + i + ' unsubscribed'), + finalize: () => console.log('1-second interval events #' + i + ' finalized'), + }) + ) + ) +); + +const subscription = result$.subscribe({ + next: console.log, +}); + +setTimeout(() => { + console.log('Unsubscribe after 60 seconds'); + subscription.unsubscribe(); +}, 60_000); +``` + +## Extends + +- [`Observer`](Observer.md)\<`T`\> + +## Properties + +| Property | Type | Description | Inherited from | +| -------------------------------------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | +| `complete` | () => `void` | A callback function that gets called by the producer if and when it has no more values to provide (by calling `next` callback function). This means that no error has happened. This callback can't be called more than one time, it can't be called if the `error` callback function have been called previously, nor it can't be called if the consumer has unsubscribed. For more info, please refer to [this \| guide](https://rxjs.dev/guide/glossary-and-semantics#complete). | [`Observer`](Observer.md).[`complete`](Observer.md#complete) | +| `error` | (`err`: `any`) => `void` | A callback function that gets called by the producer if and when it encountered a problem of any kind. The errored value will be provided through the `err` parameter. This callback can't be called more than one time, it can't be called if the `complete` callback function have been called previously, nor it can't be called if the consumer has unsubscribed. For more info, please refer to [this \| guide](https://rxjs.dev/guide/glossary-and-semantics#error). | [`Observer`](Observer.md).[`error`](Observer.md#error) | +| `finalize` | () => `void` | The callback that `tap` operator invokes when any kind of [finalization](https://rxjs.dev/guide/glossary-and-semantics#finalization) happens - either when the source Observable `error`s or `complete`s or when it gets explicitly unsubscribed by the user. There is no difference in using this callback or the [finalize](#finalize) operator, but if you're already using `tap` operator, you can use this callback instead. You'd get the same result in either case. | - | +| `next` | (`value`: `T`) => `void` | A callback function that gets called by the producer during the subscription when the producer "has" the `value`. It won't be called if `error` or `complete` callback functions have been called, nor after the consumer has unsubscribed. For more info, please refer to [this \| guide](https://rxjs.dev/guide/glossary-and-semantics#next). | [`Observer`](Observer.md).[`next`](Observer.md#next) | +| `subscribe` | () => `void` | The callback that `tap` operator invokes at the moment when the source Observable gets subscribed to. | - | +| `unsubscribe` | () => `void` | The callback that `tap` operator invokes when an explicit [unsubscribe](https://rxjs.dev/guide/glossary-and-semantics#unsubscription) happens. It won't get invoked on `error` or `complete` events. | - | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ThrottleConfig.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ThrottleConfig.md new file mode 100644 index 0000000000..320f9a48c9 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/ThrottleConfig.md @@ -0,0 +1,25 @@ +[API](../../index.md) / [rxjs](../index.md) / ThrottleConfig + +# Interface: ThrottleConfig + +## Description + +An object interface used by [throttle](../functions/throttle.md) or [throttleTime](../functions/throttleTime.md) that ensure +configuration options of these operators. + +Defined in: [rxjs/src/internal/operators/throttle.ts:12](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/throttle.ts#L12) + +An object interface used by [throttle](../functions/throttle.md) or [throttleTime](../functions/throttleTime.md) that ensure +configuration options of these operators. + +## See + +- [throttle](../functions/throttle.md) +- [throttleTime](../functions/throttleTime.md) + +## Properties + +| Property | Type | Description | +| --------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `leading?` | `boolean` | If `true`, the resulting Observable will emit the first value from the source Observable at the **start** of the "throttling" process (when starting an internal timer that prevents other emissions from the source to pass through). If `false`, it will not emit the first value from the source Observable at the start of the "throttling" process. If not provided, defaults to: `true`. | +| `trailing?` | `boolean` | If `true`, the resulting Observable will emit the last value from the source Observable at the **end** of the "throttling" process (when ending an internal timer that prevents other emissions from the source to pass through). If `false`, it will not emit the last value from the source Observable at the end of the "throttling" process. If not provided, defaults to: `false`. | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TimeInterval.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TimeInterval.md new file mode 100644 index 0000000000..d332798711 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TimeInterval.md @@ -0,0 +1,22 @@ +[API](../../index.md) / [rxjs](../index.md) / TimeInterval + +# Interface: TimeInterval + +> A value emitted and the amount of time since the last value was emitted. + +## Description + +Emitted by the `timeInterval` operator. + +Defined in: [rxjs/src/internal/types.ts:64](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L64) + +## See + +[timeInterval](../functions/timeInterval.md) + +## Properties + +| Property | Type | Description | +| -------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `interval` | `number` | The amount of time between this value's emission and the previous value's emission. If this is the first emitted value, then it will be the amount of time since subscription started. | +| `value` | `T` | - | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TimeoutConfig.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TimeoutConfig.md new file mode 100644 index 0000000000..f75ebddb70 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TimeoutConfig.md @@ -0,0 +1,15 @@ +[API](../../index.md) / [rxjs](../index.md) / TimeoutConfig + +# Interface: TimeoutConfig + +Defined in: [rxjs/src/internal/operators/timeout.ts:8](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/timeout.ts#L8) + +## Properties + +| Property | Type | Description | +| ----------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `each?` | `number` | The time allowed between values from the source before timeout is triggered. | +| `first?` | `number` \| `Date` | The relative time as a `number` in milliseconds, or a specific time as a `Date` object, by which the first value must arrive from the source before timeout is triggered. | +| `meta?` | `M` | Optional additional metadata you can provide to code that handles the timeout, will be provided through the [TimeoutError](../classes/TimeoutError.md). This can be used to help identify the source of a timeout or pass along other information related to the timeout. | +| `scheduler?` | [`SchedulerLike`](SchedulerLike.md) | The scheduler to use with time-related operations within this operator. Defaults to [asyncScheduler](../variables/asyncScheduler.md) | +| `with?` | (`info`: [`TimeoutInfo`](TimeoutInfo.md)\<`T`, `M`\>) => `O` | A factory used to create observable to switch to when timeout occurs. Provides a [TimeoutInfo](TimeoutInfo.md) about the source observable's emissions and what delay or exact time triggered the timeout. | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TimeoutInfo.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TimeoutInfo.md new file mode 100644 index 0000000000..90813ed29c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TimeoutInfo.md @@ -0,0 +1,13 @@ +[API](../../index.md) / [rxjs](../index.md) / TimeoutInfo + +# Interface: TimeoutInfo + +Defined in: [rxjs/src/internal/operators/timeout.ts:41](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/operators/timeout.ts#L41) + +## Properties + +| Property | Type | Description | +| ---------------------------------- | ------------- | ----------------------------------------------------------------- | +| `lastValue` | `T` \| `null` | The last message seen | +| `meta` | `M` | Optional metadata that was provided to the timeout configuration. | +| `seen` | `number` | The number of messages seen before the timeout | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Timestamp.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Timestamp.md new file mode 100644 index 0000000000..2eb96f14f7 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Timestamp.md @@ -0,0 +1,22 @@ +[API](../../index.md) / [rxjs](../index.md) / Timestamp + +# Interface: Timestamp + +> A value and the time at which it was emitted. + +## Description + +Emitted by the `timestamp` operator + +Defined in: [rxjs/src/internal/types.ts:48](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L48) + +## See + +[timestamp](#timestamp) + +## Properties + +| Property | Type | Description | +| ---------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `timestamp` | `number` | The timestamp. By default, this is in epoch milliseconds. Could vary based on the timestamp provider passed to the operator. | +| `value` | `T` | - | diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TimestampProvider.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TimestampProvider.md new file mode 100644 index 0000000000..b49a42ee03 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/TimestampProvider.md @@ -0,0 +1,34 @@ +[API](../../index.md) / [rxjs](../index.md) / TimestampProvider + +# Interface: TimestampProvider + +## Description + +This is a type that provides a method to allow RxJS to create a numeric timestamp + +Defined in: [rxjs/src/internal/types.ts:229](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L229) + +This is a type that provides a method to allow RxJS to create a numeric timestamp + +## Extended by + +- [`SchedulerLike`](SchedulerLike.md) + +## Methods + +### now() + +```ts +now(): number; +``` + +Defined in: [rxjs/src/internal/types.ts:236](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L236) + +Returns a timestamp as a number. + +This is used by types like `ReplaySubject` or operators like `timestamp` to calculate +the amount of time passed between events. + +#### Returns + +`number` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/UnaryFunction.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/UnaryFunction.md new file mode 100644 index 0000000000..67bd439883 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/UnaryFunction.md @@ -0,0 +1,33 @@ +[API](../../index.md) / [rxjs](../index.md) / UnaryFunction + +# Interface: UnaryFunction() + +> A function type interface that describes a function that accepts one parameter `T` +> and returns another parameter `R`. + +## Description + +Usually used to describe [OperatorFunction](OperatorFunction.md) - it always takes a single +parameter (the source Observable) and returns another Observable. + +Defined in: [rxjs/src/internal/types.ts:25](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L25) + +## Extended by + +- [`OperatorFunction`](OperatorFunction.md) + +```ts +UnaryFunction(source: T): R; +``` + +Defined in: [rxjs/src/internal/types.ts:26](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L26) + +## Parameters + +| Parameter | Type | +| --------- | ---- | +| `source` | `T` | + +## Returns + +`R` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Unsubscribable.md b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Unsubscribable.md new file mode 100644 index 0000000000..13c2978ba9 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/interfaces/Unsubscribable.md @@ -0,0 +1,23 @@ +[API](../../index.md) / [rxjs](../index.md) / Unsubscribable + +# Interface: Unsubscribable + +Defined in: [rxjs/src/internal/types.ts:77](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L77) + +## Extended by + +- [`SubscriptionLike`](SubscriptionLike.md) + +## Methods + +### unsubscribe() + +```ts +unsubscribe(): void; +``` + +Defined in: [rxjs/src/internal/types.ts:78](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L78) + +#### Returns + +`void` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/Cons.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/Cons.md new file mode 100644 index 0000000000..6c26a8bf9e --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/Cons.md @@ -0,0 +1,17 @@ +[API](../../index.md) / [rxjs](../index.md) / Cons + +# Type Alias: Cons + +## Description + +Constructs a new tuple with the specified type at the head. +If you declare `Cons` you will get back `[A, B, C]`. + +```ts +type Cons<> = (arg: X, ...rest: Y) => any extends (...args: infer U) => any ? U : never; +``` + +Defined in: [rxjs/src/internal/types.ts:277](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L277) + +Constructs a new tuple with the specified type at the head. +If you declare `Cons` you will get back `[A, B, C]`. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/FactoryOrValue.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/FactoryOrValue.md new file mode 100644 index 0000000000..e0df8a6b9e --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/FactoryOrValue.md @@ -0,0 +1,9 @@ +[API](../../index.md) / [rxjs](../index.md) / FactoryOrValue + +# Type Alias: FactoryOrValue + +```ts +type FactoryOrValue<> = T | () => T; +``` + +Defined in: [rxjs/src/internal/types.ts:31](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L31) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/Falsy.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/Falsy.md new file mode 100644 index 0000000000..27844528fb --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/Falsy.md @@ -0,0 +1,19 @@ +[API](../../index.md) / [rxjs](../index.md) / Falsy + +# Type Alias: Falsy + +## Description + +A simple type to represent a gamut of "falsy" values... with a notable exception: +`NaN` is "falsy" however, it is not and cannot be typed via TypeScript. See +comments here: https://github.com/microsoft/TypeScript/issues/28682#issuecomment-707142417 + +```ts +type Falsy = null | undefined | false | 0 | 0 | 0n | ''; +``` + +Defined in: [rxjs/src/internal/types.ts:314](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L314) + +A simple type to represent a gamut of "falsy" values... with a notable exception: +`NaN` is "falsy" however, it is not and cannot be typed via TypeScript. See +comments here: https://github.com/microsoft/TypeScript/issues/28682#issuecomment-707142417 diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/Head.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/Head.md new file mode 100644 index 0000000000..a1ac53dcfc --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/Head.md @@ -0,0 +1,17 @@ +[API](../../index.md) / [rxjs](../index.md) / Head + +# Type Alias: Head + +## Description + +Extracts the head of a tuple. +If you declare `Head<[A, B, C]>` you will get back `A`. + +```ts +type Head<> = (...args: X) => any extends (arg: infer U, ...rest: any[]) => any ? U : never; +``` + +Defined in: [rxjs/src/internal/types.ts:283](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L283) + +Extracts the head of a tuple. +If you declare `Head<[A, B, C]>` you will get back `A`. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservableInput.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservableInput.md new file mode 100644 index 0000000000..821fddfb77 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservableInput.md @@ -0,0 +1,22 @@ +[API](../../index.md) / [rxjs](../index.md) / ObservableInput + +# Type Alias: ObservableInput + +## Description + +Valid types that can be converted to observables. + +```ts +type ObservableInput<> = + | Observable + | InteropObservable + | AsyncIterable + | PromiseLike + | ArrayLike + | Iterable + | ReadableStreamLike; +``` + +Defined in: [rxjs/src/internal/types.ts:97](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L97) + +Valid types that can be converted to observables. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservableInputTuple.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservableInputTuple.md new file mode 100644 index 0000000000..b6292d7494 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservableInputTuple.md @@ -0,0 +1,19 @@ +[API](../../index.md) / [rxjs](../index.md) / ObservableInputTuple + +# Type Alias: ObservableInputTuple + +## Description + +Used to infer types from arguments to functions like [forkJoin](../functions/forkJoin.md). +So that you can have `forkJoin([Observable, PromiseLike]): Observable<[A, B]>` +et al. + +```ts +type ObservableInputTuple<> = { [K in keyof T]: ObservableInput }; +``` + +Defined in: [rxjs/src/internal/types.ts:269](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L269) + +Used to infer types from arguments to functions like [forkJoin](../functions/forkJoin.md). +So that you can have `forkJoin([Observable, PromiseLike]): Observable<[A, B]>` +et al. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservableNotification.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservableNotification.md new file mode 100644 index 0000000000..6c46c04063 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservableNotification.md @@ -0,0 +1,15 @@ +[API](../../index.md) / [rxjs](../index.md) / ObservableNotification + +# Type Alias: ObservableNotification + +## Description + +Valid observable notification types. + +```ts +type ObservableNotification<> = NextNotification | ErrorNotification | CompleteNotification; +``` + +Defined in: [rxjs/src/internal/types.ts:147](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L147) + +Valid observable notification types. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservedValueOf.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservedValueOf.md new file mode 100644 index 0000000000..f3e7eeebf7 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservedValueOf.md @@ -0,0 +1,19 @@ +[API](../../index.md) / [rxjs](../index.md) / ObservedValueOf + +# Type Alias: ObservedValueOf + +## Description + +Extracts the type from an `ObservableInput`. If you have +`O extends ObservableInput` and you pass in `Observable`, or +`Promise`, etc, it will type as `number`. + +```ts +type ObservedValueOf<> = O extends ObservableInput ? T : never; +``` + +Defined in: [rxjs/src/internal/types.ts:244](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L244) + +Extracts the type from an `ObservableInput`. If you have +`O extends ObservableInput` and you pass in `Observable`, or +`Promise`, etc, it will type as `number`. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservedValueTupleFromArray.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservedValueTupleFromArray.md new file mode 100644 index 0000000000..8aec1d2fde --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservedValueTupleFromArray.md @@ -0,0 +1,21 @@ +[API](../../index.md) / [rxjs](../index.md) / ObservedValueTupleFromArray + +# Type Alias: ObservedValueTupleFromArray + +## Description + +Extracts a tuple of element types from an `ObservableInput[]`. +If you have `O extends ObservableInput[]` and you pass in +`[Observable, Observable]` you would get back a type +of `[string, number]`. + +```ts +type ObservedValueTupleFromArray<> = { [K in keyof X]: ObservedValueOf }; +``` + +Defined in: [rxjs/src/internal/types.ts:262](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L262) + +Extracts a tuple of element types from an `ObservableInput[]`. +If you have `O extends ObservableInput[]` and you pass in +`[Observable, Observable]` you would get back a type +of `[string, number]`. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservedValueUnionFromArray.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservedValueUnionFromArray.md new file mode 100644 index 0000000000..8e217bf424 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ObservedValueUnionFromArray.md @@ -0,0 +1,25 @@ +[API](../../index.md) / [rxjs](../index.md) / ObservedValueUnionFromArray + +# Type Alias: ObservedValueUnionFromArray + +## Description + +Extracts a union of element types from an `ObservableInput[]`. +If you have `O extends ObservableInput[]` and you pass in +`Observable[]` or `Promise[]` you would get +back a type of `string`. +If you pass in `[Observable, Observable]` you would +get back a type of `string | number`. + +```ts +type ObservedValueUnionFromArray<> = X extends ObservableInput[] ? T : never; +``` + +Defined in: [rxjs/src/internal/types.ts:254](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L254) + +Extracts a union of element types from an `ObservableInput[]`. +If you have `O extends ObservableInput[]` and you pass in +`Observable[]` or `Promise[]` you would get +back a type of `string`. +If you pass in `[Observable, Observable]` you would +get back a type of `string | number`. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/PartialObserver.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/PartialObserver.md new file mode 100644 index 0000000000..57bb6ddbf0 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/PartialObserver.md @@ -0,0 +1,9 @@ +[API](../../index.md) / [rxjs](../index.md) / PartialObserver + +# Type Alias: PartialObserver + +```ts +type PartialObserver<> = NextObserver | ErrorObserver | CompletionObserver; +``` + +Defined in: [rxjs/src/internal/types.ts:172](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L172) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ReadableStreamLike.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ReadableStreamLike.md new file mode 100644 index 0000000000..b4608635e2 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ReadableStreamLike.md @@ -0,0 +1,19 @@ +[API](../../index.md) / [rxjs](../index.md) / ReadableStreamLike + +# Type Alias: ReadableStreamLike + +## Description + +The base signature RxJS will look for to identify and use +a [ReadableStream](https://streams.spec.whatwg.org/#rs-class) +as an [ObservableInput](ObservableInput.md) source. + +```ts +type ReadableStreamLike<> = Pick, 'getReader'>; +``` + +Defined in: [rxjs/src/internal/types.ts:323](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L323) + +The base signature RxJS will look for to identify and use +a [ReadableStream](https://streams.spec.whatwg.org/#rs-class) +as an [ObservableInput](ObservableInput.md) source. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/Tail.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/Tail.md new file mode 100644 index 0000000000..d357ae4e98 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/Tail.md @@ -0,0 +1,17 @@ +[API](../../index.md) / [rxjs](../index.md) / Tail + +# Type Alias: Tail + +## Description + +Extracts the tail of a tuple. +If you declare `Tail<[A, B, C]>` you will get back `[B, C]`. + +```ts +type Tail<> = (...args: X) => any extends (arg: any, ...rest: infer U) => any ? U : never; +``` + +Defined in: [rxjs/src/internal/types.ts:289](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L289) + +Extracts the tail of a tuple. +If you declare `Tail<[A, B, C]>` you will get back `[B, C]`. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/TeardownLogic.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/TeardownLogic.md new file mode 100644 index 0000000000..9abd4e688b --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/TeardownLogic.md @@ -0,0 +1,13 @@ +[API](../../index.md) / [rxjs](../index.md) / TeardownLogic + +# Type Alias: TeardownLogic + +```ts +type TeardownLogic = + | Subscription + | Unsubscribable + | () => void + | void; +``` + +Defined in: [rxjs/src/internal/types.ts:81](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L81) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/TruthyTypesOf.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/TruthyTypesOf.md new file mode 100644 index 0000000000..480e2a47a5 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/TruthyTypesOf.md @@ -0,0 +1,9 @@ +[API](../../index.md) / [rxjs](../index.md) / TruthyTypesOf + +# Type Alias: TruthyTypesOf + +```ts +type TruthyTypesOf<> = T extends Falsy ? never : T; +``` + +Defined in: [rxjs/src/internal/types.ts:316](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L316) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ValueFromArray.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ValueFromArray.md new file mode 100644 index 0000000000..1034cc174b --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ValueFromArray.md @@ -0,0 +1,19 @@ +[API](../../index.md) / [rxjs](../index.md) / ValueFromArray + +# Type Alias: ValueFromArray + +## Description + +Extracts the generic value from an Array type. +If you have `T extends Array`, and pass a `string[]` to it, +`ValueFromArray` will return the actual type of `string`. + +```ts +type ValueFromArray<> = A extends infer T[] ? T : never; +``` + +Defined in: [rxjs/src/internal/types.ts:296](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L296) + +Extracts the generic value from an Array type. +If you have `T extends Array`, and pass a `string[]` to it, +`ValueFromArray` will return the actual type of `string`. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ValueFromNotification.md b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ValueFromNotification.md new file mode 100644 index 0000000000..79b2081f6c --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/type-aliases/ValueFromNotification.md @@ -0,0 +1,25 @@ +[API](../../index.md) / [rxjs](../index.md) / ValueFromNotification + +# Type Alias: ValueFromNotification + +## Description + +Gets the value type from an [ObservableNotification](ObservableNotification.md), if possible. + +```ts +type ValueFromNotification<> = T extends { + kind: 'N' | 'E' | 'C'; +} + ? T extends NextNotification + ? T extends { + value: infer V; + } + ? V + : undefined + : never + : never; +``` + +Defined in: [rxjs/src/internal/types.ts:301](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/types.ts#L301) + +Gets the value type from an [ObservableNotification](ObservableNotification.md), if possible. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/variables/EMPTY.md b/apps/rxjs.dev-next/docs/api/rxjs/variables/EMPTY.md new file mode 100644 index 0000000000..ce15305de6 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/variables/EMPTY.md @@ -0,0 +1,72 @@ +[API](../../index.md) / [rxjs](../index.md) / EMPTY + +# Variable: EMPTY + +> A simple Observable that emits no items to the Observer and immediately +> emits a complete notification. + +## Description + +Just emits 'complete', and nothing else. + +![](/images/marble-diagrams/empty.png) + +A simple Observable that only emits the complete notification. It can be used +for composing with other Observables, such as in a [mergeMap](../functions/mergeMap.md). + +```ts +const EMPTY: Observable; +``` + +Defined in: [rxjs/src/internal/observable/empty.ts:65](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/empty.ts#L65) + +## Example + +Log complete notification + +```ts +import { EMPTY } from 'rxjs'; + +EMPTY.subscribe({ + next: () => console.log('Next'), + complete: () => console.log('Complete!'), +}); + +// Outputs +// Complete! +``` + +Emit the number 7, then complete + +```ts +import { EMPTY, startWith } from 'rxjs'; + +const result = EMPTY.pipe(startWith(7)); +result.subscribe((x) => console.log(x)); + +// Outputs +// 7 +``` + +Map and flatten only odd numbers to the sequence `'a'`, `'b'`, `'c'` + +```ts +import { interval, mergeMap, of, EMPTY } from 'rxjs'; + +const interval$ = interval(1000); +const result = interval$.pipe(mergeMap((x) => (x % 2 === 1 ? of('a', 'b', 'c') : EMPTY))); +result.subscribe((x) => console.log(x)); + +// Results in the following to the console: +// x is equal to the count on the interval, e.g. (0, 1, 2, 3, ...) +// x will occur every 1000ms +// if x % 2 is equal to 1, print a, b, c (each on its own) +// if x % 2 is not equal to 1, nothing will be output +``` + +## See + +- [Observable](../classes/Observable.md) +- [NEVER](NEVER.md) +- [of](../functions/of.md) +- [throwError](../functions/throwError.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/variables/NEVER.md b/apps/rxjs.dev-next/docs/api/rxjs/variables/NEVER.md new file mode 100644 index 0000000000..491a8e0e56 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/variables/NEVER.md @@ -0,0 +1,45 @@ +[API](../../index.md) / [rxjs](../index.md) / NEVER + +# Variable: NEVER + +> An Observable that emits no items to the Observer and never completes. + +## Description + +![](/images/marble-diagrams/never.png) + +A simple Observable that emits neither values nor errors nor the completion +notification. It can be used for testing purposes or for composing with other +Observables. Please note that by never emitting a complete notification, this +Observable keeps the subscription from being disposed automatically. +Subscriptions need to be manually disposed. + +## Example + +Emit the number 7, then never emit anything else (not even complete) + +```ts +import { NEVER, startWith } from 'rxjs'; + +const info = () => console.log('Will not be called'); + +const result = NEVER.pipe(startWith(7)); +result.subscribe({ + next: (x) => console.log(x), + error: info, + complete: info, +}); +``` + +```ts +const NEVER: Observable; +``` + +Defined in: [rxjs/src/internal/observable/never.ts:37](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/never.ts#L37) + +## See + +- [Observable](../classes/Observable.md) +- [EMPTY](EMPTY.md) +- [of](../functions/of.md) +- [throwError](../functions/throwError.md) diff --git a/apps/rxjs.dev-next/docs/api/rxjs/variables/animationFrameScheduler.md b/apps/rxjs.dev-next/docs/api/rxjs/variables/animationFrameScheduler.md new file mode 100644 index 0000000000..d8cf6cd68b --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/variables/animationFrameScheduler.md @@ -0,0 +1,46 @@ +[API](../../index.md) / [rxjs](../index.md) / animationFrameScheduler + +# Variable: animationFrameScheduler + +> Animation Frame Scheduler + +## Description + +Perform task when `window.requestAnimationFrame` would fire + +When `animationFrameScheduler` scheduler is used with delay, it will fall back to [asyncScheduler](asyncScheduler.md) +scheduler behaviour. + +Without delay, `animationFrameScheduler` scheduler can be used to create smooth browser animations. +It makes sure scheduled task will happen just before next browser content repaint, +thus performing animations as efficiently as possible. + +```ts +const animationFrameScheduler: AnimationFrameScheduler; +``` + +Defined in: [rxjs/src/internal/scheduler/animationFrame.ts:36](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/scheduler/animationFrame.ts#L36) + +## Example + +Schedule div height animation + +```ts +// html:
+import { animationFrameScheduler } from 'rxjs'; + +const div = document.querySelector('div'); + +animationFrameScheduler.schedule( + function (height) { + div.style.height = height + 'px'; + + this.schedule(height + 1); // `this` references currently executing Action, + // which we reschedule with new state + }, + 0, + 0 +); + +// You will see a div element growing in height +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/variables/asapScheduler.md b/apps/rxjs.dev-next/docs/api/rxjs/variables/asapScheduler.md new file mode 100644 index 0000000000..62e4da3abf --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/variables/asapScheduler.md @@ -0,0 +1,45 @@ +[API](../../index.md) / [rxjs](../index.md) / asapScheduler + +# Variable: asapScheduler + +> Asap Scheduler + +## Description + +Perform task as fast as it can be performed asynchronously + +`asapScheduler` scheduler behaves the same as [asyncScheduler](asyncScheduler.md) scheduler when you use it to delay task +in time. If however you set delay to `0`, `asap` will wait for current synchronously executing +code to end and then it will try to execute given task as fast as possible. + +`asapScheduler` scheduler will do its best to minimize time between end of currently executing code +and start of scheduled task. This makes it best candidate for performing so called "deferring". +Traditionally this was achieved by calling `setTimeout(deferredTask, 0)`, but that technique involves +some (although minimal) unwanted delay. + +Note that using `asapScheduler` scheduler does not necessarily mean that your task will be first to process +after currently executing code. In particular, if some task was also scheduled with `asapScheduler` before, +that task will execute first. That being said, if you need to schedule task asynchronously, but +as soon as possible, `asapScheduler` scheduler is your best bet. + +```ts +const asapScheduler: AsapScheduler; +``` + +Defined in: [rxjs/src/internal/scheduler/asap.ts:39](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/scheduler/asap.ts#L39) + +## Example + +Compare async and asap scheduler< + +```ts +import { asapScheduler, asyncScheduler } from 'rxjs'; + +asyncScheduler.schedule(() => console.log('async')); // scheduling 'async' first... +asapScheduler.schedule(() => console.log('asap')); + +// Logs: +// "asap" +// "async" +// ... but 'asap' goes first! +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/variables/asyncScheduler.md b/apps/rxjs.dev-next/docs/api/rxjs/variables/asyncScheduler.md new file mode 100644 index 0000000000..a55add0569 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/variables/asyncScheduler.md @@ -0,0 +1,58 @@ +[API](../../index.md) / [rxjs](../index.md) / asyncScheduler + +# Variable: asyncScheduler + +> Async Scheduler + +## Description + +Schedule task as if you used setTimeout(task, duration) + +`asyncScheduler` scheduler schedules tasks asynchronously, by putting them on the JavaScript +event loop queue. It is best used to delay tasks in time or to schedule tasks repeating +in intervals. + +If you just want to "defer" task, that is to perform it right after currently +executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`), +better choice will be the [asapScheduler](asapScheduler.md) scheduler. + +```ts +const asyncScheduler: AsyncScheduler; +``` + +Defined in: [rxjs/src/internal/scheduler/async.ts:51](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/scheduler/async.ts#L51) + +## Example + +Use async scheduler to delay task + +```ts +import { asyncScheduler } from 'rxjs'; + +const task = () => console.log('it works!'); + +asyncScheduler.schedule(task, 2000); + +// After 2 seconds logs: +// "it works!" +``` + +Use async scheduler to repeat task in intervals + +```ts +import { asyncScheduler } from 'rxjs'; + +function task(state) { + console.log(state); + this.schedule(state + 1, 1000); // `this` references currently executing Action, + // which we reschedule with new state and delay +} + +asyncScheduler.schedule(task, 3000, 0); + +// Logs: +// 0 after 3s +// 1 after 4s +// 2 after 5s +// 3 after 6s +``` diff --git a/apps/rxjs.dev-next/docs/api/rxjs/variables/config.md b/apps/rxjs.dev-next/docs/api/rxjs/variables/config.md new file mode 100644 index 0000000000..f9280cbeaf --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/variables/config.md @@ -0,0 +1,17 @@ +[API](../../index.md) / [rxjs](../index.md) / config + +# Variable: config + +## Description + +The [GlobalConfig](../interfaces/GlobalConfig.md) object for RxJS. It is used to configure things +like how to react on unhandled errors. + +```ts +const config: GlobalConfig; +``` + +Defined in: [observable/src/observable.ts:387](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L387) + +The [GlobalConfig](../interfaces/GlobalConfig.md) object for RxJS. It is used to configure things +like how to react on unhandled errors. diff --git a/apps/rxjs.dev-next/docs/api/rxjs/variables/queueScheduler.md b/apps/rxjs.dev-next/docs/api/rxjs/variables/queueScheduler.md new file mode 100644 index 0000000000..d7953fcec3 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/rxjs/variables/queueScheduler.md @@ -0,0 +1,78 @@ +[API](../../index.md) / [rxjs](../index.md) / queueScheduler + +# Variable: queueScheduler + +> Queue Scheduler + +## Description + +Put every next task on a queue, instead of executing it immediately + +`queueScheduler` scheduler, when used with delay, behaves the same as [asyncScheduler](asyncScheduler.md) scheduler. + +When used without delay, it schedules given task synchronously - executes it right when +it is scheduled. However when called recursively, that is when inside the scheduled task, +another task is scheduled with queue scheduler, instead of executing immediately as well, +that task will be put on a queue and wait for current one to finish. + +This means that when you execute task with `queueScheduler` scheduler, you are sure it will end +before any other task scheduled with that scheduler will start. + +```ts +const queueScheduler: QueueScheduler; +``` + +Defined in: [rxjs/src/internal/scheduler/queue.ts:67](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/scheduler/queue.ts#L67) + +## Example + +Schedule recursively first, then do something + +```ts +import { queueScheduler } from 'rxjs'; + +queueScheduler.schedule(() => { + queueScheduler.schedule(() => console.log('second')); // will not happen now, but will be put on a queue + + console.log('first'); +}); + +// Logs: +// "first" +// "second" +``` + +Reschedule itself recursively + +```ts +import { queueScheduler } from 'rxjs'; + +queueScheduler.schedule( + function (state) { + if (state !== 0) { + console.log('before', state); + this.schedule(state - 1); // `this` references currently executing Action, + // which we reschedule with new state + console.log('after', state); + } + }, + 0, + 3 +); + +// In scheduler that runs recursively, you would expect: +// "before", 3 +// "before", 2 +// "before", 1 +// "after", 1 +// "after", 2 +// "after", 3 + +// But with queue it logs: +// "before", 3 +// "after", 3 +// "before", 2 +// "after", 2 +// "before", 1 +// "after", 1 +``` diff --git a/apps/rxjs.dev-next/docs/api/testing/classes/TestScheduler.md b/apps/rxjs.dev-next/docs/api/testing/classes/TestScheduler.md new file mode 100644 index 0000000000..f4f1db29d8 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/testing/classes/TestScheduler.md @@ -0,0 +1,306 @@ +[API](../../index.md) / [testing](../index.md) / TestScheduler + +# Class: TestScheduler + +Defined in: [rxjs/src/internal/testing/TestScheduler.ts:38](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/testing/TestScheduler.ts#L38) + +## Extends + +- [`VirtualTimeScheduler`](../../rxjs/classes/VirtualTimeScheduler.md) + +## Constructors + +### Constructor + +```ts +new TestScheduler(assertDeepEqual: (actual: any, expected: any) => boolean | void): TestScheduler; +``` + +Defined in: [rxjs/src/internal/testing/TestScheduler.ts:71](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/testing/TestScheduler.ts#L71) + +#### Parameters + +| Parameter | Type | Description | +| ----------------- | ----------------------------------------------------------- | --------------------------------------------------------- | +| `assertDeepEqual` | (`actual`: `any`, `expected`: `any`) => `boolean` \| `void` | A function to set up your assertion for your test harness | + +#### Returns + +`TestScheduler` + +#### Overrides + +[`VirtualTimeScheduler`](../../rxjs/classes/VirtualTimeScheduler.md).[`constructor`](../../rxjs/classes/VirtualTimeScheduler.md#constructor) + +## Properties + +| Property | Type | Default value | Description | Overrides | Inherited from | +| -------------------------------------------------- | ----------------------------------------------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +|
`actions` | `AsyncAction`\<`any`\>[] | `[]` | - | - | [`VirtualTimeScheduler`](../../rxjs/classes/VirtualTimeScheduler.md).[`actions`](../../rxjs/classes/VirtualTimeScheduler.md#actions) | +| `assertDeepEqual` | (`actual`: `any`, `expected`: `any`) => `boolean` \| `void` | `undefined` | A function to set up your assertion for your test harness | - | - | +| ~~`coldObservables`~~ | `ColdObservable`\<`any`\>[] | `[]` | **Deprecated** Internal implementation detail, do not use directly. Will be made internal in v8. | - | - | +| `frame` | `number` | `0` | The current frame for the state of the virtual scheduler instance. The difference between two "frames" is synonymous with the passage of "virtual time units". So if you record `scheduler.frame` to be `1`, then later, observe `scheduler.frame` to be at `11`, that means `10` virtual time units have passed. | - | [`VirtualTimeScheduler`](../../rxjs/classes/VirtualTimeScheduler.md).[`frame`](../../rxjs/classes/VirtualTimeScheduler.md#frame) | +| ~~`hotObservables`~~ | `HotObservable`\<`any`\>[] | `[]` | **Deprecated** Internal implementation detail, do not use directly. Will be made internal in v8. | - | - | +| ~~`index`~~ | `number` | `-1` | Used internally to examine the current virtual action index being processed. **Deprecated** Internal implementation detail, do not use directly. Will be made internal in v8. | - | [`VirtualTimeScheduler`](../../rxjs/classes/VirtualTimeScheduler.md).[`index`](../../rxjs/classes/VirtualTimeScheduler.md#index) | +| `maxFrames` | `number` | `Infinity` | The maximum number of frames to process before stopping. Used to prevent endless flush cycles. | - | [`VirtualTimeScheduler`](../../rxjs/classes/VirtualTimeScheduler.md).[`maxFrames`](../../rxjs/classes/VirtualTimeScheduler.md#maxframes) | +| `now` | () => `number` | `undefined` | A getter method that returns a number representing the current time (at the time this function was called) according to the scheduler's own internal clock. | - | [`VirtualTimeScheduler`](../../rxjs/classes/VirtualTimeScheduler.md).[`now`](../../rxjs/classes/VirtualTimeScheduler.md#now) | +| `frameTimeFactor` | `number` | `10` | The number of virtual time units each character in a marble diagram represents. If the test scheduler is being used in "run mode", via the `run` method, this is temporarily set to `1` for the duration of the `run` block, then set back to whatever value it was. | [`VirtualTimeScheduler`](../../rxjs/classes/VirtualTimeScheduler.md).[`frameTimeFactor`](../../rxjs/classes/VirtualTimeScheduler.md#frametimefactor) | - | +| `now` | () => `number` | `dateTimestampProvider.now` | - | - | [`VirtualTimeScheduler`](../../rxjs/classes/VirtualTimeScheduler.md).[`now`](../../rxjs/classes/VirtualTimeScheduler.md#now-1) | + +## Methods + +### createColdObservable() + +```ts +createColdObservable<>( + marbles: string, + values?: { +[marble: string]: T; +}, +error?: any): ColdObservable; +``` + +Defined in: [rxjs/src/internal/testing/TestScheduler.ts:88](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/testing/TestScheduler.ts#L88) + +#### Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------- | ---------------------------------------------------------------------------------------- | +| `marbles` | `string` | A diagram in the marble DSL. Letters map to keys in `values` if provided. | +| `values?` | \{ \[`marble`: `string`\]: `T`; \} | Values to use for the letters in `marbles`. If omitted, the letters themselves are used. | +| `error?` | `any` | The error to use for the `#` marble (if present). | + +#### Returns + +`ColdObservable`\<`T`\> + +### createHotObservable() + +```ts +createHotObservable<>( + marbles: string, + values?: { +[marble: string]: T; +}, +error?: any): HotObservable; +``` + +Defined in: [rxjs/src/internal/testing/TestScheduler.ts:106](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/testing/TestScheduler.ts#L106) + +#### Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------- | ---------------------------------------------------------------------------------------- | +| `marbles` | `string` | A diagram in the marble DSL. Letters map to keys in `values` if provided. | +| `values?` | \{ \[`marble`: `string`\]: `T`; \} | Values to use for the letters in `marbles`. If omitted, the letters themselves are used. | +| `error?` | `any` | The error to use for the `#` marble (if present). | + +#### Returns + +`HotObservable`\<`T`\> + +### createTime() + +```ts +createTime(marbles: string): number; +``` + +Defined in: [rxjs/src/internal/testing/TestScheduler.ts:75](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/testing/TestScheduler.ts#L75) + +#### Parameters + +| Parameter | Type | +| --------- | -------- | +| `marbles` | `string` | + +#### Returns + +`number` + +### expectObservable() + +```ts +expectObservable<>(observable: Observable, subscriptionMarbles: string | null): { + toEqual: (other: Observable) => void; + toBe: void; +}; +``` + +Defined in: [rxjs/src/internal/testing/TestScheduler.ts:132](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/testing/TestScheduler.ts#L132) + +#### Parameters + +| Parameter | Type | Default value | +| --------------------- | ------------------------------------------------------- | ------------- | +| `observable` | [`Observable`](../../rxjs/classes/Observable.md)\<`T`\> | `undefined` | +| `subscriptionMarbles` | `string` \| `null` | `null` | + +#### Returns + +```ts +{ + toEqual: (other: Observable) => void; + toBe: void; +} +``` + +| Name | Type | +| ----------- | ---------------------------------------------------------------------------- | +| `toEqual()` | (`other`: [`Observable`](../../rxjs/classes/Observable.md)\<`T`\>) => `void` | +| `toBe()` | ( `marbles`: `string`, `values?`: `any`, `errorValue?`: `any`) => `void` | + +### expectSubscriptions() + +```ts +expectSubscriptions(actualSubscriptionLogs: SubscriptionLog[]): { + toBe: subscriptionLogsToBeFn; +}; +``` + +Defined in: [rxjs/src/internal/testing/TestScheduler.ts:194](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/testing/TestScheduler.ts#L194) + +#### Parameters + +| Parameter | Type | +| ------------------------ | ------------------- | +| `actualSubscriptionLogs` | `SubscriptionLog`[] | + +#### Returns + +```ts +{ + toBe: subscriptionLogsToBeFn; +} +``` + +| Name | Type | +| ------ | ------------------------ | +| `toBe` | `subscriptionLogsToBeFn` | + +### flush() + +```ts +flush(): void; +``` + +Defined in: [rxjs/src/internal/testing/TestScheduler.ts:209](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/testing/TestScheduler.ts#L209) + +Prompt the Scheduler to execute all of its queued actions, therefore +clearing its queue. + +#### Returns + +`void` + +#### Overrides + +[`VirtualTimeScheduler`](../../rxjs/classes/VirtualTimeScheduler.md).[`flush`](../../rxjs/classes/VirtualTimeScheduler.md#flush) + +### run() + +```ts +run<>(callback: (helpers: RunHelpers) => T): T; +``` + +Defined in: [rxjs/src/internal/testing/TestScheduler.ts:650](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/testing/TestScheduler.ts#L650) + +The `run` method performs the test in 'run mode' - in which schedulers +used within the test automatically delegate to the `TestScheduler`. That +is, in 'run mode' there is no need to explicitly pass a `TestScheduler` +instance to observable creators or operators. + +#### Parameters + +| Parameter | Type | +| ---------- | --------------------------------------------------------------- | +| `callback` | (`helpers`: [`RunHelpers`](../interfaces/RunHelpers.md)) => `T` | + +#### Returns + +`T` + +#### See + +[Marble testing](/guide/testing/marble-testing) + +### schedule() + +```ts +schedule<>( + work: (this: SchedulerAction, state?: T) => void, + delay: number, + state?: T): Subscription; +``` + +Defined in: [rxjs/src/internal/Scheduler.ts:57](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/Scheduler.ts#L57) + +Schedules a function, `work`, for execution. May happen at some point in +the future, according to the `delay` parameter, if specified. May be passed +some context object, `state`, which will be passed to the `work` function. + +The given arguments will be processed an stored as an Action object in a +queue of actions. + +#### Parameters + +| Parameter | Type | Default value | Description | +| --------- | ------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------ | +| `work` | (`this`: [`SchedulerAction`](../../rxjs/interfaces/SchedulerAction.md)\<`T`\>, `state?`: `T`) => `void` | `undefined` | A function representing a task, or some unit of work to be executed by the Scheduler. | +| `delay` | `number` | `0` | Time to wait before executing the work, where the time unit is implicit and defined by the Scheduler itself. | +| `state?` | `T` | `undefined` | Some contextual data that the `work` function uses when called by the Scheduler. | + +#### Returns + +[`Subscription`](../../rxjs/classes/Subscription.md) + +A subscription in order to be able to unsubscribe the scheduled work. + +#### Inherited from + +[`VirtualTimeScheduler`](../../rxjs/classes/VirtualTimeScheduler.md).[`schedule`](../../rxjs/classes/VirtualTimeScheduler.md#schedule) + +### parseMarbles() + +```ts +static parseMarbles( + marbles: string, + values?: any, + errorValue?: any, + materializeInnerObservables?: boolean, + runMode?: boolean): TestMessage[]; +``` + +Defined in: [rxjs/src/internal/testing/TestScheduler.ts:323](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/testing/TestScheduler.ts#L323) + +#### Parameters + +| Parameter | Type | Default value | +| ------------------------------ | --------- | ------------- | +| `marbles` | `string` | `undefined` | +| `values?` | `any` | `undefined` | +| `errorValue?` | `any` | `undefined` | +| `materializeInnerObservables?` | `boolean` | `false` | +| `runMode?` | `boolean` | `false` | + +#### Returns + +`TestMessage`[] + +### parseMarblesAsSubscriptions() + +```ts +static parseMarblesAsSubscriptions(marbles: string | null, runMode: boolean): SubscriptionLog; +``` + +Defined in: [rxjs/src/internal/testing/TestScheduler.ts:226](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/testing/TestScheduler.ts#L226) + +#### Parameters + +| Parameter | Type | Default value | +| --------- | ------------------ | ------------- | +| `marbles` | `string` \| `null` | `undefined` | +| `runMode` | `boolean` | `false` | + +#### Returns + +`SubscriptionLog` diff --git a/apps/rxjs.dev-next/docs/api/testing/index.md b/apps/rxjs.dev-next/docs/api/testing/index.md new file mode 100644 index 0000000000..6ed9ba3cba --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/testing/index.md @@ -0,0 +1,11 @@ +[API](../index.md) / testing + +# testing + +## Classes + +- [TestScheduler](classes/TestScheduler.md) + +## Interfaces + +- [RunHelpers](interfaces/RunHelpers.md) diff --git a/apps/rxjs.dev-next/docs/api/testing/interfaces/RunHelpers.md b/apps/rxjs.dev-next/docs/api/testing/interfaces/RunHelpers.md new file mode 100644 index 0000000000..6958ced341 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/testing/interfaces/RunHelpers.md @@ -0,0 +1,17 @@ +[API](../../index.md) / [testing](../index.md) / RunHelpers + +# Interface: RunHelpers + +Defined in: [rxjs/src/internal/testing/TestScheduler.ts:19](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/testing/TestScheduler.ts#L19) + +## Properties + +| Property | Type | +| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `animate` | (`marbles`: `string`) => `void` | +| `cold` | \<`T`\>(`marbles`: `string`, `values?`: \{ \[`marble`: `string`\]: `T`; \}, `error?`: `any`) => `ColdObservable`\<`T`\> | +| `expectObservable` | \<`T`\>(`observable`: [`Observable`](../../rxjs/classes/Observable.md)\<`T`\>, `subscriptionMarbles`: `string` \| `null`) => \{ `toEqual`: (`other`: [`Observable`](../../rxjs/classes/Observable.md)\<`T`\>) => `void`; `toBe`: `void`; \} | +| `expectSubscriptions` | (`actualSubscriptionLogs`: `SubscriptionLog`[]) => \{ `toBe`: `subscriptionLogsToBeFn`; \} | +| `flush` | () => `void` | +| `hot` | \<`T`\>(`marbles`: `string`, `values?`: \{ \[`marble`: `string`\]: `T`; \}, `error?`: `any`) => `HotObservable`\<`T`\> | +| `time` | (`marbles`: `string`) => `number` | diff --git a/apps/rxjs.dev-next/docs/api/typedoc-sidebar.json b/apps/rxjs.dev-next/docs/api/typedoc-sidebar.json new file mode 100644 index 0000000000..4cbb1ab5d0 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/typedoc-sidebar.json @@ -0,0 +1,967 @@ +[ + { + "text": "API Explorer", + "link": "/api#explorer" + }, + { + "text": "@rxjs/observable", + "link": "/api/@rxjs/observable/", + "collapsed": true, + "items": [ + { + "text": "ObservableInputType", + "link": "/api/@rxjs/observable/enumerations/ObservableInputType.md" + }, + { + "text": "fromArrayLike", + "link": "/api/@rxjs/observable/functions/fromArrayLike.md" + }, + { + "text": "getObservableInputType", + "link": "/api/@rxjs/observable/functions/getObservableInputType.md" + }, + { + "text": "isArrayLike", + "link": "/api/@rxjs/observable/functions/isArrayLike.md" + }, + { + "text": "isFunction", + "link": "/api/@rxjs/observable/functions/isFunction.md" + }, + { + "text": "isPromise", + "link": "/api/@rxjs/observable/functions/isPromise.md" + }, + { + "text": "readableStreamLikeToAsyncGenerator", + "link": "/api/@rxjs/observable/functions/readableStreamLikeToAsyncGenerator.md" + }, + { + "text": "subscribeToArray", + "link": "/api/@rxjs/observable/functions/subscribeToArray.md" + } + ] + }, + { + "text": "ajax", + "link": "/api/ajax/", + "collapsed": true, + "items": [ + { + "text": "AjaxError", + "link": "/api/ajax/classes/AjaxError.md" + }, + { + "text": "AjaxResponse", + "link": "/api/ajax/classes/AjaxResponse.md" + }, + { + "text": "AjaxTimeoutError", + "link": "/api/ajax/classes/AjaxTimeoutError.md" + }, + { + "text": "AjaxConfig", + "link": "/api/ajax/interfaces/AjaxConfig.md" + }, + { + "text": "AjaxRequest", + "link": "/api/ajax/interfaces/AjaxRequest.md" + }, + { + "text": "AjaxDirection", + "link": "/api/ajax/type-aliases/AjaxDirection.md" + }, + { + "text": "ajax", + "link": "/api/ajax/variables/ajax.md" + } + ] + }, + { + "text": "fetch", + "link": "/api/fetch/", + "collapsed": true, + "items": [ + { + "text": "fromFetch", + "link": "/api/fetch/functions/fromFetch.md" + } + ] + }, + { + "text": "operators", + "link": "/api/operators/", + "collapsed": true, + "items": [ + { + "text": "partition", + "link": "/api/operators/functions/partition.md" + } + ] + }, + { + "text": "rxjs", + "link": "/api/rxjs/", + "collapsed": true, + "items": [ + { + "text": "ArgumentOutOfRangeError", + "link": "/api/rxjs/classes/ArgumentOutOfRangeError.md" + }, + { + "text": "AsyncSubject", + "link": "/api/rxjs/classes/AsyncSubject.md" + }, + { + "text": "BehaviorSubject", + "link": "/api/rxjs/classes/BehaviorSubject.md" + }, + { + "text": "EmptyError", + "link": "/api/rxjs/classes/EmptyError.md" + }, + { + "text": "NotFoundError", + "link": "/api/rxjs/classes/NotFoundError.md" + }, + { + "text": "Observable", + "link": "/api/rxjs/classes/Observable.md" + }, + { + "text": "ReplaySubject", + "link": "/api/rxjs/classes/ReplaySubject.md" + }, + { + "text": "Scheduler", + "link": "/api/rxjs/classes/Scheduler.md" + }, + { + "text": "SequenceError", + "link": "/api/rxjs/classes/SequenceError.md" + }, + { + "text": "Subject", + "link": "/api/rxjs/classes/Subject.md" + }, + { + "text": "Subscriber", + "link": "/api/rxjs/classes/Subscriber.md" + }, + { + "text": "Subscription", + "link": "/api/rxjs/classes/Subscription.md" + }, + { + "text": "TimeoutError", + "link": "/api/rxjs/classes/TimeoutError.md" + }, + { + "text": "UnsubscriptionError", + "link": "/api/rxjs/classes/UnsubscriptionError.md" + }, + { + "text": "VirtualAction", + "link": "/api/rxjs/classes/VirtualAction.md" + }, + { + "text": "VirtualTimeScheduler", + "link": "/api/rxjs/classes/VirtualTimeScheduler.md" + }, + { + "text": "BasicGroupByOptions", + "link": "/api/rxjs/interfaces/BasicGroupByOptions.md" + }, + { + "text": "CompleteNotification", + "link": "/api/rxjs/interfaces/CompleteNotification.md" + }, + { + "text": "CompletionObserver", + "link": "/api/rxjs/interfaces/CompletionObserver.md" + }, + { + "text": "Connectable", + "link": "/api/rxjs/interfaces/Connectable.md" + }, + { + "text": "ConnectConfig", + "link": "/api/rxjs/interfaces/ConnectConfig.md" + }, + { + "text": "ErrorNotification", + "link": "/api/rxjs/interfaces/ErrorNotification.md" + }, + { + "text": "ErrorObserver", + "link": "/api/rxjs/interfaces/ErrorObserver.md" + }, + { + "text": "GlobalConfig", + "link": "/api/rxjs/interfaces/GlobalConfig.md" + }, + { + "text": "GroupByOptionsWithElement", + "link": "/api/rxjs/interfaces/GroupByOptionsWithElement.md" + }, + { + "text": "GroupedObservable", + "link": "/api/rxjs/interfaces/GroupedObservable.md" + }, + { + "text": "InteropObservable", + "link": "/api/rxjs/interfaces/InteropObservable.md" + }, + { + "text": "MonoTypeOperatorFunction", + "link": "/api/rxjs/interfaces/MonoTypeOperatorFunction.md" + }, + { + "text": "NextNotification", + "link": "/api/rxjs/interfaces/NextNotification.md" + }, + { + "text": "NextObserver", + "link": "/api/rxjs/interfaces/NextObserver.md" + }, + { + "text": "Observer", + "link": "/api/rxjs/interfaces/Observer.md" + }, + { + "text": "Operator", + "link": "/api/rxjs/interfaces/Operator.md" + }, + { + "text": "OperatorFunction", + "link": "/api/rxjs/interfaces/OperatorFunction.md" + }, + { + "text": "RepeatConfig", + "link": "/api/rxjs/interfaces/RepeatConfig.md" + }, + { + "text": "RetryConfig", + "link": "/api/rxjs/interfaces/RetryConfig.md" + }, + { + "text": "SchedulerAction", + "link": "/api/rxjs/interfaces/SchedulerAction.md" + }, + { + "text": "SchedulerLike", + "link": "/api/rxjs/interfaces/SchedulerLike.md" + }, + { + "text": "ShareConfig", + "link": "/api/rxjs/interfaces/ShareConfig.md" + }, + { + "text": "ShareReplayConfig", + "link": "/api/rxjs/interfaces/ShareReplayConfig.md" + }, + { + "text": "SubjectLike", + "link": "/api/rxjs/interfaces/SubjectLike.md" + }, + { + "text": "Subscribable", + "link": "/api/rxjs/interfaces/Subscribable.md" + }, + { + "text": "SubscriberOverrides", + "link": "/api/rxjs/interfaces/SubscriberOverrides.md" + }, + { + "text": "SubscriptionLike", + "link": "/api/rxjs/interfaces/SubscriptionLike.md" + }, + { + "text": "TapObserver", + "link": "/api/rxjs/interfaces/TapObserver.md" + }, + { + "text": "ThrottleConfig", + "link": "/api/rxjs/interfaces/ThrottleConfig.md" + }, + { + "text": "TimeInterval", + "link": "/api/rxjs/interfaces/TimeInterval.md" + }, + { + "text": "TimeoutConfig", + "link": "/api/rxjs/interfaces/TimeoutConfig.md" + }, + { + "text": "TimeoutInfo", + "link": "/api/rxjs/interfaces/TimeoutInfo.md" + }, + { + "text": "Timestamp", + "link": "/api/rxjs/interfaces/Timestamp.md" + }, + { + "text": "TimestampProvider", + "link": "/api/rxjs/interfaces/TimestampProvider.md" + }, + { + "text": "UnaryFunction", + "link": "/api/rxjs/interfaces/UnaryFunction.md" + }, + { + "text": "Unsubscribable", + "link": "/api/rxjs/interfaces/Unsubscribable.md" + }, + { + "text": "Cons", + "link": "/api/rxjs/type-aliases/Cons.md" + }, + { + "text": "FactoryOrValue", + "link": "/api/rxjs/type-aliases/FactoryOrValue.md" + }, + { + "text": "Falsy", + "link": "/api/rxjs/type-aliases/Falsy.md" + }, + { + "text": "Head", + "link": "/api/rxjs/type-aliases/Head.md" + }, + { + "text": "ObservableInput", + "link": "/api/rxjs/type-aliases/ObservableInput.md" + }, + { + "text": "ObservableInputTuple", + "link": "/api/rxjs/type-aliases/ObservableInputTuple.md" + }, + { + "text": "ObservableNotification", + "link": "/api/rxjs/type-aliases/ObservableNotification.md" + }, + { + "text": "ObservedValueOf", + "link": "/api/rxjs/type-aliases/ObservedValueOf.md" + }, + { + "text": "ObservedValueTupleFromArray", + "link": "/api/rxjs/type-aliases/ObservedValueTupleFromArray.md" + }, + { + "text": "ObservedValueUnionFromArray", + "link": "/api/rxjs/type-aliases/ObservedValueUnionFromArray.md" + }, + { + "text": "PartialObserver", + "link": "/api/rxjs/type-aliases/PartialObserver.md" + }, + { + "text": "ReadableStreamLike", + "link": "/api/rxjs/type-aliases/ReadableStreamLike.md" + }, + { + "text": "Tail", + "link": "/api/rxjs/type-aliases/Tail.md" + }, + { + "text": "TeardownLogic", + "link": "/api/rxjs/type-aliases/TeardownLogic.md" + }, + { + "text": "TruthyTypesOf", + "link": "/api/rxjs/type-aliases/TruthyTypesOf.md" + }, + { + "text": "ValueFromArray", + "link": "/api/rxjs/type-aliases/ValueFromArray.md" + }, + { + "text": "ValueFromNotification", + "link": "/api/rxjs/type-aliases/ValueFromNotification.md" + }, + { + "text": "animationFrameScheduler", + "link": "/api/rxjs/variables/animationFrameScheduler.md" + }, + { + "text": "asapScheduler", + "link": "/api/rxjs/variables/asapScheduler.md" + }, + { + "text": "asyncScheduler", + "link": "/api/rxjs/variables/asyncScheduler.md" + }, + { + "text": "config", + "link": "/api/rxjs/variables/config.md" + }, + { + "text": "EMPTY", + "link": "/api/rxjs/variables/EMPTY.md" + }, + { + "text": "NEVER", + "link": "/api/rxjs/variables/NEVER.md" + }, + { + "text": "queueScheduler", + "link": "/api/rxjs/variables/queueScheduler.md" + }, + { + "text": "animationFrames", + "link": "/api/rxjs/functions/animationFrames.md" + }, + { + "text": "audit", + "link": "/api/rxjs/functions/audit.md" + }, + { + "text": "auditTime", + "link": "/api/rxjs/functions/auditTime.md" + }, + { + "text": "bindCallback", + "link": "/api/rxjs/functions/bindCallback.md" + }, + { + "text": "bindNodeCallback", + "link": "/api/rxjs/functions/bindNodeCallback.md" + }, + { + "text": "buffer", + "link": "/api/rxjs/functions/buffer.md" + }, + { + "text": "bufferCount", + "link": "/api/rxjs/functions/bufferCount.md" + }, + { + "text": "bufferTime", + "link": "/api/rxjs/functions/bufferTime.md" + }, + { + "text": "bufferToggle", + "link": "/api/rxjs/functions/bufferToggle.md" + }, + { + "text": "bufferWhen", + "link": "/api/rxjs/functions/bufferWhen.md" + }, + { + "text": "catchError", + "link": "/api/rxjs/functions/catchError.md" + }, + { + "text": "combineLatest", + "link": "/api/rxjs/functions/combineLatest.md" + }, + { + "text": "combineLatestAll", + "link": "/api/rxjs/functions/combineLatestAll.md" + }, + { + "text": "combineLatestWith", + "link": "/api/rxjs/functions/combineLatestWith.md" + }, + { + "text": "concat", + "link": "/api/rxjs/functions/concat.md" + }, + { + "text": "concatAll", + "link": "/api/rxjs/functions/concatAll.md" + }, + { + "text": "concatMap", + "link": "/api/rxjs/functions/concatMap.md" + }, + { + "text": "concatMapTo", + "link": "/api/rxjs/functions/concatMapTo.md" + }, + { + "text": "concatWith", + "link": "/api/rxjs/functions/concatWith.md" + }, + { + "text": "connect", + "link": "/api/rxjs/functions/connect.md" + }, + { + "text": "connectable", + "link": "/api/rxjs/functions/connectable.md" + }, + { + "text": "count", + "link": "/api/rxjs/functions/count.md" + }, + { + "text": "debounce", + "link": "/api/rxjs/functions/debounce.md" + }, + { + "text": "debounceTime", + "link": "/api/rxjs/functions/debounceTime.md" + }, + { + "text": "defaultIfEmpty", + "link": "/api/rxjs/functions/defaultIfEmpty.md" + }, + { + "text": "defer", + "link": "/api/rxjs/functions/defer.md" + }, + { + "text": "delay", + "link": "/api/rxjs/functions/delay.md" + }, + { + "text": "delayWhen", + "link": "/api/rxjs/functions/delayWhen.md" + }, + { + "text": "dematerialize", + "link": "/api/rxjs/functions/dematerialize.md" + }, + { + "text": "distinct", + "link": "/api/rxjs/functions/distinct.md" + }, + { + "text": "distinctUntilChanged", + "link": "/api/rxjs/functions/distinctUntilChanged.md" + }, + { + "text": "distinctUntilKeyChanged", + "link": "/api/rxjs/functions/distinctUntilKeyChanged.md" + }, + { + "text": "elementAt", + "link": "/api/rxjs/functions/elementAt.md" + }, + { + "text": "endWith", + "link": "/api/rxjs/functions/endWith.md" + }, + { + "text": "every", + "link": "/api/rxjs/functions/every.md" + }, + { + "text": "exhaustAll", + "link": "/api/rxjs/functions/exhaustAll.md" + }, + { + "text": "exhaustMap", + "link": "/api/rxjs/functions/exhaustMap.md" + }, + { + "text": "expand", + "link": "/api/rxjs/functions/expand.md" + }, + { + "text": "filter", + "link": "/api/rxjs/functions/filter.md" + }, + { + "text": "finalize", + "link": "/api/rxjs/functions/finalize.md" + }, + { + "text": "find", + "link": "/api/rxjs/functions/find.md" + }, + { + "text": "findIndex", + "link": "/api/rxjs/functions/findIndex.md" + }, + { + "text": "first", + "link": "/api/rxjs/functions/first.md" + }, + { + "text": "firstValueFrom", + "link": "/api/rxjs/functions/firstValueFrom.md" + }, + { + "text": "forkJoin", + "link": "/api/rxjs/functions/forkJoin.md" + }, + { + "text": "from", + "link": "/api/rxjs/functions/from.md" + }, + { + "text": "fromEvent", + "link": "/api/rxjs/functions/fromEvent.md" + }, + { + "text": "fromEventPattern", + "link": "/api/rxjs/functions/fromEventPattern.md" + }, + { + "text": "generate", + "link": "/api/rxjs/functions/generate.md" + }, + { + "text": "groupBy", + "link": "/api/rxjs/functions/groupBy.md" + }, + { + "text": "identity", + "link": "/api/rxjs/functions/identity.md" + }, + { + "text": "ignoreElements", + "link": "/api/rxjs/functions/ignoreElements.md" + }, + { + "text": "iif", + "link": "/api/rxjs/functions/iif.md" + }, + { + "text": "interval", + "link": "/api/rxjs/functions/interval.md" + }, + { + "text": "isEmpty", + "link": "/api/rxjs/functions/isEmpty.md" + }, + { + "text": "isObservable", + "link": "/api/rxjs/functions/isObservable.md" + }, + { + "text": "last", + "link": "/api/rxjs/functions/last.md" + }, + { + "text": "lastValueFrom", + "link": "/api/rxjs/functions/lastValueFrom.md" + }, + { + "text": "map", + "link": "/api/rxjs/functions/map.md" + }, + { + "text": "mapTo", + "link": "/api/rxjs/functions/mapTo.md" + }, + { + "text": "materialize", + "link": "/api/rxjs/functions/materialize.md" + }, + { + "text": "max", + "link": "/api/rxjs/functions/max.md" + }, + { + "text": "merge", + "link": "/api/rxjs/functions/merge.md" + }, + { + "text": "mergeAll", + "link": "/api/rxjs/functions/mergeAll.md" + }, + { + "text": "mergeMap", + "link": "/api/rxjs/functions/mergeMap.md" + }, + { + "text": "mergeMapTo", + "link": "/api/rxjs/functions/mergeMapTo.md" + }, + { + "text": "mergeScan", + "link": "/api/rxjs/functions/mergeScan.md" + }, + { + "text": "mergeWith", + "link": "/api/rxjs/functions/mergeWith.md" + }, + { + "text": "min", + "link": "/api/rxjs/functions/min.md" + }, + { + "text": "noop", + "link": "/api/rxjs/functions/noop.md" + }, + { + "text": "observeOn", + "link": "/api/rxjs/functions/observeOn.md" + }, + { + "text": "of", + "link": "/api/rxjs/functions/of.md" + }, + { + "text": "onErrorResumeNext", + "link": "/api/rxjs/functions/onErrorResumeNext.md" + }, + { + "text": "onErrorResumeNextWith", + "link": "/api/rxjs/functions/onErrorResumeNextWith.md" + }, + { + "text": "operate", + "link": "/api/rxjs/functions/operate.md" + }, + { + "text": "pairwise", + "link": "/api/rxjs/functions/pairwise.md" + }, + { + "text": "partition", + "link": "/api/rxjs/functions/partition.md" + }, + { + "text": "pipe", + "link": "/api/rxjs/functions/pipe.md" + }, + { + "text": "race", + "link": "/api/rxjs/functions/race.md" + }, + { + "text": "raceWith", + "link": "/api/rxjs/functions/raceWith.md" + }, + { + "text": "range", + "link": "/api/rxjs/functions/range.md" + }, + { + "text": "reduce", + "link": "/api/rxjs/functions/reduce.md" + }, + { + "text": "repeat", + "link": "/api/rxjs/functions/repeat.md" + }, + { + "text": "repeatWhen", + "link": "/api/rxjs/functions/repeatWhen.md" + }, + { + "text": "retry", + "link": "/api/rxjs/functions/retry.md" + }, + { + "text": "retryWhen", + "link": "/api/rxjs/functions/retryWhen.md" + }, + { + "text": "rx", + "link": "/api/rxjs/functions/rx.md" + }, + { + "text": "sample", + "link": "/api/rxjs/functions/sample.md" + }, + { + "text": "sampleTime", + "link": "/api/rxjs/functions/sampleTime.md" + }, + { + "text": "scan", + "link": "/api/rxjs/functions/scan.md" + }, + { + "text": "scheduled", + "link": "/api/rxjs/functions/scheduled.md" + }, + { + "text": "sequenceEqual", + "link": "/api/rxjs/functions/sequenceEqual.md" + }, + { + "text": "share", + "link": "/api/rxjs/functions/share.md" + }, + { + "text": "shareReplay", + "link": "/api/rxjs/functions/shareReplay.md" + }, + { + "text": "single", + "link": "/api/rxjs/functions/single.md" + }, + { + "text": "skip", + "link": "/api/rxjs/functions/skip.md" + }, + { + "text": "skipLast", + "link": "/api/rxjs/functions/skipLast.md" + }, + { + "text": "skipUntil", + "link": "/api/rxjs/functions/skipUntil.md" + }, + { + "text": "skipWhile", + "link": "/api/rxjs/functions/skipWhile.md" + }, + { + "text": "startWith", + "link": "/api/rxjs/functions/startWith.md" + }, + { + "text": "subscribeOn", + "link": "/api/rxjs/functions/subscribeOn.md" + }, + { + "text": "switchAll", + "link": "/api/rxjs/functions/switchAll.md" + }, + { + "text": "switchMap", + "link": "/api/rxjs/functions/switchMap.md" + }, + { + "text": "switchMapTo", + "link": "/api/rxjs/functions/switchMapTo.md" + }, + { + "text": "switchScan", + "link": "/api/rxjs/functions/switchScan.md" + }, + { + "text": "take", + "link": "/api/rxjs/functions/take.md" + }, + { + "text": "takeLast", + "link": "/api/rxjs/functions/takeLast.md" + }, + { + "text": "takeUntil", + "link": "/api/rxjs/functions/takeUntil.md" + }, + { + "text": "takeWhile", + "link": "/api/rxjs/functions/takeWhile.md" + }, + { + "text": "tap", + "link": "/api/rxjs/functions/tap.md" + }, + { + "text": "throttle", + "link": "/api/rxjs/functions/throttle.md" + }, + { + "text": "throttleTime", + "link": "/api/rxjs/functions/throttleTime.md" + }, + { + "text": "throwError", + "link": "/api/rxjs/functions/throwError.md" + }, + { + "text": "throwIfEmpty", + "link": "/api/rxjs/functions/throwIfEmpty.md" + }, + { + "text": "timeInterval", + "link": "/api/rxjs/functions/timeInterval.md" + }, + { + "text": "timeout", + "link": "/api/rxjs/functions/timeout.md" + }, + { + "text": "timeoutWith", + "link": "/api/rxjs/functions/timeoutWith.md" + }, + { + "text": "timer", + "link": "/api/rxjs/functions/timer.md" + }, + { + "text": "timestamp", + "link": "/api/rxjs/functions/timestamp.md" + }, + { + "text": "toArray", + "link": "/api/rxjs/functions/toArray.md" + }, + { + "text": "using", + "link": "/api/rxjs/functions/using.md" + }, + { + "text": "window", + "link": "/api/rxjs/functions/window.md" + }, + { + "text": "windowCount", + "link": "/api/rxjs/functions/windowCount.md" + }, + { + "text": "windowTime", + "link": "/api/rxjs/functions/windowTime.md" + }, + { + "text": "windowToggle", + "link": "/api/rxjs/functions/windowToggle.md" + }, + { + "text": "windowWhen", + "link": "/api/rxjs/functions/windowWhen.md" + }, + { + "text": "withLatestFrom", + "link": "/api/rxjs/functions/withLatestFrom.md" + }, + { + "text": "zip", + "link": "/api/rxjs/functions/zip.md" + }, + { + "text": "zipAll", + "link": "/api/rxjs/functions/zipAll.md" + }, + { + "text": "zipWith", + "link": "/api/rxjs/functions/zipWith.md" + } + ] + }, + { + "text": "testing", + "link": "/api/testing/", + "collapsed": true, + "items": [ + { + "text": "TestScheduler", + "link": "/api/testing/classes/TestScheduler.md" + }, + { + "text": "RunHelpers", + "link": "/api/testing/interfaces/RunHelpers.md" + } + ] + }, + { + "text": "webSocket", + "link": "/api/webSocket/", + "collapsed": true, + "items": [ + { + "text": "WebSocketSubject", + "link": "/api/webSocket/classes/WebSocketSubject.md" + }, + { + "text": "WebSocketSubjectConfig", + "link": "/api/webSocket/interfaces/WebSocketSubjectConfig.md" + }, + { + "text": "webSocket", + "link": "/api/webSocket/functions/webSocket.md" + } + ] + } +] \ No newline at end of file diff --git a/apps/rxjs.dev-next/docs/api/webSocket/classes/WebSocketSubject.md b/apps/rxjs.dev-next/docs/api/webSocket/classes/WebSocketSubject.md new file mode 100644 index 0000000000..60b0be5d83 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/webSocket/classes/WebSocketSubject.md @@ -0,0 +1,806 @@ +[API](../../index.md) / [webSocket](../index.md) / WebSocketSubject + +# Class: WebSocketSubject + +## Description + +A representation of any set of values over any amount of time. This is the most basic building block +of RxJS. + +Defined in: [rxjs/src/internal/observable/dom/WebSocketSubject.ts:152](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/dom/WebSocketSubject.ts#L152) + +A representation of any set of values over any amount of time. This is the most basic building block +of RxJS. + +## Example + +Subscribe with an [Observer](https://rxjs.dev/guide/observer) + +```ts +import { of } from 'rxjs'; + +const sumObserver = { + sum: 0, + next(value) { + console.log('Adding: ' + value); + this.sum = this.sum + value; + }, + error() { + // We actually could just remove this method, + // since we do not really care about errors right now. + }, + complete() { + console.log('Sum equals: ' + this.sum); + }, +}; + +of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes. + .subscribe(sumObserver); + +// Logs: +// 'Adding: 1' +// 'Adding: 2' +// 'Adding: 3' +// 'Sum equals: 6' +``` + +Subscribe with functions ([deprecated](https://rxjs.dev/deprecations/subscribe-arguments)) + +```ts +import { of } from 'rxjs'; + +let sum = 0; + +of(1, 2, 3).subscribe( + (value) => { + console.log('Adding: ' + value); + sum = sum + value; + }, + undefined, + () => console.log('Sum equals: ' + sum) +); + +// Logs: +// 'Adding: 1' +// 'Adding: 2' +// 'Adding: 3' +// 'Sum equals: 6' +``` + +Cancel a subscription + +```ts +import { interval } from 'rxjs'; + +const subscription = interval(1000).subscribe({ + next(num) { + console.log(num); + }, + complete() { + // Will not be called, even when cancelling subscription. + console.log('completed!'); + }, +}); + +setTimeout(() => { + subscription.unsubscribe(); + console.log('unsubscribed!'); +}, 2500); + +// Logs: +// 0 after 1s +// 1 after 2s +// 'unsubscribed!' after 2.5s +``` + +## Extends + +- [`Observable`](../../rxjs/classes/Observable.md)\<`Out`\> + +## Constructors + +### Constructor + +```ts +new WebSocketSubject<>(urlConfigOrSource: + | string +| WebSocketSubjectConfig): WebSocketSubject; +``` + +Defined in: [rxjs/src/internal/observable/dom/WebSocketSubject.ts:174](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/dom/WebSocketSubject.ts#L174) + +#### Parameters + +| Parameter | Type | +| ------------------- | ------------------------------------------------------------------------------------------------- | +| `urlConfigOrSource` | \| `string` \| [`WebSocketSubjectConfig`](../interfaces/WebSocketSubjectConfig.md)\<`In`, `Out`\> | + +#### Returns + +`WebSocketSubject`\<`In`, `Out`\> + +#### Overrides + +[`Observable`](../../rxjs/classes/Observable.md).[`constructor`](../../rxjs/classes/Observable.md#constructor) + +## Accessors + +### observed + +#### Get Signature + +```ts +get observed(): boolean; +``` + +Defined in: [rxjs/src/internal/observable/dom/WebSocketSubject.ts:170](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/dom/WebSocketSubject.ts#L170) + +##### Returns + +`boolean` + +## Methods + +### \[asyncIterator\]() + +```ts +asyncIterator: AsyncGenerator; +``` + +Defined in: [observable/src/observable.ts:922](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L922) + +Observable is async iterable, so it can be used in `for await` loop. This method +of subscription is cancellable by breaking the for await loop. Although it's not +recommended to use Observable's AsyncIterable contract outside of `for await`, if +you're consuming the Observable as an AsyncIterable, and you're _not_ using `for await`, +you can use the `throw` or `return` methods on the `AsyncGenerator` we return to +cancel the subscription. Note that the subscription to the observable does not start +until the first value is requested from the AsyncIterable. + +Functionally, this is equivalent to using a [concatMap](../../rxjs/functions/concatMap.md) with an `async` function. +That means that while the body of the `for await` loop is executing, any values that arrive +from the observable source will be queued up, so they can be processed by the `for await` +loop in order. So, like [concatMap](../../rxjs/functions/concatMap.md) it's important to understand the speed your +source emits at, and the speed of the body of your `for await` loop. + +#### Returns + +`AsyncGenerator`\<`Out`, `void`, `void`\> + +#### Example + +```ts +import { interval } from 'rxjs'; + +async function main() { + // Subscribe to the observable using for await. + for await (const value of interval(1000)) { + console.log(value); + + if (value > 5) { + // Unsubscribe from the interval if we get a value greater than 5 + break; + } + } +} + +main(); +``` + +#### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`[asyncIterator]`](../../rxjs/classes/Observable.md#asynciterator) + +### complete() + +```ts +complete(): void; +``` + +Defined in: [rxjs/src/internal/observable/dom/WebSocketSubject.ts:350](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/dom/WebSocketSubject.ts#L350) + +#### Returns + +`void` + +### error() + +```ts +error(err: any): void; +``` + +Defined in: [rxjs/src/internal/observable/dom/WebSocketSubject.ts:335](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/dom/WebSocketSubject.ts#L335) + +#### Parameters + +| Parameter | Type | +| --------- | ----- | +| `err` | `any` | + +#### Returns + +`void` + +### forEach() + +```ts +forEach(next: (value: Out) => void): Promise; +``` + +Defined in: [observable/src/observable.ts:757](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L757) + +Used as a NON-CANCELLABLE means of subscribing to an observable, for use with +APIs that expect promises, like `async/await`. You cannot unsubscribe from this. + +**WARNING**: Only use this with observables you _know_ will complete. If the source +observable does not complete, you will end up with a promise that is hung up, and +potentially all of the state of an async function hanging out in memory. To avoid +this situation, look into adding something like [timeout](../../rxjs/functions/timeout.md), [take](../../rxjs/functions/take.md), +[takeWhile](../../rxjs/functions/takeWhile.md), or [takeUntil](../../rxjs/functions/takeUntil.md) amongst others. + +#### Parameters + +| Parameter | Type | Description | +| --------- | -------------------------- | --------------------------------------------------- | +| `next` | (`value`: `Out`) => `void` | A handler for each value emitted by the observable. | + +#### Returns + +`Promise`\<`void`\> + +A promise that either resolves on observable completion or +rejects with the handled error. + +#### Example + +```ts +import { interval, take } from 'rxjs'; + +const source$ = interval(1000).pipe(take(4)); + +async function getTotal() { + let total = 0; + + await source$.forEach((value) => { + total += value; + console.log('observable -> ' + value); + }); + + return total; +} + +getTotal().then((total) => console.log('Total: ' + total)); + +// Expected: +// 'observable -> 0' +// 'observable -> 1' +// 'observable -> 2' +// 'observable -> 3' +// 'Total: 6' +``` + +#### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`forEach`](../../rxjs/classes/Observable.md#foreach) + +### multiplex() + +```ts +multiplex( + subMsg: () => In, + unsubMsg: () => In, +messageFilter: (value: Out) => boolean): Observable; +``` + +Defined in: [rxjs/src/internal/observable/dom/WebSocketSubject.ts:219](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/dom/WebSocketSubject.ts#L219) + +Creates an [Observable](../../rxjs/classes/Observable.md), that when subscribed to, sends a message, +defined by the `subMsg` function, to the server over the socket to begin a +subscription to data over that socket. Once data arrives, the +`messageFilter` argument will be used to select the appropriate data for +the resulting Observable. When finalization occurs, either due to +unsubscription, completion, or error, a message defined by the `unsubMsg` +argument will be sent to the server over the WebSocketSubject. + +#### Parameters + +| Parameter | Type | Description | +| --------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `subMsg` | () => `In` | A function to generate the subscription message to be sent to the server. This will still be processed by the serializer in the WebSocketSubject's config. (Which defaults to JSON serialization) | +| `unsubMsg` | () => `In` | A function to generate the unsubscription message to be sent to the server at finalization. This will still be processed by the serializer in the WebSocketSubject's config. | +| `messageFilter` | (`value`: `Out`) => `boolean` | A predicate for selecting the appropriate messages from the server for the output stream. | + +#### Returns + +[`Observable`](../../rxjs/classes/Observable.md)\<`Out`\> + +### next() + +```ts +next(value: In): void; +``` + +Defined in: [rxjs/src/internal/observable/dom/WebSocketSubject.ts:323](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/dom/WebSocketSubject.ts#L323) + +#### Parameters + +| Parameter | Type | +| --------- | ---- | +| `value` | `In` | + +#### Returns + +`void` + +### pipe() + +Used to stitch together functional operators into a chain. + +#### Example + +```ts +import { interval, filter, map, scan } from 'rxjs'; + +interval(1000) + .pipe( + filter((x) => x % 2 === 0), + map((x) => x + x), + scan((acc, x) => acc + x) + ) + .subscribe((x) => console.log(x)); +``` + +#### Call Signature + +```ts +pipe(): Observable; +``` + +Defined in: [observable/src/observable.ts:788](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L788) + +##### Returns + +[`Observable`](../../rxjs/classes/Observable.md)\<`Out`\> + +##### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`pipe`](../../rxjs/classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>): A; +``` + +Defined in: [observable/src/observable.ts:789](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L789) + +##### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../../rxjs/classes/Observable.md)\<`Out`\>, `A`\> | + +##### Returns + +`A` + +##### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`pipe`](../../rxjs/classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>(op1: UnaryFunction, A>, op2: UnaryFunction): B; +``` + +Defined in: [observable/src/observable.ts:790](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L790) + +##### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../../rxjs/classes/Observable.md)\<`Out`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | + +##### Returns + +`B` + +##### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`pipe`](../../rxjs/classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction): C; +``` + +Defined in: [observable/src/observable.ts:791](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L791) + +##### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../../rxjs/classes/Observable.md)\<`Out`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | + +##### Returns + +`C` + +##### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`pipe`](../../rxjs/classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction): D; +``` + +Defined in: [observable/src/observable.ts:792](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L792) + +##### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../../rxjs/classes/Observable.md)\<`Out`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | + +##### Returns + +`D` + +##### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`pipe`](../../rxjs/classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction): E; +``` + +Defined in: [observable/src/observable.ts:793](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L793) + +##### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../../rxjs/classes/Observable.md)\<`Out`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | + +##### Returns + +`E` + +##### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`pipe`](../../rxjs/classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction): F; +``` + +Defined in: [observable/src/observable.ts:800](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L800) + +##### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../../rxjs/classes/Observable.md)\<`Out`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | + +##### Returns + +`F` + +##### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`pipe`](../../rxjs/classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction): G; +``` + +Defined in: [observable/src/observable.ts:808](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L808) + +##### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../../rxjs/classes/Observable.md)\<`Out`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | + +##### Returns + +`G` + +##### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`pipe`](../../rxjs/classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction): H; +``` + +Defined in: [observable/src/observable.ts:817](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L817) + +##### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../../rxjs/classes/Observable.md)\<`Out`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | + +##### Returns + +`H` + +##### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`pipe`](../../rxjs/classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction): I; +``` + +Defined in: [observable/src/observable.ts:827](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L827) + +##### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../../rxjs/classes/Observable.md)\<`Out`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | + +##### Returns + +`I` + +##### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`pipe`](../../rxjs/classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... +operations: OperatorFunction[]): Observable; +``` + +Defined in: [observable/src/observable.ts:838](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L838) + +##### Parameters + +| Parameter | Type | +| --------------- | --------------------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../../rxjs/classes/Observable.md)\<`Out`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `OperatorFunction`\<`any`, `any`\>[] | + +##### Returns + +[`Observable`](../../rxjs/classes/Observable.md)\<`unknown`\> + +##### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`pipe`](../../rxjs/classes/Observable.md#pipe) + +#### Call Signature + +```ts +pipe<>( + op1: UnaryFunction, A>, + op2: UnaryFunction, + op3: UnaryFunction, + op4: UnaryFunction, + op5: UnaryFunction, + op6: UnaryFunction, + op7: UnaryFunction, + op8: UnaryFunction, + op9: UnaryFunction, ... + operations: UnaryFunction[]): unknown; +``` + +Defined in: [observable/src/observable.ts:850](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L850) + +##### Parameters + +| Parameter | Type | +| --------------- | --------------------------------------------------------------------------------- | +| `op1` | `UnaryFunction`\<[`Observable`](../../rxjs/classes/Observable.md)\<`Out`\>, `A`\> | +| `op2` | `UnaryFunction`\<`A`, `B`\> | +| `op3` | `UnaryFunction`\<`B`, `C`\> | +| `op4` | `UnaryFunction`\<`C`, `D`\> | +| `op5` | `UnaryFunction`\<`D`, `E`\> | +| `op6` | `UnaryFunction`\<`E`, `F`\> | +| `op7` | `UnaryFunction`\<`F`, `G`\> | +| `op8` | `UnaryFunction`\<`G`, `H`\> | +| `op9` | `UnaryFunction`\<`H`, `I`\> | +| ...`operations` | `UnaryFunction`\<`any`, `any`\>[] | + +##### Returns + +`unknown` + +##### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`pipe`](../../rxjs/classes/Observable.md#pipe) + +### subscribe() + +```ts +subscribe(observerOrNext?: Partial> | (value: Out) => void | null): Subscription; +``` + +Defined in: [observable/src/observable.ts:695](https://github.com/ReactiveX/rxjs/blob/master/packages/observable/src/observable.ts#L695) + +Invokes an execution of an Observable and registers Observer handlers for notifications it will emit. + +Use it when you have all these Observables, but still nothing is happening. + +`subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It +might be for example a function that you passed to Observable's constructor, but most of the time it is +a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means +that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often +the thought. + +Apart from starting the execution of an Observable, this method allows you to listen for values +that an Observable emits, as well as for when it completes or errors. You can achieve this in two +of the following ways. + +The first way is creating an object that implements [Observer](../../rxjs/interfaces/Observer.md) interface. It should have methods +defined by that interface, but note that it should be just a regular JavaScript object, which you can create +yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do +not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also +that your object does not have to implement all methods. If you find yourself creating a method that doesn't +do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens, +it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead, +use the [onUnhandledError](../../rxjs/interfaces/GlobalConfig.md#onunhandlederror) configuration option or use a runtime handler (like `window.onerror` or +`process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide +an `error` method to avoid missing thrown errors. + +The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods. +This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent +of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer, +if you do not need to listen for something, you can omit a function by passing `undefined` or `null`, +since `subscribe` recognizes these functions by where they were placed in function call. When it comes +to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously. + +You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events +and you also handled emissions internally by using operators (e.g. using `tap`). + +Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object. +This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean +up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback +provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable. + +Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously. +It is an Observable itself that decides when these functions will be called. For example [of](../../rxjs/functions/of.md) +by default emits all its values synchronously. Always check documentation for how given Observable +will behave when subscribed and if its default behavior can be modified with a `scheduler`. + +#### Parameters + +| Parameter | Type | Description | +| ----------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `observerOrNext?` | `Partial`\<`Observer`\<`Out`\>\> \| (`value`: `Out`) => `void` \| `null` | Either an [Observer](../../rxjs/interfaces/Observer.md) with some or all callback methods, or the `next` handler that is called for each value emitted from the subscribed Observable. | + +#### Returns + +[`Subscription`](../../rxjs/classes/Subscription.md) + +A subscription reference to the registered handlers. + +#### Inherited from + +[`Observable`](../../rxjs/classes/Observable.md).[`subscribe`](../../rxjs/classes/Observable.md#subscribe) + +### unsubscribe() + +```ts +unsubscribe(): void; +``` + +Defined in: [rxjs/src/internal/observable/dom/WebSocketSubject.ts:383](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/dom/WebSocketSubject.ts#L383) + +#### Returns + +`void` diff --git a/apps/rxjs.dev-next/docs/api/webSocket/functions/webSocket.md b/apps/rxjs.dev-next/docs/api/webSocket/functions/webSocket.md new file mode 100644 index 0000000000..3c8bac6428 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/webSocket/functions/webSocket.md @@ -0,0 +1,195 @@ +[API](../../index.md) / [webSocket](../index.md) / webSocket + +# Function: webSocket() + +```ts +function webSocket<>(urlConfigOrSource: string | WebSocketSubjectConfig): WebSocketSubject; +``` + +Defined in: [rxjs/src/internal/observable/dom/webSocket.ts:182](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/dom/webSocket.ts#L182) + +Wrapper around the w3c-compatible WebSocket object provided by the browser. + +[Subject](../../rxjs/classes/Subject.md) that communicates with a server via WebSocket + +`webSocket` is a factory function that produces a `WebSocketSubject`, +which can be used to make WebSocket connection with an arbitrary endpoint. +`webSocket` accepts as an argument either a string with url of WebSocket endpoint, or an +[WebSocketSubjectConfig](../interfaces/WebSocketSubjectConfig.md) object for providing additional configuration, as +well as Observers for tracking lifecycle of WebSocket connection. + +When `WebSocketSubject` is subscribed, it attempts to make a socket connection, +unless there is one made already. This means that many subscribers will always listen +on the same socket, thus saving resources. If however, two instances are made of `WebSocketSubject`, +even if these two were provided with the same url, they will attempt to make separate +connections. When consumer of a `WebSocketSubject` unsubscribes, socket connection is closed, +only if there are no more subscribers still listening. If after some time a consumer starts +subscribing again, connection is reestablished. + +Once connection is made, whenever a new message comes from the server, `WebSocketSubject` will emit that +message as a value in the stream. By default, a message from the socket is parsed via `JSON.parse`. If you +want to customize how deserialization is handled (if at all), you can provide custom `resultSelector` +function in [WebSocketSubject](../classes/WebSocketSubject.md). When connection closes, stream will complete, provided it happened without +any errors. If at any point (starting, maintaining or closing a connection) there is an error, +stream will also error with whatever WebSocket API has thrown. + +By virtue of being a [Subject](../../rxjs/classes/Subject.md), `WebSocketSubject` allows for receiving and sending messages from the server. In order +to communicate with a connected endpoint, use `next`, `error` and `complete` methods. `next` sends a value to the server, so bear in mind +that this value will not be serialized beforehand. Because of This, `JSON.stringify` will have to be called on a value by hand, +before calling `next` with a result. Note also that if at the moment of nexting value +there is no socket connection (for example no one is subscribing), those values will be buffered, and sent when connection +is finally established. `complete` method closes socket connection. `error` does the same, +as well as notifying the server that something went wrong via status code and string with details of what happened. +Since status code is required in WebSocket API, `WebSocketSubject` does not allow, like regular `Subject`, +arbitrary values being passed to the `error` method. It needs to be called with an object that has `code` +property with status code number and optional `reason` property with string describing details +of an error. + +Calling `next` does not affect subscribers of `WebSocketSubject` - they have no +information that something was sent to the server (unless of course the server +responds somehow to a message). On the other hand, since calling `complete` triggers +an attempt to close socket connection. If that connection is closed without any errors, stream will +complete, thus notifying all subscribers. And since calling `error` closes +socket connection as well, just with a different status code for the server, if closing itself proceeds +without errors, subscribed Observable will not error, as one might expect, but complete as usual. In both cases +(calling `complete` or `error`), if process of closing socket connection results in some errors, _then_ stream +will error. + +**Multiplexing** + +`WebSocketSubject` has an additional operator, not found in other Subjects. It is called `multiplex` and it is +used to simulate opening several socket connections, while in reality maintaining only one. +For example, an application has both chat panel and real-time notifications about sport news. Since these are two distinct functions, +it would make sense to have two separate connections for each. Perhaps there could even be two separate services with WebSocket +endpoints, running on separate machines with only GUI combining them together. Having a socket connection +for each functionality could become too resource expensive. It is a common pattern to have single +WebSocket endpoint that acts as a gateway for the other services (in this case chat and sport news services). +Even though there is a single connection in a client app, having the ability to manipulate streams as if it +were two separate sockets is desirable. This eliminates manually registering and unregistering in a gateway for +given service and filter out messages of interest. This is exactly what `multiplex` method is for. + +Method accepts three parameters. First two are functions returning subscription and unsubscription messages +respectively. These are messages that will be sent to the server, whenever consumer of resulting Observable +subscribes and unsubscribes. Server can use them to verify that some kind of messages should start or stop +being forwarded to the client. In case of the above example application, after getting subscription message with proper identifier, +gateway server can decide that it should connect to real sport news service and start forwarding messages from it. +Note that both messages will be sent as returned by the functions, they are by default serialized using JSON.stringify, just +as messages pushed via `next`. Also bear in mind that these messages will be sent on _every_ subscription and +unsubscription. This is potentially dangerous, because one consumer of an Observable may unsubscribe and the server +might stop sending messages, since it got unsubscription message. This needs to be handled +on the server or using [connectable](../../rxjs/functions/connectable.md) on a Observable returned from 'multiplex'. + +Last argument to `multiplex` is a `messageFilter` function which should return a boolean. It is used to filter out messages +sent by the server to only those that belong to simulated WebSocket stream. For example, server might mark these +messages with some kind of string identifier on a message object and `messageFilter` would return `true` +if there is such identifier on an object emitted by the socket. Messages which returns `false` in `messageFilter` are simply skipped, +and are not passed down the stream. + +Return value of `multiplex` is an Observable with messages incoming from emulated socket connection. Note that this +is not a `WebSocketSubject`, so calling `next` or `multiplex` again will fail. For pushing values to the +server, use root `WebSocketSubject`. + +## Parameters + +| Parameter | Type | Description | +| ------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | +| `urlConfigOrSource` | \| `string` \| [`WebSocketSubjectConfig`](../interfaces/WebSocketSubjectConfig.md)\<`In`, `Out`\> | The WebSocket endpoint as an url or an object with configuration and additional Observers. | + +## Returns + +[`WebSocketSubject`](../classes/WebSocketSubject.md)\<`In`, `Out`\> + +Subject which allows to both send and receive messages via WebSocket connection. + +## Example + +Listening for messages from the server + +```ts +import { webSocket } from 'rxjs/webSocket'; + +const subject = webSocket('ws://localhost:8081'); + +subject.subscribe({ + next: (msg) => console.log('message received: ' + msg), // Called whenever there is a message from the server. + error: (err) => console.log(err), // Called if at any point WebSocket API signals some kind of error. + complete: () => console.log('complete'), // Called when connection is closed (for whatever reason). +}); +``` + +Pushing messages to the server + +```ts +import { webSocket } from 'rxjs/webSocket'; + +interface SendMsg { + message: string; +} + +interface RespMsg { + data: any; +} + +const subject = webSocket('ws://localhost:8081'); + +subject.subscribe(); +// Note that at least one consumer has to subscribe to the created subject - otherwise "nexted" values will be just buffered and not sent, +// since no connection was established! + +subject.next({ message: 'some message' }); +// This will send a message to the server once a connection is made. Remember value is serialized with JSON.stringify by default! + +subject.complete(); // Closes the connection. + +subject.error({ code: 4000, reason: 'I think our app just broke!' }); +// Also closes the connection, but let's the server know that this closing is caused by some error. +``` + +Multiplexing WebSocket + +```ts +import { webSocket } from 'rxjs/webSocket'; + +interface SubMsg { + subscribe: string; +} + +interface UnsubMsg { + unsubscribe: string; +} + +interface RespMsg { + type: string; + data: any; +} + +const subject = webSocket('ws://localhost:8081'); + +const observableA = subject.multiplex( + () => ({ subscribe: 'A' }), // When server gets this message, it will start sending messages for 'A'... + () => ({ unsubscribe: 'A' }), // ...and when gets this one, it will stop. + (message) => message.type === 'A' // If the function returns `true` message is passed down the stream. Skipped if the function returns false. +); + +const observableB = subject.multiplex( + // And the same goes for 'B'. + () => ({ subscribe: 'B' }), + () => ({ unsubscribe: 'B' }), + (message) => message.type === 'B' +); + +const subA = observableA.subscribe((messageForA) => console.log(messageForA)); +// At this moment WebSocket connection is established. Server gets '{"subscribe": "A"}' message and starts sending messages for 'A', +// which we log here. + +const subB = observableB.subscribe((messageForB) => console.log(messageForB)); +// Since we already have a connection, we just send '{"subscribe": "B"}' message to the server. It starts sending messages for 'B', +// which we log here. + +subB.unsubscribe(); +// Message '{"unsubscribe": "B"}' is sent to the server, which stops sending 'B' messages. + +subA.unsubscribe(); +// Message '{"unsubscribe": "A"}' makes the server stop sending messages for 'A'. Since there is no more subscribers to root Subject, +// socket connection closes. +``` diff --git a/apps/rxjs.dev-next/docs/api/webSocket/index.md b/apps/rxjs.dev-next/docs/api/webSocket/index.md new file mode 100644 index 0000000000..21f8c68a30 --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/webSocket/index.md @@ -0,0 +1,15 @@ +[API](../index.md) / webSocket + +# webSocket + +## Classes + +- [WebSocketSubject](classes/WebSocketSubject.md) + +## Interfaces + +- [WebSocketSubjectConfig](interfaces/WebSocketSubjectConfig.md) + +## Functions + +- [webSocket](functions/webSocket.md) diff --git a/apps/rxjs.dev-next/docs/api/webSocket/interfaces/WebSocketSubjectConfig.md b/apps/rxjs.dev-next/docs/api/webSocket/interfaces/WebSocketSubjectConfig.md new file mode 100644 index 0000000000..d7ccd0334d --- /dev/null +++ b/apps/rxjs.dev-next/docs/api/webSocket/interfaces/WebSocketSubjectConfig.md @@ -0,0 +1,118 @@ +[API](../../index.md) / [webSocket](../index.md) / WebSocketSubjectConfig + +# Interface: WebSocketSubjectConfig + +> WebSocketSubjectConfig is a plain Object that allows us to make our +> webSocket configurable. + +## Description + +Provides flexibility to [webSocket](../functions/webSocket.md) + +It defines a set of properties to provide custom behavior in specific +moments of the socket's lifecycle. When the connection opens we can +use `openObserver`, when the connection is closed `closeObserver`, if we +are interested in listening for data coming from server: `deserializer`, +which allows us to customize the deserialization strategy of data before passing it +to the socket client. By default, `deserializer` is going to apply `JSON.parse` to each message coming +from the Server. + +Defined in: [rxjs/src/internal/observable/dom/WebSocketSubject.ts:102](https://github.com/ReactiveX/rxjs/blob/master/packages/rxjs/src/internal/observable/dom/WebSocketSubject.ts#L102) + +## Example + +**deserializer**, the default for this property is `JSON.parse` but since there are just two options +for incoming data, either be text or binary data. We can apply a custom deserialization strategy +or just simply skip the default behaviour. + +```ts +import { webSocket } from 'rxjs/webSocket'; + +const wsSubject = webSocket({ + url: 'ws://localhost:8081', + //Apply any transformation of your choice. + deserializer: ({ data }) => data, +}); + +wsSubject.subscribe(console.log); + +// Let's suppose we have this on the Server: ws.send('This is a msg from the server') +//output +// +// This is a msg from the server +``` + +**serializer** allows us to apply custom serialization strategy but for the outgoing messages. + +```ts +import { webSocket } from 'rxjs/webSocket'; + +const wsSubject = webSocket({ + url: 'ws://localhost:8081', + // Apply any transformation of your choice. + serializer: (msg) => JSON.stringify({ channel: 'webDevelopment', msg: msg }), +}); + +wsSubject.subscribe(() => subject.next('msg to the server')); + +// Let's suppose we have this on the Server: +// ws.on('message', msg => console.log); +// ws.send('This is a msg from the server'); +// output at server side: +// +// {"channel":"webDevelopment","msg":"msg to the server"} +``` + +**closeObserver** allows us to set a custom error when an error raises up. + +```ts +import { webSocket } from 'rxjs/webSocket'; + +const wsSubject = webSocket({ + url: 'ws://localhost:8081', + closeObserver: { + next() { + const customError = { code: 6666, reason: 'Custom evil reason' }; + console.log(`code: ${customError.code}, reason: ${customError.reason}`); + }, + }, +}); + +// output +// code: 6666, reason: Custom evil reason +``` + +**openObserver**, Let's say we need to make some kind of init task before sending/receiving msgs to the +webSocket or sending notification that the connection was successful, this is when +openObserver is useful for. + +```ts +import { webSocket } from 'rxjs/webSocket'; + +const wsSubject = webSocket({ + url: 'ws://localhost:8081', + openObserver: { + next: () => { + console.log('Connection ok'); + }, + }, +}); + +// output +// Connection ok +``` + +## Properties + +| Property | Type | Description | +| ------------------------------------------------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `binaryType?` | `"arraybuffer"` \| `"blob"` | Sets the `binaryType` property of the underlying WebSocket. | +| `closeObserver?` | [`NextObserver`](../../rxjs/interfaces/NextObserver.md)\<`CloseEvent`\> | An Observer that watches when close events occur on the underlying web socket | +| `closingObserver?` | [`NextObserver`](../../rxjs/interfaces/NextObserver.md)\<`void`\> | An Observer that watches when a close is about to occur due to unsubscription. | +| `deserializer?` | (`e`: `MessageEvent`) => `Out` | A deserializer used for messages arriving on the socket from the server. Defaults to JSON.parse. | +| `openObserver?` | [`NextObserver`](../../rxjs/interfaces/NextObserver.md)\<`Event`\> | An Observer that watches when open events occur on the underlying web socket. | +| `protocol?` | `string` \| `string`[] | The protocol to use to connect | +| ~~`resultSelector?`~~ | (`e`: `MessageEvent`) => `Out` | **Deprecated** Will be removed in v8. Use [deserializer](#deserializer) instead. | +| `serializer?` | (`value`: `In`) => `WebSocketMessage` | A serializer used to create messages from passed values before the messages are sent to the server. Defaults to JSON.stringify. | +| `url` | `string` | The url of the socket server to connect to | +| `WebSocketCtor?` | (`url`: `string`, `protocols?`: `string` \| `string`[]) => `WebSocket` | A WebSocket constructor to use. This is useful for situations like using a WebSocket impl in Node (WebSocket is a DOM API), or for mocking a WebSocket for testing purposes | diff --git a/apps/rxjs.dev-next/docs/black-lives-matter.md b/apps/rxjs.dev-next/docs/black-lives-matter.md new file mode 100644 index 0000000000..87df36c2ab --- /dev/null +++ b/apps/rxjs.dev-next/docs/black-lives-matter.md @@ -0,0 +1,27 @@ + + +
+ +# Black Lives Matter + +We stand in solidarity with the Black Lives Matter movement. We believe that technologists must not be silent in the fight to end racial inequality. + +We ask you to stand with us and help educate your team members and those in your network on how to help dismantle a system that oppresses Black people. Find a list of starting resources here: + +- [Let's get to the root of racial injustice by Megan Ming Francis](https://www.youtube.com/watch?v=-aCn72iXO9s) +- [What Leaders can do for Black Employees by Dr. Akilah Cadet](http://www.changecadet.com/blog/2020/5/30/what-leaders-can-do-for-black-employees) +- [Hey Employers: Do Black Lives Matter? by Pariss Athena](https://blacktechpipeline.substack.com/p/hey-employers-do-black-lives-matter) +- [Algorithms of Oppression by Safiya Umoja Noble](https://safiyaunoble.com/) +- [Rage Inside The Machine by Robert Smith](https://www.rageinsidethemachine.com/) +- [Technically Wrong by Sara Wachter-Boettcher](https://www.sarawb.com/) + +In solidarity, we ask you to consider financially supporting efforts such as [Black Lives Matter](https://blacklivesmatter.com/), [The Equal Justice Initiative](https://support.eji.org/give/153413/#!/donation/checkout) or local charity organizations. diff --git a/apps/rxjs.dev-next/docs/code-of-conduct.md b/apps/rxjs.dev-next/docs/code-of-conduct.md new file mode 100644 index 0000000000..9c68fef5d0 --- /dev/null +++ b/apps/rxjs.dev-next/docs/code-of-conduct.md @@ -0,0 +1,73 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +education, socio-economic status, nationality, personal appearance, race, +religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting Ben Lesh (ben@benlesh.com), Tracy Lee (tracy@thisdot.co) or OJ Kwon (kwon.ohjoong@gmail.com). All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org diff --git a/apps/rxjs.dev-next/docs/deprecations/6-to-7-change-summary.md b/apps/rxjs.dev-next/docs/deprecations/6-to-7-change-summary.md new file mode 100644 index 0000000000..e2d1625e04 --- /dev/null +++ b/apps/rxjs.dev-next/docs/deprecations/6-to-7-change-summary.md @@ -0,0 +1,439 @@ +# RxJS 6.x to 7.x Detailed Change List + +This document contains a detailed list of changes between RxJS 6.x and RxJS 7.x, presented in the order they can be found when diffing the TypeScript APIs in various module files. + +## module `rxjs` + +### Breaking changes + +#### AsyncSubject + +- `_subscribe` method is no longer `public` and is now `protected`. +- no longer has its own implementation of the `error` method inherited from `Subject`. + +#### BehaviorSubject + +- `_subscribe` method is no longer `public` and is now `protected`. +- `value` property is a getter `get value()` instead of `readonly value`, and can no longer be forcibly set. + +#### bindCallback + +- Generic signatures have changed. Do not explicitly pass generics. + +#### combineLatest + +- Generic signatures have changed. Do not explicitly pass generics. + +#### concat + +- Generic signatures have changed. Do not explicitly pass generics. + +#### ConnectableObservable + +- `_isComplete` is no longer a property. +- `_subscribe` method is no longer `public` and is now `protected`. + +#### defer + +- Generic argument no longer extends `void`. +- `defer` no longer allows factories to return void or undefined. All factories passed to `defer` must return a proper `ObservableInput`, such as `Observable`, `Promise`, et al. To get the same behavior as you may have relied on previously, `return EMPTY` or `return of()` from the factory. + +#### forkJoin + +- Generic signatures have changed. Do not explicitly pass generics. + +#### fromEvent + +- The `fromEvent` signatures have been changed and there are now separate signatures for each type of target - DOM, Node, jQuery, etc. That means that an attempt to pass options - like `{ once: true }` - to a target that does not support an options argument will result in a TypeScript error. + +#### GroupedObservable + +- No longer publicly exposes `_subscribe` +- `key` properly is `readonly`. +- No longer publicly exposes `constructor`. + +#### iif + +- Generic signatures have changed. Do not explicitly pass generics. +- `iif` will no longer allow result arguments that are `undefined`. This was a bad call pattern that was likely an error in most cases. If for some reason you are relying on this behavior, simply substitute `EMPTY` in place of the `undefined` argument. This ensures that the behavior was intentional and desired, rather than the result of an accidental `undefined` argument. + +#### isObservable + +- No longer has a generic and returns `Observable`, you must cast the result. + +#### merge + +- Generic signatures have changed. Do not explicitly pass generics. + +#### Notification + +- The `error` property is now `readonly`. +- The `hasValue` property is now `readonly`. +- The `kind` property is now `readonly`. +- The `value` property is now `readonly` and may be `undefined`. +- `constructor` signature now only allows valid construction. For example `new Notification('C', 'some_value')` will be an error in TypeScript. + +#### Observable + +- `_isScalar` property removed. +- `_subscribe` method is no longer `public` and is now marked `@internal`. +- `_trySubscribe` method is no longer `public` and is now `@internal`. +- `pipe` method calls with `9` or more arguments will now return `Observable` rather than `Observable<{}>`. +- `toPromise` method now correctly returns `Promise` instead of `Promise`. This is a correction without a runtime change, because if the observable does not emit a value before completion, the promise will resolve with `undefined`. +- `static if` and `static throw` properties are no longer defined. They were unused in version 6. +- `lift`, `source`, and `operator` properties are still **deprecated**, and should not be used. They are implementation details, and will very likely be renamed or missing in version 8. + +#### of + +- Generic signatures have changed. Do not explicitly pass generics. + +#### onErrorResumeNext + +- Generic signatures have changed. Do not explicitly pass generics. + +#### pairs + +- Generic signatures have changed. Do not explicitly pass generics. +- `pairs` will no longer function in IE without a polyfill for `Object.entries`. `pairs` itself is also deprecated in favor of users just using `from(Object.entries(obj))`. + +#### partition + +- Generic signatures have changed. Do not explicitly pass generics. + +#### pipe + +- Calls with `9` or more arguments will now return `(arg: A) => unknown` rather than `(arg: A) => {}`. + +#### race + +- Generic signatures have changed. Do not explicitly pass generics. +- `race` will no longer subscribe to subsequent observables if a provided source synchronously errors or completes. This means side effects that might have occurred during subscription in those rare cases will no longer occur. + +#### ReplaySubject + +- `_getNow` method has been removed. +- `_subscribe` method is no longer `public` and is now `protected`. + +#### Subscribable + +- `subscribe` will accept `Partial>` now. All overloads with functions as arguments have been removed. This is because `Subscribable` is intended to map to the basic observable contract from the TC39 proposal and the return type of a call to `[Symbol.observable]()`. + +#### SubscribableOrPromise + +- See notes on `Subscribable` above. + +#### Subscriber + +- `destination` property must now be a `Subscriber` or full `Observer`. +- `syncErrorThrowable` property has been removed. +- `syncErrorThrown` property has been removed. +- `syncErrorValue` property has been removed. +- `_unsubscribeAndRecycle` method has been removed. + +#### Subscription + +- `_parentOrParents` property has been removed. +- `add` method returns `void` and no longer returns a `Subscription`. Returning `Subscription` was an old behavior from the early days of version 5. If you add a function to a subscription (i.e. `subscription.add(fn)`), you can remove that function directly by calling `remove` with the same function instance. (i.e. `subscription.remove(fn)`). Previously, you needed to get the returned `Subscription` object and pass _that_ to `remove`. In version 6 and lower, the `Subscription` returned by calling `add` with another `Subscription` was always the same subscription you passed in. (meaning `subscription.add(subs1).add(subs2)` was an antipattern and the same as `subscription.add(subs1); subs1.add(subs2);`. + +#### VirtualAction + +- The static `sortActions` method has been removed. + +#### zip + +- Generic signatures have changed. Do not explicitly pass generics. +- Zipping a single array will now have a different result. This is an extreme corner-case, because it is very unlikely that anyone would want to zip an array with nothing at all. The workaround would be to wrap the array in another array `zip([[1,2,3]])`. But again, that's pretty weird. + +--- + +### New Features + +#### animationFrames + +- A new method for creating a stream of animation frames. Each event will carry with it a high-resolution timestamp, and an elapsed time since observation was started. + +#### config + +##### onUnhandledError + +- A handler for dealing with errors that make it all the way down to the "end" of the observation chain when there is no error handler in the observer. Useful for doing things like logging unhandled errors in RxJS observable chains. + +##### onStoppedNotification + +- A handler for edge cases where a subscriber within RxJS is notified after it has already "stopped", that is, a point in time where it has received an error or complete, but hasn't yet finalized. This is mostly useful for logging purposes. + +##### useDeprecatedNextContext + +- In RxJS 6, a little-used feature allowed users to access the `subscriber` directly as `this` within a call to the `next` handler. The problem with this is it incurred heavy performance penalties. That behavior has been changed (because it wasn't really documented and it was barely ever used) to not change the `this` context of any user-provided subscription handlers. If you need to get that feature back, you can switch it on with this flag. Note this behavior will be removed completely in version 8. + +#### connectable + +- This is the new means for creating a `ConnectableObservable`, and really is a replacement for non-selector usage of `multicast` and `publish` variants. Simply pass your source observable to `connectable` with the `Subject` you'd like to connect through. + +#### firstValueFrom + +- A better, more tree-shakable replacement for `toPromise()` (which is now deprecated). This function allows the user to convert any `Observable` into a `Promise` that will resolve when the source observable emits its first value. If the source observable closes without emitting a value, the returned promise will reject with an `EmptyError`, or it will resolve with a configured `defaultValue`. For more information, see the [deprecation guide](/deprecations/to-promise). + +#### lastValueFrom + +- A better, more tree-shakable replacement for `toPromise()` (which is now deprecated). This function allows the user to convert any `Observable` in to a `Promise` that will resolve when the source observable emits the last value. If the source observable closes without emitting a value, the returned promise will reject with an `EmptyError`, or it will resolve with a configured `defaultValue`. For more information, see the [deprecation guide](/deprecations/to-promise). + +#### ObservableInput + +- This is just a type, but it's important. This type defines the allowed types that can be passed to almost every API within RxJS that accepts an Observable. It has always accepted `Observable`, `Promise`, `Iterable`, and `ArrayLike`. Now it will also accept `AsyncIterable` and `ReadableStream`. + +##### AsyncIterable + +- `AsyncIterables` such as those defined by `IxJS` or by async generators (`async function*`), may now be passed to any API that accepts an observable, and can be converted to an `Observable` directly using `from`. + +##### ReadableStream + +- `ReadableStream` such as those returned by `fetch`, et al, can be passed to any API that accepts an observable, and can be converted to `Observable` directly using `from`. + +#### ReplaySubject + +- A [bug was fixed](https://github.com/ReactiveX/rxjs/pull/5696) that prevented a completed or errored `ReplaySubject` from accumulating values in its buffer when resubscribed to another source. This breaks some uses - like [this StackOverflow answer](https://stackoverflow.com/a/54957061) - that depended upon the buggy behavior. + +#### Subscription + +- Now allows adding and removing of functions directly via `add` and `remove` methods. + +#### throwError + +- Now accepts an `errorFactory` of `() => any` to defer the creation of the error until the time it will be emitted. It is recommended to use this method, as Errors created in most popular JavaScript runtimes will retain all values in the current scope for debugging purposes. + +## module `rxjs/operators` + +### Breaking Changes + +#### audit + +- The observable returned by the `audit` operator's duration selector must emit a next notification to end the duration. Complete notifications no longer end the duration. +- `audit` now emits the last value from the source when the source completes. Previously, `audit` would mirror the completion without emitting the value. + +#### auditTime + +- `auditTime` now emits the last value from the source when the source completes, after the audit duration elapses. Previously, `auditTime` would mirror the completion without emitting the value and without waiting for the audit duration to elapse. + +#### buffer + +- `buffer` now subscribes to the source observable before it subscribes to the closing notifier. Previously, it subscribed to the closing notifier first. +- Final buffered values will now always be emitted. To get the same behavior as the previous release, you can use `endWith` and `skipLast(1)`, like so: `source$.pipe(buffer(notifier$.pipe(endWith(true))), skipLast(1))` +- `closingNotifier` completion no longer completes the result of `buffer`. If that is truly a desired behavior, then you should use `takeUntil`. Something like: `source$.pipe(buffer(notifier$), takeUntil(notifier$.pipe(ignoreElements(), endWith(true))))`, where `notifier$` is multicast, although there are many ways to compose this behavior. + +#### bufferToggle + +- The observable returned by the `bufferToggle` operator's closing selector must emit a next notification to close the buffer. Complete notifications no longer close the buffer. + +#### bufferWhen + +- The observable returned by the `bufferWhen` operator's closing selector must emit a next notification to close the buffer. Complete notifications no longer close the buffer. + +#### combineLatest + +- Generic signatures have changed. Do not explicitly pass generics. + +#### concat + +- Generic signatures have changed. Do not explicitly pass generics. +- Still deprecated, use the new `concatWith`. + +#### concatAll + +- Generic signatures have changed. Do not explicitly pass generics. + +#### concatMapTo + +- Generic signatures have changed. Do not explicitly pass generics. + +#### count + +- No longer passes `source` observable as a third argument to the predicate. That feature was rarely used, and of limited value. The workaround is to simply close over the source inside of the function if you need to access it in there. + +#### debounce + +- The observable returned by the `debounce` operator's duration selector must emit a next notification to end the duration. Complete notifications no longer end the duration. + +#### debounceTime + +- The `debounceTime` implementation is more efficient and no longer schedules an action for each received next notification. However, because the implementation now uses the scheduler's concept of time, any tests using Jasmine's `clock` will need to ensure that [`jasmine.clock().mockDate()`](https://jasmine.github.io/api/edge/Clock.html#mockDate) is called after `jasmine.clock().install()` - because Jasmine does not mock `Date.now()` by default. + +#### defaultIfEmpty + +- Generic signatures have changed. Do not explicitly pass generics. +- `defaultIfEmpty` requires a value be passed. Will no longer convert `undefined` to `null` for no good reason. + +#### delayWhen + +- `delayWhen` will no longer emit if the duration selector simply completes without a value. Notifiers must notify with a value, not a completion. + +#### endWith + +- Generic signatures have changed. Do not explicitly pass generics. + +#### expand + +- Generic signatures have changed. Do not explicitly pass generics. + +#### finalize + +- `finalize` will now unsubscribe from its source _before_ it calls its callback. That means that `finalize` callbacks will run in the order in which they occur in the pipeline: `source.pipe(finalize(() => console.log(1)), finalize(() => console.log(2)))` will log `1` and then `2`. Previously, callbacks were called in the reverse order. + +#### map + +- `thisArg` will now default to `undefined`. The previous default of `MapSubscriber` never made any sense. This will only affect code that calls map with a `function` and references `this` like so: `source.pipe(map(function () { console.log(this); }))`. There wasn't anything useful about doing this, so the breakage is expected to be very minimal. If anything we're no longer leaking an implementation detail. + +#### merge + +- Generic signatures have changed. Do not explicitly pass generics. +- Still deprecated, use the new `mergeWith`. + +#### mergeAll + +- Generic signatures have changed. Do not explicitly pass generics. + +#### mergeScan + +- `mergeScan` will no longer emit its inner state again upon completion. + +#### pluck + +- Generic signatures have changed. Do not explicitly pass generics. + +#### race + +- Generic signatures have changed. Do not explicitly pass generics. + +#### reduce + +- Generic signatures have changed. Do not explicitly pass generics. + +#### sample + +- The `sample` operator's notifier observable must emit a next notification to effect a sample. Complete notifications no longer effect a sample. + +#### scan + +- Generic signatures have changed. Do not explicitly pass generics. + +#### single + +- The `single` operator will now throw for scenarios where values coming in are either not present, or do not match the provided predicate. Error types have thrown have also been updated, please check documentation for changes. + +#### skipLast + +- `skipLast` will no longer error when passed a negative number, rather it will simply return the source, as though `0` was passed. + +#### startWith + +- Generic signatures have changed. Do not explicitly pass generics. + +#### switchAll + +- Generic signatures have changed. Do not explicitly pass generics. + +#### switchMapTo + +- Generic signatures have changed. Do not explicitly pass generics. + +#### take + +- `take` and will now throw runtime error for arguments that are negative or NaN, this includes non-TS calls like `take()`. + +#### takeLast + +- `takeLast` now has runtime assertions that throw `TypeError`s for invalid arguments. Calling `takeLast` without arguments or with an argument that is `NaN` will throw a `TypeError`. + +#### throttle + +- The observable returned by the `throttle` operator's duration selector must emit a next notification to end the duration. Complete notifications no longer end the duration. + +#### throwError + +- In an extreme corner case for usage, `throwError` is no longer able to emit a function as an error directly. If you need to push a function as an error, you will have to use the factory function to return the function like so: `throwError(() => functionToEmit)`, in other words `throwError(() => () => console.log('called later'))`. + +#### window + +- The `windowBoundaries` observable no longer completes the result. It was only ever meant to notify of the window boundary. To get the same behavior as the old behavior, you would need to add an `endWith` and a `skipLast(1)` like so: `source$.pipe(window(notifier$.pipe(endWith(true))), skipLast(1))`. + +#### windowToggle + +- The observable returned by the `windowToggle` operator's closing selector must emit a next notification to close the window. Complete notifications no longer close the window. + +#### withLatestFrom + +- Generic signatures have changed. Do not explicitly pass generics. + +#### zip + +- Generic signatures have changed. Do not explicitly pass generics. +- Still deprecated, use the new `zipWith`. +- `zip` operators will no longer iterate provided iterables "as needed", instead the iterables will be treated as push-streams just like they would be everywhere else in RxJS. This means that passing an endless iterable will result in the thread locking up, as it will endlessly try to read from that iterable. This puts us in line with all other Rx implementations. To work around this, it is probably best to use `map` or some combination of `map` and `zip`. For example, `zip(source$, iterator)` could be `source$.pipe(map(value => [value, iterator.next().value]))`. + +### New Features + +#### connect + +- New operator to cover the use cases of `publish` variants that use a `selector`. Wherein the selector allows the user to define multicast behavior prior to connection to the source observable for the multicast. + +#### share + +- Added functionality to allow complete configuration of what type of `Subject` is used to multicast, and when that subject is reset. + +#### timeout + +- Added more configuration options to `timeout`, so it could be used to timeout just if the first item doesn't arrive quickly enough, or it could be used as a timeout between each item. Users may also pass a `Date` object to define an absolute time for a timeout for the first time to arrive. Adds additional information to the timeout error, and the ability to pass along metadata with the timeout for identification purposes. + +#### zipWith, concatWith, mergeWith, raceWith + +- Simply renamed versions of the operators `zip`, `concat`, `merge`, and `race`. So we can deprecate those old names and use the new names without collisions. + +## module `rxjs/ajax` + +### Breaking Changes + +#### ajax + +- `ajax` body serialization will now use default XHR behavior in all cases. If the body is a `Blob`, `ArrayBuffer`, any array buffer view (like a byte sequence, e.g. `Uint8Array`, etc), `FormData`, `URLSearchParams`, `string`, or `ReadableStream`, default handling is used. If the `body` is otherwise `typeof` `"object"`, then it will be converted to JSON via `JSON.stringify`, and the `Content-Type` header will be set to `application/json;charset=utf-8`. All other types will emit an error. +- The `Content-Type` header passed to `ajax` configuration no longer has any effect on the serialization behavior of the AJAX request. +- For TypeScript users, `AjaxRequest` is no longer the type that should be explicitly used to create an `ajax`. It is now `AjaxConfig`, although the two types are compatible, only `AjaxConfig` has `progressSubscriber` and `createXHR`. +- Ajax implementation drops support for IE10 and lower. This puts us in line with other implementations and helps clean up code in this area + +#### AjaxRequest + +- `AjaxRequest` is no longer used to type the configuration argument for calls to `ajax`. The new type is `AjaxConfig`. This was done to disambiguate two very similar types with different use cases. `AjaxRequest` is still there, but properties have changed, and it is used to show what final request information was sent as part of an event response. + +### New Features + +#### AjaxResponse + +- Now includes `responseHeaders`. +- Now includes event `type` and `total` numbers for examining upload and download progress (see `includeUploadProgress` and `includeDownloadProgress`). + +#### includeUploadProgress + +- A flag to make a request that will include streaming upload progress events in the returned observable. + +#### includeDownloadProgress + +- A flag to make a request that will include streaming upload progress events in the returned observable. + +#### queryParams + +- Configuration for setting query parameters in the URL of the request to be made. + +#### XSRF (CSRF) additions: + +- `xsrfCookieName` and `xsrfHeaderName` were added for cross-site request forgery prevention capabilities. + +## module `rxjs/fetch` + +No changes. + +## module `rxjs/testing` + +### New Features + +#### TestScheduler expectObservable().toEqual() + +- A new means of comparing the equality of two observables. If all emissions are the same, and at the same time, then they are equal. This is primarily useful for refactoring operator chains and making sure that they are equivalent. diff --git a/apps/rxjs.dev-next/docs/deprecations/array-argument.md b/apps/rxjs.dev-next/docs/deprecations/array-argument.md new file mode 100644 index 0000000000..64b2dac3a8 --- /dev/null +++ b/apps/rxjs.dev-next/docs/deprecations/array-argument.md @@ -0,0 +1,33 @@ +# Array Arguments + +To unify the API surface of `forkJoin` and `combineLatest` we deprecated some signatures. +Since that it is recommended to either pass an Object or an Array to these operators. + +
+ + This deprecation was introduced in RxJS 6.5. + +
+ +## Operators affected by this Change + +- [combineLatest](/api/index/function/combineLatest) +- [forkJoin](/api/index/function/forkJoin) + +## How to Refactor + +We deprecated the signatures, where just pass all Observables directly as parameters to these operators. + +```ts +import { forkJoin, from } from 'rxjs'; + +const odd$ = from([1, 3, 5]); +const even$ = from([2, 4, 6]); + +// deprecated +forkJoin(odd$, even$); +// suggested change +forkJoin([odd$, even$]); +// or +forkJoin({ odd: odd$, even: even$ }); +``` diff --git a/apps/rxjs.dev-next/docs/deprecations/breaking-changes.md b/apps/rxjs.dev-next/docs/deprecations/breaking-changes.md new file mode 100644 index 0000000000..856b8428c6 --- /dev/null +++ b/apps/rxjs.dev-next/docs/deprecations/breaking-changes.md @@ -0,0 +1,126 @@ +# Breaking Changes in Version 7 + +## General + +- **TS:** RxJS requires TS 4.2 + +- **rxjs-compat:** `rxjs-compat` is not published for v7 + +- **toPromise:** toPromise return type now returns `T | undefined` in TypeScript, which is correct, but may break builds. + +- **Subscription:** `add` no longer returns an unnecessary Subscription reference. This was done to prevent confusion caused by a legacy behavior. You can now add and remove functions and Subscriptions as teardowns to and from a `Subscription` using `add` and `remove` directly. Before this, `remove` only accepted subscriptions. + +- **Observable:** `lift` no longer exposed. It was _NEVER_ documented that end users of the library should be creating operators using `lift`. Lift has a [variety of issues](https://github.com/ReactiveX/rxjs/issues/5431) and was always an internal implementation detail of rxjs that might have been used by a few power users in the early days when it had the most value. The value of `lift`, originally, was that subclassed `Observable`s would compose through all operators that implemented lift. The reality is that feature is not widely known, used, or supported, and it was never documented as it was very experimental when it was first added. Until the end of v7, `lift` will remain on Observable. Standard JavaScript users will notice no difference. However, TypeScript users might see complaints about `lift` not being a member of observable. To workaround this issue there are two things you can do: 1. Rewrite your operators as [outlined in the documentation](https://rxjs.dev/guide/operators), such that they return `new Observable`. or 2. cast your observable as `any` and access `lift` that way. Method 1 is recommended if you do not want things to break when we move to version 8. + +- **Subscriber:** `new Subscriber` no longer takes 0-3 arguments. To create a `Subscriber` with 0-3 arguments, use `Subscriber.create`. However, please note that there is little to no reason that you should be creating `Subscriber` references directly, and `Subscriber.create` and `new Subscriber` are both deprecated. + +- **onUnhandledError:** Errors that occur during setup of an observable subscription after the subscription has emitted an error or completed will now throw in their own call stack. Before it would call `console.warn`. This is potentially breaking in edge cases for node applications, which may be configured to terminate for unhandled exceptions. In the unlikely event this affects you, you can configure the behavior to `console.warn` in the new configuration setting like so: `import { config } from 'rxjs'; config.onUnhandledError = (err) => console.warn(err);` + +- **RxJS Error types** Tests that are written with naive expectations against errors may fail now that errors have a proper `stack` property. In some testing frameworks, a deep equality check on two error instances will check the values in `stack`, which could be different. + +- `unsubscribe` no longer available via the `this` context of observer functions. To reenable, set `config.useDeprecatedNextContext = true` on the rxjs `config` found at `import { config } from 'rxjs';`. Note that enabling this will result in a performance penalty for all consumer subscriptions. + +- Leaked implementation detail `_unsubscribeAndRecycle` of `Subscriber` has been removed. Just use new `Subscription` objects + +- The static `sortActions` method on `VirtualTimeScheduler` is no longer publicly exposed by our TS types. + +- `Notification.createNext(undefined)` will no longer return the exact same reference every time. + +- Type signatures tightened up around `Notification` and `dematerialize`, may uncover issues with invalid types passed to those operators. + +- Experimental support for `for await` has been removed. Use https://github.com/benlesh/rxjs-for-await instead. + +- `ReplaySubject` no longer schedules emissions when a scheduler is provided. If you need that behavior, + please compose in `observeOn` using `pipe`, for example: `new ReplaySubject(2, 3000).pipe(observeOn(asap))` + +- **rxjs-compat:** `rxjs/Rx` is no longer a valid import site. + +## Operators + +### concat + +- **concat:** Generic signature changed. Recommend not explicitly passing generics, just let inference do its job. If you must, cast with `as`. +- **of:** Generic signature changed, do not specify generics, allow them to be inferred or use `as` + +### count + +- **count:** No longer passes `source` observable as a third argument to the predicate. That feature was rarely used, and of limited value. The workaround is to simply close over the source inside of the function if you need to access it in there. + +### defer + +- `defer` no longer allows factories to return `void` or `undefined`. All factories passed to defer must return a proper `ObservableInput`, such as `Observable`, `Promise`, et al. To get the same behavior as you may have relied on previously, `return EMPTY` or `return of()` from the factory. + +### map + +- **map:** `thisArg` will now default to `undefined`. The previous default of `MapSubscriber` never made any sense. This will only affect code that calls map with a `function` and references `this` like so: `source.pipe(map(function () { console.log(this); }))`. There wasn't anything useful about doing this, so the breakage is expected to be very minimal. If anything we're no longer leaking an implementation detail. + +### mergeScan + +- **mergeScan:** `mergeScan` will no longer emit its inner state again upon completion. + +### of + +- **of:** Use with more than 9 arguments, where the last argument is a `SchedulerLike` may result in the wrong type which includes the `SchedulerLike`, even though the run time implementation does not support that. Developers should be using `scheduled` instead + +### pairs + +- **pairs:** `pairs` will no longer function in IE without a polyfill for `Object.entries`. `pairs` itself is also deprecated in favor of users just using `from(Object.entries(obj))`. + +### race + +- **race:** `race()` will no longer subscribe to subsequent observables if a provided source synchronously errors or completes. This means side effects that might have occurred during subscription in those rare cases will no longer occur. + +### repeat + +- An undocumented behavior where passing a negative count argument to `repeat` would result in an observable that repeats forever. + +### retry + +- Removed an undocumented behavior where passing a negative count argument to `retry` would result in an observable that repeats forever. + +### single + +- `single` operator will now throw for scenarios where values coming in are either not present, or do not match the provided predicate. Error types have thrown have also been updated, please check documentation for changes. + +### skipLast + +- **skipLast:** `skipLast` will no longer error when passed a negative number, rather it will simply return the source, as though `0` was passed. + +### startWith + +- **startWith:** `startWith` will return incorrect types when called with more than 7 arguments and a scheduler. Passing scheduler to startWith is deprecated + +### take + +- `take` and will now throw runtime error for arguments that are negative or NaN, this includes non-TS calls like `take()`. + +### takeLast + +- `takeLast` now has runtime assertions that throw `TypeError`s for invalid arguments. Calling takeLast without arguments or with an argument that is `NaN` will throw a `TypeError` + +### throwError + +- **throwError:** In an extreme corner case for usage, `throwError` is no longer able to emit a function as an error directly. If you need to push a function as an error, you will have to use the factory function to return the function like so: `throwError(() => functionToEmit)`, in other words `throwError(() => () => console.log('called later'))`. + +### timestamp + +- `timestamp` operator accepts a `TimestampProvider`, which is any object with a `now` method + that returns a number. This means pulling in less code for the use of the `timestamp` operator. This may cause + issues with `TestScheduler` run mode. (see [Issue here](https://github.com/ReactiveX/rxjs/issues/5553)) + +### zip + +- **zip:** Zipping a single array will now have a different result. This is an extreme corner-case, because it is very unlikely that anyone would want to zip an array with nothing at all. The workaround would be to wrap the array in another array `zip([[1,2,3]])`. But again, that's pretty weird. + +- **zip:** `zip` operators will no longer iterate provided iterables "as needed", instead the iterables will be treated as push-streams just like they would be everywhere else in RxJS. This means that passing an endless iterable will result in the thread locking up, as it will endlessly try to read from that iterable. This puts us in-line with all other Rx implementations. To work around this, it is probably best to use `map` or some combination of `map` and `zip`. For example, `zip(source$, iterator)` could be `source$.pipe(map(value => [value, iterator.next().value]))`. + +## ajax + +- `ajax` body serialization will now use default XHR behavior in all cases. If the body is a `Blob`, `ArrayBuffer`, any array buffer view (like a byte sequence, e.g. `Uint8Array`, etc), `FormData`, `URLSearchParams`, `string`, or `ReadableStream`, default handling is use. If the `body` is otherwise `typeof` `"object"`, then it will be converted to JSON via `JSON.stringify`, and the `Content-Type` header will be set to `application/json;charset=utf-8`. All other types will emit an error. + +- The `Content-Type` header passed to `ajax` configuration no longer has any effect on the serialization behavior of the AJAX request. +- For TypeScript users, `AjaxRequest` is no longer the type that should be explicitly used to create an `ajax`. It is now `AjaxConfig`, although the two types are compatible, only `AjaxConfig` has `progressSubscriber` and `createXHR`. + +- **ajax:** In an extreme corner-case... If an error occurs, the responseType is `"json"`, we're in IE, and the `responseType` is not valid JSON, the `ajax` observable will no longer emit a syntax error, rather it will emit a full `AjaxError` with more details. + +- **ajax:** Ajax implementation drops support for IE10 and lower. This puts us in-line with other implementations and helps clean up code in this area diff --git a/apps/rxjs.dev-next/docs/deprecations/index.md b/apps/rxjs.dev-next/docs/deprecations/index.md new file mode 100644 index 0000000000..093d4b9d70 --- /dev/null +++ b/apps/rxjs.dev-next/docs/deprecations/index.md @@ -0,0 +1,11 @@ +# Deprecations and Breaking Changes + +While the core team always tries to limit changes, sometimes we have to deprecate APIs or do breaking changes for various reasons. +This section aims to describe some of the deprecations and breaking changes we did more in detail. Some of the changes are to extensive to describe +them appropriately in a changelog. Additionally, we can provide code examples in the documentation, to make required changes more comprehensible and therefore +lower migration efforts. + +Do notice that this is not a complete list, please see the following changelogs for the complete list: + +- [v6.x changelog](https://github.com/ReactiveX/rxjs/blob/6.x/CHANGELOG.md) +- [v7.x changelog](./breaking-changes.md) diff --git a/apps/rxjs.dev-next/docs/deprecations/multicasting.md b/apps/rxjs.dev-next/docs/deprecations/multicasting.md new file mode 100644 index 0000000000..2e77adc612 --- /dev/null +++ b/apps/rxjs.dev-next/docs/deprecations/multicasting.md @@ -0,0 +1,439 @@ +# Multicasting + +In version 7, the multicasting APIs were simplified to just a few functions: + +- [connectable](/api/index/function/connectable) +- [connect](/api/operators/connect) +- [share](/api/operators/share) + +And [shareReplay](/api/operators/shareReplay) - which is a thin wrapper around the now highly-configurable [share](/api/operators/share) operator. + +Other APIs that relate to multicasting are now deprecated. + +
+ + These deprecations were introduced in RxJS 7.0 and will become breaking in RxJS 8. + +
+ +## APIs affected by this Change + +- [ConnectableObservable](/api/index/class/ConnectableObservable) +- [multicast](/api/operators/multicast) +- [publish](/api/operators/publish) +- [publishBehavior](/api/operators/publishBehavior) +- [publishLast](/api/operators/publishLast) +- [publishReplay](/api/operators/publishReplay) +- [refCount](/api/operators/refCount) + +## How to refactor + +### ConnectableObservable + +Instead of creating a [ConnectableObservable](/api/index/class/ConnectableObservable) instance, call the [connectable](/api/index/function/connectable) function to obtain a connectable observable. + + +```ts +import { ConnectableObservable, timer, Subject } from 'rxjs'; + +// deprecated +const tick$ = new ConnectableObservable( + timer(1_000), + () => new Subject()); +tick$.connect(); +``` + + +```ts +import { connectable, timer, Subject } from 'rxjs'; + +// suggested refactor +const tick$ = connectable(timer(1_000), { + connector: () => new Subject() +}); +tick$.connect(); +``` + +In situations in which the `refCount` method is used, the [share](/api/operators/share) operator can be used instead. + + +```ts +import { ConnectableObservable, timer, Subject } from 'rxjs'; + +// deprecated +const tick$ = new ConnectableObservable( + timer(1_000), + () => new Subject() +).refCount(); +``` + + +```ts +import { timer, share, Subject } from 'rxjs'; + +// suggested refactor +const tick$ = timer(1_000).pipe( + share({ connector: () => new Subject() }) +); +``` + +### multicast + +Where [multicast](/api/operators/multicast) is called with a subject factory, can be replaced with [connectable](/api/index/function/connectable). + + +```ts +import { timer, multicast, Subject, ConnectableObservable } from 'rxjs'; + +// deprecated +const tick$ = timer(1_000).pipe( + multicast(() => new Subject()) +) as ConnectableObservable; +``` + + +```ts +import { connectable, timer, Subject } from 'rxjs'; + +// suggested refactor +const tick$ = connectable(timer(1_000), { + connector: () => new Subject() +}); +``` + +Where [multicast](/api/operators/multicast) is called with a subject instance, it can be replaced with [connectable](/api/index/function/connectable) and a local subject instance. + + +```ts +import { timer, multicast, Subject, ConnectableObservable } from 'rxjs'; + +// deprecated +const tick$ = timer(1_000).pipe( + multicast(new Subject()) +) as ConnectableObservable; +``` + + +```ts +import { connectable, timer, Subject } from 'rxjs'; + +// suggested refactor +const tick$ = connectable(timer(1_000), { + connector: () => new Subject(), + resetOnDisconnect: false +}); +``` + +Where [multicast](/api/operators/multicast) is used in conjunction with [refCount](/api/operators/refCount), it can be replaced with [share](/api/index/function/connectable). + + +```ts +import { timer, multicast, Subject, refCount } from 'rxjs'; + +// deprecated +const tick$ = timer(1_000).pipe( + multicast(() => new Subject()), + refCount() +); +``` + + +```ts +import { timer, share, Subject } from 'rxjs'; + +// suggested refactor +const tick$ = timer(1_000).pipe( + share({ connector: () => new Subject() }) +); +``` + +Where [multicast](/api/operators/multicast) is used with a selector, it can be replaced with [connect](/api/index/function/connect). + + +```ts +import { timer, multicast, Subject, combineLatest } from 'rxjs'; + +// deprecated +const tick$ = timer(1_000).pipe( + multicast( + () => new Subject(), + (source) => combineLatest([source, source]) + ) +); +``` + + +```ts +import { timer, connect, combineLatest, Subject } from 'rxjs'; + +// suggested refactor +const tick$ = timer(1_000).pipe( + connect((source) => combineLatest([source, source]), { + connector: () => new Subject() + }) +); +``` + +### publish + +If you're using [publish](/api/operators/publish) to create a [ConnectableObservable](/api/index/class/ConnectableObservable), you can use [connectable](/api/index/function/connectable) instead. + + +```ts +import { timer, publish, ConnectableObservable } from 'rxjs'; + +// deprecated +const tick$ = timer(1_000).pipe( + publish() +) as ConnectableObservable; +``` + + +```ts +import { connectable, timer, Subject } from 'rxjs'; + +// suggested refactor +const tick$ = connectable(timer(1_000), { + connector: () => new Subject(), + resetOnDisconnect: false +}); +``` + +And if [refCount](/api/operators/refCount) is being applied to the result of [publish](/api/operators/publish), you can use [share](/api/operators/share) to replace both. + + +```ts +import { timer, publish, refCount } from 'rxjs'; + +// deprecated +const tick$ = timer(1_000).pipe( + publish(), + refCount() +); +``` + + +```ts +import { timer, share } from 'rxjs'; + +// suggested refactor +const tick$ = timer(1_000).pipe( + share({ + resetOnError: false, + resetOnComplete: false, + resetOnRefCountZero: false + }) +); +``` + +If [publish](/api/operators/publish) is being called with a selector, you can use the [connect](/api/operators/connect) operator instead. + + +```ts +import { timer, publish, combineLatest } from 'rxjs'; + +// deprecated +const tick$ = timer(1_000).pipe( + publish((source) => combineLatest([source, source])) +); +``` + + +```ts +import { timer, connect, combineLatest } from 'rxjs'; + +// suggested refactor +const tick$ = timer(1_000).pipe( + connect((source) => combineLatest([source, source])) +); +``` + +### publishBehavior + +If you're using [publishBehavior](/api/operators/publishBehavior) to create a [ConnectableObservable](/api/index/class/ConnectableObservable), you can use [connectable](/api/index/function/connectable) and a [BehaviorSubject](api/index/class/BehaviorSubject) instead. + + +```ts +import { timer, publishBehavior, ConnectableObservable } from 'rxjs'; + +// deprecated +const tick$ = timer(1_000).pipe( + publishBehavior(0) +) as ConnectableObservable; +``` + + +```ts +import { connectable, timer, BehaviorSubject } from 'rxjs'; + +// suggested refactor +const tick$ = connectable(timer(1_000), { + connector: () => new BehaviorSubject(0), + resetOnDisconnect: false +}); +``` + +And if [refCount](/api/operators/refCount) is being applied to the result of [publishBehavior](/api/operators/publishBehavior), you can use the [share](/api/operators/share) operator - with a [BehaviorSubject](api/index/class/BehaviorSubject) connector - to replace both. + + +```ts +import { timer, publishBehavior, refCount } from 'rxjs'; + +// deprecated +const tick$ = timer(1_000).pipe( + publishBehavior(0), + refCount() +); +``` + + +```ts +import { timer, share, BehaviorSubject } from 'rxjs'; + +// suggested refactor +const tick$ = timer(1_000).pipe( + share({ + connector: () => new BehaviorSubject(0), + resetOnError: false, + resetOnComplete: false, + resetOnRefCountZero: false + }) +); +``` + +### publishLast + +If you're using [publishLast](/api/operators/publishLast) to create a [ConnectableObservable](/api/index/class/ConnectableObservable), you can use [connectable](/api/index/function/connectable) and an [AsyncSubject](api/index/class/AsyncSubject) instead. + + +```ts +import { timer, publishLast, ConnectableObservable } from 'rxjs'; + +// deprecated +const tick$ = timer(1_000).pipe( + publishLast() +) as ConnectableObservable; +``` + + +```ts +import { connectable, timer, AsyncSubject } from 'rxjs'; + +// suggested refactor +const tick$ = connectable(timer(1_000), { + connector: () => new AsyncSubject(), + resetOnDisconnect: false +}); +``` + +And if [refCount](/api/operators/refCount) is being applied to the result of [publishLast](/api/operators/publishLast), you can use the [share](/api/operators/share) operator - with an [AsyncSubject](api/index/class/AsyncSubject) connector - to replace both. + + +```ts +import { timer, publishLast, refCount } from 'rxjs'; + +// deprecated +const tick$ = timer(1_000).pipe( + publishLast(), + refCount() +); +``` + + +```ts +import { timer, share, AsyncSubject } from 'rxjs'; + +// suggested refactor +const tick$ = timer(1_000).pipe( + share({ + connector: () => new AsyncSubject(), + resetOnError: false, + resetOnComplete: false, + resetOnRefCountZero: false + }) +); +``` + +### publishReplay + +If you're using [publishReplay](/api/operators/publishReplay) to create a [ConnectableObservable](/api/index/class/ConnectableObservable), you can use [connectable](/api/index/function/connectable) and a [ReplaySubject](api/index/class/ReplaySubject) instead. + + +```ts +import { timer, publishReplay, ConnectableObservable } from 'rxjs'; + +// deprecated +const tick$ = timer(1_000).pipe( + publishReplay(1) +) as ConnectableObservable; +``` + + +```ts +import { connectable, timer, ReplaySubject } from 'rxjs'; + +// suggested refactor +const tick$ = connectable(timer(1_000), { + connector: () => new ReplaySubject(1), + resetOnDisconnect: false +}); +``` + +And if [refCount](/api/operators/refCount) is being applied to the result of [publishReplay](/api/operators/publishReplay), you can use the [share](/api/operators/share) operator - with a [ReplaySubject](api/index/class/ReplaySubject) connector - to replace both. + + +```ts +import { timer, publishReplay, refCount } from 'rxjs'; + +// deprecated +const tick$ = timer(1_000).pipe( + publishReplay(1), + refCount() +); +``` + + +```ts +import { timer, share, ReplaySubject } from 'rxjs'; + +// suggested refactor +const tick$ = timer(1_000).pipe( + share({ + connector: () => new ReplaySubject(1), + resetOnError: false, + resetOnComplete: false, + resetOnRefCountZero: false + }) +); +``` + +If [publishReplay](/api/operators/publishReplay) is being called with a selector, you can use the [connect](/api/operators/connect) operator - with a [ReplaySubject](api/index/class/ReplaySubject) connector - instead. + + +```ts +import { timer, publishReplay, combineLatest } from 'rxjs'; + +// deprecated +const tick$ = timer(1_000).pipe( + publishReplay(1, undefined, (source) => combineLatest([source, source])) +); +``` + + +```ts +import { timer, connect, combineLatest, ReplaySubject } from 'rxjs'; + +// suggested refactor +const tick$ = timer(1_000).pipe( + connect((source) => combineLatest([source, source]), { + connector: () => new ReplaySubject(1) + }) +); +``` + +### refCount + +Instead of applying the [refCount](/api/operators/refCount) operator to the [ConnectableObservable](/api/index/class/ConnectableObservable) obtained from a [multicast](/api/operators/multicast) +or [publish](/api/operators/publish) operator, use the [share](/api/operators/share) operator to replace both. + +The properties passed to [share](/api/operators/share) will depend upon the operators that are being replaced. The refactors for using [refCount](/api/operators/refCount) with [multicast](/api/operators/multicast), [publish](/api/operators/publish), [publishBehavior](/api/operators/publishBehavior), [publishLast](/api/operators/publishLast) and [publishReplay](/api/operators/publishReplay) are detailed above. diff --git a/apps/rxjs.dev-next/docs/deprecations/result-selector.md b/apps/rxjs.dev-next/docs/deprecations/result-selector.md new file mode 100644 index 0000000000..0d14021a09 --- /dev/null +++ b/apps/rxjs.dev-next/docs/deprecations/result-selector.md @@ -0,0 +1,43 @@ +# ResultSelector Parameter + +Some operator supported a resultSelector argument that acted as mapping function on the result of that operator. +The same behavior can be reproduced with the `map` operator, therefore this argument became deprecated. + +
+ + This deprecation was introduced in RxJS 6.0 and will become breaking with RxJS 8. + +
+ +There were two reasons for actually deprecating those parameters: + +1. It increases the bundle size of every operator +2. In some scenarios values had to be retained in memory causing a general memory pressure + +## Operators affected by this Change + +- [concatMap](/api/operators/concatMap) +- [concatMapTo](/api/operators/concatMapTo) +- [exhaustMap](/api/operators/exhaustMap) +- [mergeMap](/api/operators/mergeMap) +- [mergeMapTo](/api/operators/mergeMapTo) +- [switchMap](/api/operators/switchMap) +- [switchMapTo](/api/operators/switchMapTo) + +## How to Refactor + +Instead of using the `resultSelector` Argument, you can leverage the [`map`](/api/operators/map) operator on the inner Observable: + + +```ts +import { fromEvent, switchMap, interval, map } from 'rxjs'; + +// deprecated +fromEvent(document, 'click').pipe( + switchMap((x) => interval(1000), (_, x) => x + 1) +); +// suggested change +fromEvent(document, 'click').pipe( + switchMap((x) => interval(1000).pipe(map((x) => x + 1))) +); +``` diff --git a/apps/rxjs.dev-next/docs/deprecations/scheduler-argument.md b/apps/rxjs.dev-next/docs/deprecations/scheduler-argument.md new file mode 100644 index 0000000000..5883b4fc56 --- /dev/null +++ b/apps/rxjs.dev-next/docs/deprecations/scheduler-argument.md @@ -0,0 +1,85 @@ +# Scheduler Argument + +To limit the API surface of some operators, but also prepare for a [major refactoring in V8](https://github.com/ReactiveX/rxjs/pull/4583), we +agreed on deprecating the `scheduler` argument from many operators. It solely deprecates those methods where this argument is rarely used. So `time` related +operators, like [`interval`](https://rxjs.dev/api/index/function/interval) are not affected by this deprecation. + +To support this transition the [scheduled creation function](/api/index/function/scheduled) was added. + +
+ + This deprecation was introduced in RxJS 6.5 and will become breaking with RxJS 8. + +
+ +## Operators affected by this Change + +- [from](/api/index/function/from) +- [of](/api/index/function/of) +- [merge](/api/index/function/merge) +- [concat](/api/index/function/concat) +- [startWith](/api/operators/startWith) +- [endWith](/api/operators/endWith) +- [combineLatest](/api/index/function/combineLatest) + +## How to Refactor + +If you use any operator from the above list and you're passing the `scheduler` argument, you have three potential refactoring options. + +### Refactoring of `of` and `from` + +`scheduled` is kinda copying the behavior of `from`. Therefore if you used `from` with a `scheduler` argument, you can just replace them. + +For the `of` creation function you need to replace this Observable with `scheduled` and instead of passing the `scheduler` argument to `of` pass it to `scheduled`. +Following code example demonstrate this process. + +```ts +import { of, asyncScheduler, scheduled } from 'rxjs'; + +// Deprecated approach +of(1, 2, 3, asyncScheduler).subscribe((x) => console.log(x)); +// suggested approach +scheduled([1, 2, 3], asyncScheduler).subscribe((x) => console.log(x)); +``` + +### Refactoring of `merge`, `concat`, `combineLatest`, `startWith` and `endWith` + +In case you used to pass a scheduler argument to one of these operators you probably had code like this: + +```ts +import { concat, of, asyncScheduler } from 'rxjs'; + +concat(of('hello '), of('World'), asyncScheduler).subscribe((x) => console.log(x)); +``` + +To work around this deprecation you can leverage the [`scheduled`](/api/index/function/scheduled) function. + +```ts +import { scheduled, of, asyncScheduler, concatAll } from 'rxjs'; + +scheduled([of('hello '), of('World')], asyncScheduler) + .pipe(concatAll()) + .subscribe((x) => console.log(x)); +``` + +You can apply this pattern to refactor deprecated usage of `concat`, `startWith` and `endWith` but do notice that you will want to use [mergeAll](/api/operators/mergeAll) to refactor the deprecated usage of `merge`. + +With `combineLatest`, you will want to use [combineLatestAll](/api/operators/combineLatestAll) + +E.g. code that used to look like this: + +```ts +import { combineLatest, of, asyncScheduler } from 'rxjs'; + +combineLatest(of('hello '), of('World'), asyncScheduler).subscribe(console.log); +``` + +would become: + +```ts +import { scheduled, of, asyncScheduler, combineLatestAll } from 'rxjs'; + +scheduled([of('hello '), of('World')], asyncScheduler) + .pipe(combineLatestAll()) + .subscribe((x) => console.log(x)); +``` diff --git a/apps/rxjs.dev-next/docs/deprecations/subscribe-arguments.md b/apps/rxjs.dev-next/docs/deprecations/subscribe-arguments.md new file mode 100644 index 0000000000..6fdc1c8ccd --- /dev/null +++ b/apps/rxjs.dev-next/docs/deprecations/subscribe-arguments.md @@ -0,0 +1,56 @@ +# Subscribe Arguments + +You might have seen that we deprecated some signatures of the `subscribe` method, which might have caused some confusion. +The `subscribe` method itself is not deprecated. This deprecation also affects the [`tap` operator](/api/operators/tap), as tap supports the same signature as the `subscribe` method. + +This is to get ready for a future where we may allow configuration of `subscribe` via the second argument, for things like `AbortSignal` or the like (imagine `source$.subscribe(fn, { signal })`, etc). This deprecation is also because 2-3 function arguments can contribute to harder-to-read code. For example someone could name functions poorly and confuse the next reader: `source$.subscribe(doSomething, doSomethingElse, lol)` With that signature, you have to know unapparent details about `subscribe`, where using a partial observer solves that neatly: `source$.subscribe({ next: doSomething, error: doSomethingElse, complete: lol })`. + +
+ + This deprecation was introduced in RxJS 6.4. + +
+ +In short we deprecated all signatures where you specified an anonymous `error` or `complete` callback and passed an empty function to one of the callbacks before. + +## What Signature is affected + +**We have deprecated all signatures of `subscribe` that take more than 1 argument.** + +We deprecated signatures for just passing the `complete` callback. + +```ts +import { of } from 'rxjs'; + +// deprecated +of([1, 2, 3]).subscribe(null, null, console.info); // difficult to read +// suggested change +of([1, 2, 3]).subscribe({ complete: console.info }); +``` + +Similarly, we also deprecated signatures for solely passing the `error` callback. + +```ts +import { throwError } from 'rxjs'; + +// deprecated +throwError('I am an error').subscribe(null, console.error); +// suggested change +throwError('I am an error').subscribe({ error: console.error }); +``` + +Do notice, in general it is recommended only to use the anonymous function if you only specify the `next` callback otherwise +we recommend to pass an `Observer` + +```ts +import { of } from 'rxjs'; + +// recommended +of([1, 2, 3]).subscribe((v) => console.info(v)); +// also recommended +of([1, 2, 3]).subscribe({ + next: (v) => console.log(v), + error: (e) => console.error(e), + complete: () => console.info('complete'), +}); +``` diff --git a/apps/rxjs.dev-next/docs/deprecations/to-promise.md b/apps/rxjs.dev-next/docs/deprecations/to-promise.md new file mode 100644 index 0000000000..f3141a792a --- /dev/null +++ b/apps/rxjs.dev-next/docs/deprecations/to-promise.md @@ -0,0 +1,98 @@ +# Conversion to Promises + +The similarity between Observables and Promises is that both [collections](/guide/observable) may produce values over +time, but the difference is that Observables may produce none or more than one value, while Promises produce only one +value when resolved successfully. + +## Issues + +For this reason, in RxJS 7, the return type of the Observable's [`toPromise()`](/api/index/class/Observable#toPromise) +method has been fixed to better reflect the fact that Observables can yield zero values. This may be a **breaking +change** to some projects as the return type was changed from `Promise` to `Promise`. + +Also, `toPromise()` method name was never indicating what emitted value a Promise will resolve with because Observables +can produce multiple values over time. When converting to a Promise, you might want to choose which value to pick - +either the first value that has arrived or the last one. To fix all these issues, we decided to deprecate `toPromise()`, +and to introduce the two new helper functions for conversion to Promises. + +## Use one of the two new functions + +As a replacement to the deprecated `toPromise()` method, you should use one of the two built in static conversion +functions [`firstValueFrom`](/api/functions/firstValueFrom) or [`lastValueFrom`](/api/functions/lastValueFrom). + +### `lastValueFrom` + +The `lastValueFrom` is almost exactly the same as `toPromise()` meaning that it will resolve with the last value that has +arrived when the Observable completes, but with the difference in behavior when Observable completes without emitting a +single value. When Observable completes without emitting, `toPromise()` will successfully resolve with `undefined` (thus +the return type change), while the `lastValueFrom` will reject with the [`EmptyError`](/api/classes/EmptyError). Thus, the return type of the +`lastValueFrom` is `Promise`, just like `toPromise()` had in RxJS 6. + +#### Example + +```ts +import { interval, take, lastValueFrom } from 'rxjs'; + +async function execute() { + const source$ = interval(2000).pipe(take(10)); + const finalNumber = await lastValueFrom(source$); + console.log(`The final number is ${finalNumber}`); +} + +execute(); + +// Expected output: +// "The final number is 9" +``` + +### `firstValueFrom` + +However, you might want to take the first value as it arrives without waiting an Observable to complete, thus you can +use `firstValueFrom`. The `firstValueFrom` will resolve a Promise with the first value that was emitted from the +Observable and will immediately unsubscribe to retain resources. The `firstValueFrom` will also reject with an +[`EmptyError`](/api/classes/EmptyError) if the Observable completes with no values emitted. + +#### Example + +```ts +import { interval, firstValueFrom } from 'rxjs'; + +async function execute() { + const source$ = interval(2000); + const firstNumber = await firstValueFrom(source$); + console.log(`The first number is ${firstNumber}`); +} + +execute(); + +// Expected output: +// "The first number is 0" +``` + +Both functions will return a Promise that rejects if the source Observable errors. The Promise +will reject with the same error that the Observable has errored with. + +## Use default value + +If you don't want Promises created by `lastValueFrom` or `firstValueFrom` to reject with [`EmptyError`](/api/classes/EmptyError) if there +were no emissions before completion, you can use the second parameter. The second parameter is expected to be an object +with `defaultValue` parameter. The value in the `defaultValue` will be used to resolve a Promise when source Observable +completes without emitted values. + +```ts +import { firstValueFrom, EMPTY } from 'rxjs'; + +const result = await firstValueFrom(EMPTY, { defaultValue: 0 }); +console.log(result); + +// Expected output: +// 0 +``` + +## Warning + +Only use `lastValueFrom` function if you _know_ an Observable will eventually complete. The `firstValueFrom` function should +be used if you _know_ an Observable will emit at least one value _or_ will eventually complete. If the source Observable +does not complete or emit, you will end up with a Promise that is hung up, and potentially all of the state of an async +function hanging out in memory. To avoid this situation, look into adding something like [`timeout`](/api/operators/timeout), [`take`](/api/operators/take), +[`takeWhile`](/api/operators/takeWhile), or [`takeUntil`](/api/operators/takeUntil) amongst others. diff --git a/apps/rxjs.dev-next/docs/guide/core-semantics.md b/apps/rxjs.dev-next/docs/guide/core-semantics.md new file mode 100644 index 0000000000..ba2884780d --- /dev/null +++ b/apps/rxjs.dev-next/docs/guide/core-semantics.md @@ -0,0 +1,33 @@ +# RxJS Core Semantics + +Starting in version 8, all RxJS operators that are provided in the core library MUST meet the following semantics. In the current version, version 7, all operators SHOULD meet the following semantics (as guidelines). If they do not, we need to track the issue on [GitHub](https://github.com/ReactiveX/rxjs/issues). + +## Purpose + +The purpose of these semantics is provide predictable behavior for the users of our library, and to ensure consistent behavior between our many different operators. It should be noted that at the time of this writing, we don't always adhere to these semantic guidelines. This document is to serve as a goalpost for upcoming changes and work as much as it is to help describe the library. This is also a "living document" and is subject to change. + +## General Design Guidelines + +**Functions such as operators, constructors, and creation functions, should use named parameters in cases where there is more than 1 argument, and arguments after the first are non-obvious.** The primary use case should be streamlined to work without configuration. For example, `fakeFlattenMap(n => of(n))` is fine, but `fakeFlattenMap(n => of(n), 1)` is less readable than `fakeFlattenMap(n => of(n), { maxConcurrent: 1 })`. Other things, like `of(1, 2, 3)` are obvious enough that named parameters don't make sense. + +## Operators + +- MUST be a function that returns an [operator function](https://rxjs.dev/api/index/interface/OperatorFunction). That is `(source: Observable) => Observable`. +- The returned operator function MUST be [referentially transparent](https://en.wikipedia.org/wiki/Referential_transparency). That is to say, that if you capture the return value of the operator (e.g. `const double => map(x => x + x)`), you can use that value to operate on any many observables as you like without changing any underlying state in the operator reference. (e.g. `a$.pipe(double)` and `b$.pipe(double)`). +- The observable returned by the operator function MUST subscribe to the source. +- If the operation performed by the operator can tell it not change anything about the output of the source, it MUST return the reference to the source. For example `take(Infinity)` or `skip(0)`. +- Operators that accept a "notifier", that is another observable source that is used to trigger some behavior, must accept any type that can be converted to an `Observable` with `from`. For example `takeUntil`. +- Operators that accept "notifiers" (as described above), MUST ONLY recognized next values from the notifier as "notifications". Emitted completions may not be used a source of notification. +- "Notifiers" provided directly to the operator MUST be subscribed to _before_ the source is subscribed to. "Notifiers" created via factory function provided to the operator SHOULD be subscribed to at the earliest possible moment. +- The observable returned by the operator function is considered to be the "consumer" of the source. As such, the consumer MUST unsubscribe from the source as soon as it knows it no longer needs values before proceeding to do _any_ action. +- Events that happen after the completion of a source SHOULD happen after the source finalizes. This is to ensure that finalization always happens in a predictable time frame relative to the event. +- `Error` objects MUST NOT be retained longer than necessary. This is a possible source of memory pressure. +- `Promise` references MUST NOT be retained longer than necessary. This is a possible source of memory pressure. +- IF they perform a related operation to a creation function, they SHOULD share the creation function's name only with the suffix `With`. (e.g. `concat` and `concatWith`). +- SHOULD NOT have "result selectors". This is a secondary argument that provides the ability to "map" values after performing the primary operation of the operator. + +## Creation Functions + +- Names MUST NOT end in `With`. That is reserved for the operator counter parts of creation functions. +- MAY have "result selectors". This is a secondary argument that provides the ability to "map" values before they're emitted from the resulting observable. +- IF the creation function accepts a "result selector", it must not accept "n-arguments" ahead of that result selector. Instead, it should accept an array or possibly an object. (bad: `combineThings(sourceA$, sourceB$, (a, b) => a + b)`, good: `combineThings([sourceA$, sourceB$], (a, b) => a + b)`. In this case, it may be okay to provide the result selector as a second argument, rather than as a named parameter, as the use should be fairly obvious. diff --git a/apps/rxjs.dev-next/docs/guide/glossary-and-semantics.md b/apps/rxjs.dev-next/docs/guide/glossary-and-semantics.md new file mode 100644 index 0000000000..72e548f95a --- /dev/null +++ b/apps/rxjs.dev-next/docs/guide/glossary-and-semantics.md @@ -0,0 +1,149 @@ +# RxJS: Glossary And Semantics + +When discussing and documenting observables, it's important to have a common language and a known set of rules around what is going on. This document is an attempt to standardize these things so we can try to control the language in our docs, and hopefully other publications about RxJS, so we can discuss reactive programming with RxJS on consistent terms. + +While not all of the documentation for RxJS reflects this terminology, it is a goal of the team to ensure it does, and to ensure the language and names around the library use this document as a source of truth and unified language. + +## Major Entities + +There are high level entities that are frequently discussed. It's important to define them separately from other lower-level concepts, because they relate to the nature of observable. + +### Consumer + +The code that is subscribing to the observable. This is whoever is being _notified_ of [nexted](#next) values, and [errors](#error) or [completions](#complete). + +### Producer + +Any system or thing that is the source of values that are being pushed out of the observable subscription to the consumer. This can be a wide variety of things, from a `WebSocket` to a simple iteration over an `Array`. The producer is most often created during the [subscribe](#subscribe) action, and therefor "owned" by a [subscription](#subscription) in a 1:1 way, but that is not always the case. A producer may be shared between many subscriptions, if it is created outside of the [subscribe](#subscribe) action, in which case it is one-to-many, resulting in a [multicast](#multicast). + +### Subscription + +A contract where a [consumer](#consumer) is [observing](#observation) values pushed by a [producer](#producer). The subscription (not to be confused with the `Subscription` class or type), is an ongoing process that amounts to the function of the observable from the Consumer's perspective. Subscription starts the moment a [subscribe](#subscribe) action is initiated, even before the [subscribe](#subscribe) action is finished. + +### Observable + +The primary type in RxJS. At its highest level, an observable represents a template for connecting an [Observer](#observer), as a [consumer](#consumer), to a [producer](#producer), via a [subscribe](#subscribe) action, resulting in a [subscription](#subscription). + +### Observer + +The manifestation of a [consumer](#consumer). A type that may have some (or all) handlers for each type of [notification](#notification): [next](#next), [error](#error), and [complete](#complete). Having all three types of handlers generally gets this to be called an "observer", where if it is missing any of the notification handlers, it may be called a ["partial observer"](#partial-observer). + +## Major Actions + +There are specific actions and events that occur between major entities in RxJS that need to be defined. These major actions are the highest level events that occur within various parts in RxJS. + +### Subscribe + +The act of a [consumer](#consumer) requesting from an Observable to set up a [subscription](#subscription) so that it may [observe](#observation) a [producer](#producer). A subscribe action can occur with an observable via many different mechanisms. The primary mechanism is the [`subscribe` method](/api/index/class/Observable#subscribe) on the [Observable class](/api/index/class/Observable). Other mechanisms include the [`forEach` method](/api/index/class/Observable#forEach), functions like [`lastValueFrom`](/api/index/function/lastValueFrom), and [`firstValueFrom`](/api/index/function/firstValueFrom), and the deprecated [`toPromise` method](/api/index/class/Observable#forEach). + +### Finalization + +The act of cleaning up resources used by a producer. This is guaranteed to happen on `error`, `complete`, or if unsubscription occurs. This is not to be confused with [unsubscription](#unsubscription), but it does always happen during unsubscription. + +### Unsubscription + +The act of a [consumer](#consumer) telling a [producer](#producer) is no longer interested in receiving values. Causes [Finalization](#finalization) + +### Observation + +A [consumer](#consumer) reacting to [next](#next), [error](#error), or [complete](#complete) [notifications](#notification). This can only happen _during_ [subscription](#subscription). + +### Observation Chain + +When an [observable](#observable) uses another [observable](#observable) as a [producer](#producer), an "observation chain" is set up. That is a chain of [observation](#observation) such that multiple [observers](#observer) are [notifying](#notification) each other in a unidirectional way toward the final [consumer](#consumer). + +### Next + +A value has been pushed to the [consumer](#consumer) to be [observed](#observation). Will only happen during [subscription](#subscription), and cannot happen after [error](#error), [complete](#error), or [unsubscription](#unsubscription). Logically, this also means it cannot happen after [finalization](#finalization). + +### Error + +The [producer](#producer) has encountered a problem and is notifying the [consumer](#consumer). This is a notification that the [producer](#producer) will no longer send values and will [finalize](#finalization). This cannot occur after [complete](#complete), any other [error](#error), or [unsubscription](#unsubscription). Logically, this also means it cannot happen after [finalization](#finalization). + +### Complete + +The [producer](#producer) is notifying the [consumer](#consumer) that it is done [nexting](#Next) values, without error, will send no more values, and it will [finalize](#finalization). [Completion](#complete) cannot occur after an [error](#error), or [unsubscribe](#unsubscription). [Complete](#complete) cannot be called twice. [Complete](#complete), if it occurs, will always happen before [finalization](#finalization). + +### Notification + +The act of a [producer](#producer) pushing [nexted](#next) values, [errors](#error) or [completions](#complete) to a [consumer](#consumer) to be [observed](#observation). Not to be confused with the [`Notification` type](/api/index/class/Notification), which is notification manifested as a JavaScript object. + +## Major Concepts + +Some of what we discuss is conceptual. These are mostly common traits of behaviors that can manifest in observables or in push-based reactive systems. + +### Multicast + +The act of one [producer](#producer) being [observed](#observation) by **many** [consumers](#consumer). + +### Unicast + +The act of one [producer](#producer) being [observed](#observation) by **only one** [consumer](#consumer). An observable is "unicast" when it only connects one [producer](#producer) to one [consumer](#consumer). Unicast doesn't necessarily mean ["cold"](#cold). + +### Cold + +An observable is "cold" when it creates a new [producer](#producer) during [subscribe](#subscribe) for every new [subscription](#subscription). As a result, "cold" observables are _always_ [unicast](#unicast), being one [producer](#producer) [observed](#observation) by one [consumer](#consumer). Cold observables can be made [hot](#hot) but not the other way around. + +### Hot + +An observable is "hot", when its [producer](#producer) was created outside of the context of the [subscribe](#subscribe) action. This means that the "hot" observable is almost always [multicast](#multicast). It is possible that a "hot" observable is still _technically_ unicast, if it is engineered to only allow one [subscription](#subscription) at a time, however, there is no straightforward mechanism for this in RxJS, and the scenario is an unlikely one. For the purposes of discussion, all "hot" observables can be assumed to be [multicast](#multicast). Hot observables cannot be made [cold](#cold). + +### Push + +[Observables](#observable) are a push-based type. That means rather than having the [consumer](#consumer) call a function or perform some other action to get a value, the [consumer](#consumer) receives values as soon as the [producer](#producer) has produced them, via a registered [next](#next) handler. + +### Pull + +Pull-based systems are the opposite of [push](#push)-based. In a pull-based type or system, the [consumer](#consumer) must request each value the [producer](#producer) has produced manually, perhaps long after the [producer](#producer) has actually done so. Examples of such systems are [Functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) and [Iterators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) + +## Minor Entities + +### Operator + +A factory function that creates an [operator function](#operator-function). Examples of this in rxjs are functions like [`map`](/api/operators/map) and [`mergeMap`](/api/operators/mergeMap), which are generally passed to [`pipe`](/api/index/class/Observable#pipe). The result of calling many operators, and passing their resulting [operator functions](#operator-function) into pipe on an observable [source](#source) will be another [observable](#observable), and will generally not result in [subscription](#subscription). + +### Operator Function + +A function that takes an [observable](#observable), and maps it to a new [observable](#observable). Nothing more, nothing less. Operator functions are created by [operators](#operator). If you were to call an rxjs operator like [map](/api/operators/map) and put the return value in a variable, the returned value would be an operator function. + +### Operation + +An action taken while handling a [notification](#notification), as set up by an [operator](#operator) and/or [operator function](#operator-function). In RxJS, a developer can chain several [operator functions](#operator-function) together by calling [operators](#operator) and passing the created [operator functions](#operator-function) to the [`pipe`](/api/index/class/Observable#pipe) method of [`Observable`](/api/index/class/Observable), which results in a new [observable](#observable). During [subscription](#subscription) to that observable, operations are performed in an order dictated by the [observation chain](#observation-chain). + +### Stream + +A "stream" or "streaming" in the case of observables, refers to the collection of [operations](#operation), as they are processed during a [subscription](#subscription). This is not to be confused with node [Streams](https://nodejs.org/api/stream.html), and the word "stream", on its own, should be used _sparingly_ in documentation and articles. Instead, prefer [observation chain](#observation-chain), [operations](#operation), or [subscription](#subscription). "Streaming" is less ambiguous, and is fine to use given this defined meaning. + +### Source + +An [observable](#observable) or [valid observable input](#observable-inputs) having been converted to an observable, that will supply values to another [observable](#observable), either as the result of an [operator](#operator) or other function that creates one observable as another. This [source](#source), will be the [producer](#producer) for the resulting [observable](#observable) and all of its [subscriptions](#subscriptions). Sources may generally be any type of observable. + +### Observable Inputs + +An "observable input" ([defined as a type here](/api/index/type-alias/ObservableInput)), is any type that can be easily converted to an [Observable](#observable). Observable Inputs may sometimes be referred to as "valid observable sources". + +### Notifier + +An [observable](#observable) that is being used to notify another [observable](#observable) that it needs to perform some action. The action should only occur on a [next notification](#next), and never on [error](#error) or [complete](#complete). Generally, notifiers are used with specific operators, such as [`takeUntil`](/api/operators/takeUntil), [`buffer`](/api/operators/buffer), or [`delayWhen`](/api/operators/delayWhen). A notifier may be passed directly, or it may be returned by a callback. + +### Inner Source + +One, of possibly many [sources](#source), which are [subscribed](#subscribe) to automatically within a single [subscription](#subscription) to another observable. Examples of an "inner source" include the [observable inputs](#observable-inputs) returned by the mapping function in a [mergeMap](/api/operators/mergeMap) [operator](#operator). (e.g. `source.pipe(mergeMap(value => createInnerSource(value)))`, where `createInnerSource` returns any valid [observable input](#observable-inputs)). + +### Partial Observer + +An [observer](#observer) that lacks all necessary [notification](#notification) handlers. Generally these are supplied by user-land [consumer](#consumer) code. A "full observer" or "observer" would simply be an observer that has all [notification](#notification) handlers. + +## Other Concepts + +### Unhandled Errors + +An "unhandled error" is any [error](#error) that is not handled by a [consumer](#consumer)-provided function, which is generally provided during the [subscribe](#subscribe) action. If no error handler was provided, RxJS will assume the error is "unhandled" and rethrow the error on a new callstack to prevent ["producer interference"](#producer-interference). + +### Producer Interference + +[Producer](#producer) interference happens when an error is allowed to unwind the RxJS callstack during [notification](#notification). When this happens, the error could break things like for-loops in [upstream](#upstream-and-downstream) [sources](#source) that are [notifying](#notification) [consumers](#consumer) during a [multicast](#multicast). That would cause the other [consumers](#consumer) in that [multicast](#multicast) to suddenly stop receiving values without logical explanation. As of version 6, RxJS goes out of its way to prevent producer interference by ensuring that all unhandled errors are thrown on a separate callstack. + +### Upstream And Downstream + +The order in which [notifications](#notification) are processed by [operations](#operation) in a [stream](#stream) have a directionality to them. "Upstream" refers to an [operation](#operation) that was already processed before the current [operation](#operation), and "downstream" refers to an [operation](#operation) that _will_ be processed _after_ the current [operation](#operation). See also: [Streaming](#stream). diff --git a/apps/rxjs.dev-next/docs/guide/higher-order-observables.md b/apps/rxjs.dev-next/docs/guide/higher-order-observables.md new file mode 100644 index 0000000000..4b40d27264 --- /dev/null +++ b/apps/rxjs.dev-next/docs/guide/higher-order-observables.md @@ -0,0 +1,23 @@ +# Higher-order Observables + +Observables most commonly emit ordinary values like strings and numbers, but surprisingly often, it is necessary to handle Observables _of_ Observables, so-called higher-order Observables. For example, imagine you have an Observable emitting strings that are the URLs of files you want to fetch. The code might look like this: + +```ts +const fileObservable = urlObservable.pipe(map((url) => http.get(url))); +``` + +`http.get()` returns an Observable for each URL. Now you have an Observable _of_ Observables, a higher-order Observable. + +But how do you work with a higher-order Observable? Typically, by _flattening_: by converting a higher-order Observable into an ordinary Observable. For example: + +```ts +const fileObservable = urlObservable.pipe(concatMap((url) => http.get(url))); +``` + +The Observable returned in the `concatMap` function is usually referred to as a so-called "inner" Observable, while in this context the `urlObservable` is the so-called "outer" Observable. + +The [`concatMap()`](/api/operators/concatMap) operator subscribes to each "inner" Observable, buffers all further emissions of the "outer" Observable, and copies all the emitted values until the inner Observable completes, and continues processing the values of the "outer Observable". All of the values are in that way concatenated. Other useful flattening operators are + +- [`mergeMap()`](/api/operators/mergeMap) — subscribes to each inner Observable as it arrives, then emits each value as it arrives +- [`switchMap()`](/api/operators/switchMap) — subscribes to the first inner Observable when it arrives, and emits each value as it arrives, but when the next inner Observable arrives, unsubscribes to the previous one, and subscribes to the new one. +- [`exhaustMap()`](/api/operators/exhaustMap) — subscribes to the first inner Observable when it arrives, and emits each value as it arrives, discarding all newly arriving inner Observables until that first one completes, then waits for the next inner Observable. diff --git a/apps/rxjs.dev-next/docs/guide/importing.md b/apps/rxjs.dev-next/docs/guide/importing.md new file mode 100644 index 0000000000..46b08b0658 --- /dev/null +++ b/apps/rxjs.dev-next/docs/guide/importing.md @@ -0,0 +1,189 @@ +# Importing instructions + +There are different ways you can [install](/guide/installation) RxJS. Using/importing RxJS depends on +the used RxJS version, but also depends on the used installation method. + +[Pipeable operators](https://v6.rxjs.dev/guide/v6/pipeable-operators) were introduced in RxJS version +5.5. This enabled all operators to be exported from a single place. This new export site was introduced +with RxJS version 6 where all pipeable operators could have been imported from `'rxjs/operators'`. For +example, `import { map } from 'rxjs/operators'`. + +## New in RxJS v7.2.0 + +**With RxJS v7.2.0, most operators have been moved to `['rxjs'](/api)` +export site. This means that the preferred way to import operators is from `'rxjs'`, while +`'rxjs/operators'` export site has been deprecated.** + +For example, instead of using: + +```ts +import { map } from 'rxjs/operators'; +``` + +**the preferred way** is to use: + +```ts +import { map } from 'rxjs'; +``` + +Although the old way of importing operators is still active, it will be removed in one of the next major +versions. + +Click [here to see](#how-to-migrate) how to migrate. + +## Export sites + +RxJS v7 exports 6 different locations out of which you can import what you need. Those are: + +- `['rxjs'](/api)` - for example: `import { of } from 'rxjs';` +- `['rxjs/operators'](/api/operators)` - for example: `import { map } from 'rxjs/operators';` +- `['rxjs/ajax'](/api/ajax)` - for example: `import { ajax } from 'rxjs/ajax';` +- `['rxjs/fetch'](/api/fetch)` - for example: `import { fromFetch } from 'rxjs/fetch';` +- `['rxjs/webSocket'](/api/webSocket)` - for example: `import { webSocket } from 'rxjs/webSocket';` +- `['rxjs/testing'](/api/testing)` - for example: `import { TestScheduler } from 'rxjs/testing';` + +### How to migrate? + +While nothing has been removed from `'rxjs/operators'`, it is strongly recommended doing the operator +imports from `'rxjs'`. Almost all operator function exports have been moved to `'rxjs'`, but only a +couple of old and deprecated operators have stayed in the `'rxjs/operators'`. Those operator functions +are now mostly deprecated and most of them have their either static operator substitution or are kept as +operators, but have a new name so that they are different to their static creation counter-part (usually +ending with `With`). Those are: + +| `'rxjs/operators'` Operator | Replace With Static Creation Operator | Replace With New Operator Name | +| ------------------------------------------------------- | ------------------------------------------------------- | --------------------------------------------------------------- | +| [`combineLatest`](/api/operators/combineLatest) | [`combineLatest`](/api/functions/combineLatest) | [`combineLatestWith`](/api/operators/combineLatestWith) | +| [`concat`](/api/operators/concat) | [`concat`](/api/functions/concat) | [`concatWith`](/api/operators/concatWith) | +| [`merge`](/api/operators/merge) | [`merge`](/api/functions/merge) | [`mergeWith`](/api/operators/mergeWith) | +| [`onErrorResumeNext`](/api/operators/onErrorResumeNext) | [`onErrorResumeNext`](/api/functions/onErrorResumeNext) | [`onErrorResumeNextWith`](/api/operators/onErrorResumeNextWith) | +| [`race`](/api/operators/race) | [`race`](/api/functions/race) | [`raceWith`](/api/operators/raceWith) | +| [`zip`](/api/operators/zip) | [`zip`](/api/functions/zip) | [`zipWith`](/api/operators/zipWith) | + +`partition`, the operator, is a special case, as it is deprecated and you should be using the `partition` creation function exported from `'rxjs'` instead. + +For example, the old and deprecated way of using [`merge`](/api/operators/merge) from `'rxjs/operators'` +is: + +```ts +import { merge } from 'rxjs/operators'; + +a$.pipe(merge(b$)).subscribe(); +``` + +But this should be avoided and replaced with one of the next two examples. + +For example, this could be replaced by using a static creation [`merge`](/api/functions/merge) function: + +```ts +import { merge } from 'rxjs'; + +merge(a$, b$).subscribe(); +``` + +Or it could be written using a pipeable [`mergeWith`](/api/operators/mergeWith) operator: + +```ts +import { mergeWith } from 'rxjs'; + +a$.pipe(mergeWith(b$)).subscribe(); +``` + +Depending on the preferred style, you can choose which one to follow, they are completely equal. + +Since a new way of importing operators is introduced with RxJS v7.2.0, instructions will be split to +prior and after this version. + +### ES6 via npm + +If you've installed RxJS using [ES6 via npm](/guide/installation#es6-via-npm) and installed version +is: + +#### v7.2.0 or later + +Import only what you need: + +```ts +import { of, map } from 'rxjs'; + +of(1, 2, 3).pipe(map((x) => x + '!!!')); // etc +``` + +To import the entire set of functionality: + +```ts +import * as rxjs from 'rxjs'; + +rxjs.of(1, 2, 3).pipe(rxjs.map((x) => x + '!!!')); // etc; +``` + +To use with a globally imported bundle: + +```js +const { of, map } = rxjs; + +of(1, 2, 3).pipe(map((x) => x + '!!!')); // etc +``` + +If you installed RxJS version: + +#### v7.1.0 or older + +Import only what you need: + +```ts +import { of } from 'rxjs'; +import { map } from 'rxjs/operators'; + +of(1, 2, 3).pipe(map((x) => x + '!!!')); // etc +``` + +To import the entire set of functionality: + +```ts +import * as rxjs from 'rxjs'; +import * as operators from 'rxjs'; + +rxjs.of(1, 2, 3).pipe(operators.map((x) => x + '!!!')); // etc; +``` + +To use with a globally imported bundle: + +```js +const { of } = rxjs; +const { map } = rxjs.operators; + +of(1, 2, 3).pipe(map((x) => x + '!!!')); // etc +``` + +### CDN + +If you installed a library [using CDN](/guide/installation#cdn), the global namespace for rxjs is +`rxjs`. + +#### v7.2.0 or later + +```js +const { range, filter, map } = rxjs; + +range(1, 200) + .pipe( + filter((x) => x % 2 === 1), + map((x) => x + x) + ) + .subscribe((x) => console.log(x)); +``` + +#### v7.1.0 or older + +```js +const { range } = rxjs; +const { filter, map } = rxjs.operators; + +range(1, 200) + .pipe( + filter((x) => x % 2 === 1), + map((x) => x + x) + ) + .subscribe((x) => console.log(x)); +``` diff --git a/apps/rxjs.dev-next/docs/guide/installation.md b/apps/rxjs.dev-next/docs/guide/installation.md new file mode 100644 index 0000000000..86962d77ec --- /dev/null +++ b/apps/rxjs.dev-next/docs/guide/installation.md @@ -0,0 +1,55 @@ +# Installation Instructions + +Here are different ways you can install RxJS: + +## ES2015 via npm + +```shell +npm install rxjs +``` + +By default, RxJS 7.x will provide different variants of the code based on the consumer: + +- When RxJS 7.x is used on Node.js regardless of whether it is consumed via `require` or `import`, CommonJS code targeting ES5 will be provided for execution. +- When RxJS 7.4+ is used via a bundler targeting a browser (or other non-Node.js platform) ES module code targeting ES5 will be provided by default with the option to use ES2015 code. + 7.x versions prior to 7.4.0 will only provide ES5 code. + +If the target browsers for a project support ES2015+ or the bundle process supports down-leveling to ES5 then the bundler can optionally be configured to allow the ES2015 RxJS code to be used instead. +You can enable support for using the ES2015 RxJS code by configuring a bundler to use the `es2015` custom export condition during module resolution. +Configuring a bundler to use the `es2015` custom export condition is specific to each bundler. +If you are interested in using this option, please consult the documentation of your bundler for additional information. +However, some general information can be found here: + +- https://webpack.js.org/guides/package-exports/#conditions-custom +- https://github.com/rollup/plugins/blob/node-resolve-v11.0.0/packages/node-resolve/README.md#exportconditions + +To import only what you need, please [check out this](/guide/importing#es6-via-npm) guide. + +## CommonJS via npm + +If you receive an error like error TS2304: Cannot find name 'Promise' or error TS2304: Cannot find name +'Iterable' when using RxJS you may need to install a supplemental set of typings. + +1. For typings users: + +```shell +typings install es6-shim --ambient +``` + +2. If you're not using typings the interfaces can be copied from /es6-shim/es6-shim.d.ts. + +3. Add type definition file included in tsconfig.json or CLI argument. + +## All Module Types (CJS/ES6/AMD/TypeScript) via npm + +To install this library via npm version 3, use the following command: + +```shell +npm install @reactivex/rxjs +``` + +If you are using npm version 2, you need to specify the library version explicitly: + +```shell +npm install @reactivex/rxjs@7.3.0 +``` diff --git a/apps/rxjs.dev-next/docs/guide/observable.md b/apps/rxjs.dev-next/docs/guide/observable.md new file mode 100644 index 0000000000..4e0e7bd114 --- /dev/null +++ b/apps/rxjs.dev-next/docs/guide/observable.md @@ -0,0 +1,450 @@ +# Observable + +Observables are lazy Push collections of multiple values. They fill the missing spot in the following table: + +| | Single | Multiple | +| -------- | ----------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| **Pull** | [`Function`](https://developer.mozilla.org/en-US/docs/Glossary/Function) | [`Iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) | +| **Push** | [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) | [`Observable`](/api/index/class/Observable) | + +**Example.** The following is an Observable that pushes the values `1`, `2`, `3` immediately (synchronously) when subscribed, and the value `4` after one second has passed since the subscribe call, then completes: + +```ts +import { Observable } from 'rxjs'; + +const observable = new Observable((subscriber) => { + subscriber.next(1); + subscriber.next(2); + subscriber.next(3); + setTimeout(() => { + subscriber.next(4); + subscriber.complete(); + }, 1000); +}); +``` + +To invoke the Observable and see these values, we need to _subscribe_ to it: + +```ts +import { Observable } from 'rxjs'; + +const observable = new Observable((subscriber) => { + subscriber.next(1); + subscriber.next(2); + subscriber.next(3); + setTimeout(() => { + subscriber.next(4); + subscriber.complete(); + }, 1000); +}); + +console.log('just before subscribe'); +observable.subscribe({ + next(x) { + console.log('got value ' + x); + }, + error(err) { + console.error('something wrong occurred: ' + err); + }, + complete() { + console.log('done'); + }, +}); +console.log('just after subscribe'); +``` + +Which executes as such on the console: + +```plaintext +just before subscribe +got value 1 +got value 2 +got value 3 +just after subscribe +got value 4 +done +``` + +## Pull versus Push + +_Pull_ and _Push_ are two different protocols that describe how a data _Producer_ can communicate with a data _Consumer_. + +**What is Pull?** In Pull systems, the Consumer determines when it receives data from the data Producer. The Producer itself is unaware of when the data will be delivered to the Consumer. + +Every JavaScript Function is a Pull system. The function is a Producer of data, and the code that calls the function is consuming it by "pulling" out a _single_ return value from its call. + +ES2015 introduced [generator functions and iterators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*) (`function*`), another type of Pull system. Code that calls `iterator.next()` is the Consumer, "pulling" out _multiple_ values from the iterator (the Producer). + +| | Producer | Consumer | +| -------- | ------------------------------------------ | ------------------------------------------- | +| **Pull** | **Passive:** produces data when requested. | **Active:** decides when data is requested. | +| **Push** | **Active:** produces data at its own pace. | **Passive:** reacts to received data. | + +**What is Push?** In Push systems, the Producer determines when to send data to the Consumer. The Consumer is unaware of when it will receive that data. + +Promises are the most common type of Push system in JavaScript today. A Promise (the Producer) delivers a resolved value to registered callbacks (the Consumers), but unlike functions, it is the Promise which is in charge of determining precisely when that value is "pushed" to the callbacks. + +RxJS introduces Observables, a new Push system for JavaScript. An Observable is a Producer of multiple values, "pushing" them to Observers (Consumers). + +- A **Function** is a lazily evaluated computation that synchronously returns a single value on invocation. +- A **generator** is a lazily evaluated computation that synchronously returns zero to (potentially) infinite values on iteration. +- A **Promise** is a computation that may (or may not) eventually return a single value. +- An **Observable** is a lazily evaluated computation that can synchronously or asynchronously return zero to (potentially) infinite values from the time it's invoked onwards. + +For more info about what to use when converting Observables to Promises, please refer to [this guide](/deprecations/to-promise). + +## Observables as generalizations of functions + +Contrary to popular claims, Observables are not like EventEmitters nor are they like Promises for multiple values. Observables _may act_ like EventEmitters in some cases, namely when they are multicasted using RxJS Subjects, but usually they don't act like EventEmitters. + +Observables are like functions with zero arguments, but generalize those to allow multiple values. + +Consider the following: + +```ts +function foo() { + console.log('Hello'); + return 42; +} + +const x = foo.call(); // same as foo() +console.log(x); +const y = foo.call(); // same as foo() +console.log(y); +``` + +We expect to see as output: + +```plaintext +"Hello" +42 +"Hello" +42 +``` + +You can write the same behavior above, but with Observables: + +```ts +import { Observable } from 'rxjs'; + +const foo = new Observable((subscriber) => { + console.log('Hello'); + subscriber.next(42); +}); + +foo.subscribe((x) => { + console.log(x); +}); +foo.subscribe((y) => { + console.log(y); +}); +``` + +And the output is the same: + +```plaintext +"Hello" +42 +"Hello" +42 +``` + +This happens because both functions and Observables are lazy computations. If you don't call the function, the `console.log('Hello')` won't happen. Also with Observables, if you don't "call" it (with `subscribe`), the `console.log('Hello')` won't happen. Plus, "calling" or "subscribing" is an isolated operation: two function calls trigger two separate side effects, and two Observable subscribes trigger two separate side effects. As opposed to EventEmitters which share the side effects and have eager execution regardless of the existence of subscribers, Observables have no shared execution and are lazy. + +Subscribing to an Observable is analogous to calling a Function. + +Some people claim that Observables are asynchronous. That is not true. If you surround a function call with logs, like this: + +```ts +console.log('before'); +console.log(foo.call()); +console.log('after'); +``` + +You will see the output: + +```plaintext +"before" +"Hello" +42 +"after" +``` + +And this is the same behavior with Observables: + +```ts +console.log('before'); +foo.subscribe((x) => { + console.log(x); +}); +console.log('after'); +``` + +And the output is: + +```plaintext +"before" +"Hello" +42 +"after" +``` + +Which proves the subscription of `foo` was entirely synchronous, just like a function. + +Observables are able to deliver values either synchronously or asynchronously. + +What is the difference between an Observable and a function? **Observables can "return" multiple values over time**, something which functions cannot. You can't do this: + +```ts +function foo() { + console.log('Hello'); + return 42; + return 100; // dead code. will never happen +} +``` + +Functions can only return one value. Observables, however, can do this: + +```ts +import { Observable } from 'rxjs'; + +const foo = new Observable((subscriber) => { + console.log('Hello'); + subscriber.next(42); + subscriber.next(100); // "return" another value + subscriber.next(200); // "return" yet another +}); + +console.log('before'); +foo.subscribe((x) => { + console.log(x); +}); +console.log('after'); +``` + +With synchronous output: + +```plaintext +"before" +"Hello" +42 +100 +200 +"after" +``` + +But you can also "return" values asynchronously: + +```ts +import { Observable } from 'rxjs'; + +const foo = new Observable((subscriber) => { + console.log('Hello'); + subscriber.next(42); + subscriber.next(100); + subscriber.next(200); + setTimeout(() => { + subscriber.next(300); // happens asynchronously + }, 1000); +}); + +console.log('before'); +foo.subscribe((x) => { + console.log(x); +}); +console.log('after'); +``` + +With output: + +```plaintext +"before" +"Hello" +42 +100 +200 +"after" +300 +``` + +Conclusion: + +- `func.call()` means "_give me one value synchronously_" +- `observable.subscribe()` means "_give me any amount of values, either synchronously or asynchronously_" + +## Anatomy of an Observable + +Observables are **created** using `new Observable` or a creation operator, are **subscribed** to with an Observer, **execute** to deliver `next` / `error` / `complete` notifications to the Observer, and their execution may be **disposed**. These four aspects are all encoded in an Observable instance, but some of these aspects are related to other types, like Observer and Subscription. + +Core Observable concerns: + +- **Creating** Observables +- **Subscribing** to Observables +- **Executing** the Observable +- **Disposing** Observables + +### Creating Observables + +The `Observable` constructor takes one argument: the `subscribe` function. + +The following example creates an Observable to emit the string `'hi'` every second to a subscriber. + +```ts +import { Observable } from 'rxjs'; + +const observable = new Observable(function subscribe(subscriber) { + const id = setInterval(() => { + subscriber.next('hi'); + }, 1000); +}); +``` + +Observables can be created with `new Observable`. Most commonly, observables are created using creation functions, like `of`, `from`, `interval`, etc. + +In the example above, the `subscribe` function is the most important piece to describe the Observable. Let's look at what subscribing means. + +### Subscribing to Observables + +The Observable `observable` in the example can be _subscribed_ to, like this: + +```ts +observable.subscribe((x) => console.log(x)); +``` + +It is not a coincidence that `observable.subscribe` and `subscribe` in `new Observable(function subscribe(subscriber) {...})` have the same name. In the library, they are different, but for practical purposes you can consider them conceptually equal. + +This shows how `subscribe` calls are not shared among multiple Observers of the same Observable. When calling `observable.subscribe` with an Observer, the function `subscribe` in `new Observable(function subscribe(subscriber) {...})` is run for that given subscriber. Each call to `observable.subscribe` triggers its own independent setup for that given subscriber. + +Subscribing to an Observable is like calling a function, providing callbacks where the data will be delivered to. + +This is drastically different to event handler APIs like `addEventListener` / `removeEventListener`. With `observable.subscribe`, the given Observer is not registered as a listener in the Observable. The Observable does not even maintain a list of attached Observers. + +A `subscribe` call is simply a way to start an "Observable execution" and deliver values or events to an Observer of that execution. + +### Executing Observables + +The code inside `new Observable(function subscribe(subscriber) {...})` represents an "Observable execution", a lazy computation that only happens for each Observer that subscribes. The execution produces multiple values over time, either synchronously or asynchronously. + +There are three types of values an Observable Execution can deliver: + +- "Next" notification: sends a value such as a Number, a String, an Object, etc. +- "Error" notification: sends a JavaScript Error or exception. +- "Complete" notification: does not send a value. + +"Next" notifications are the most important and most common type: they represent actual data being delivered to a subscriber. "Error" and "Complete" notifications may happen only once during the Observable Execution, and there can only be either one of them. + +These constraints are expressed best in the so-called _Observable Grammar_ or _Contract_, written as a regular expression: + +```plaintext +next*(error|complete)? +``` + +In an Observable Execution, zero to infinite Next notifications may be delivered. If either an Error or Complete notification is delivered, then nothing else can be delivered afterwards. + +The following is an example of an Observable execution that delivers three Next notifications, then completes: + +```ts +import { Observable } from 'rxjs'; + +const observable = new Observable(function subscribe(subscriber) { + subscriber.next(1); + subscriber.next(2); + subscriber.next(3); + subscriber.complete(); +}); +``` + +Observables strictly adhere to the Observable Contract, so the following code would not deliver the Next notification `4`: + +```ts +import { Observable } from 'rxjs'; + +const observable = new Observable(function subscribe(subscriber) { + subscriber.next(1); + subscriber.next(2); + subscriber.next(3); + subscriber.complete(); + subscriber.next(4); // Is not delivered because it would violate the contract +}); +``` + +It is a good idea to wrap any code in `subscribe` with `try`/`catch` block that will deliver an Error notification if it catches an exception: + +```ts +import { Observable } from 'rxjs'; + +const observable = new Observable(function subscribe(subscriber) { + try { + subscriber.next(1); + subscriber.next(2); + subscriber.next(3); + subscriber.complete(); + } catch (err) { + subscriber.error(err); // delivers an error if it caught one + } +}); +``` + +### Disposing Observable Executions + +Because Observable Executions may be infinite, and it's common for an Observer to want to abort execution in finite time, we need an API for canceling an execution. Since each execution is exclusive to one Observer only, once the Observer is done receiving values, it has to have a way to stop the execution, in order to avoid wasting computation power or memory resources. + +When `observable.subscribe` is called, the Observer gets attached to the newly created Observable execution. This call also returns an object, the `Subscription`: + +```ts +const subscription = observable.subscribe((x) => console.log(x)); +``` + +The Subscription represents the ongoing execution, and has a minimal API which allows you to cancel that execution. Read more about the [`Subscription` type here](/guide/subscription). With `subscription.unsubscribe()` you can cancel the ongoing execution: + +```ts +import { from } from 'rxjs'; + +const observable = from([10, 20, 30]); +const subscription = observable.subscribe((x) => console.log(x)); +// Later: +subscription.unsubscribe(); +``` + +When you subscribe, you get back a Subscription, which represents the ongoing execution. Just call `unsubscribe()` to cancel the execution. + +Each Observable must define how to dispose resources of that execution when we create the Observable using `create()`. You can do that by returning a custom `unsubscribe` function from within `function subscribe()`. + +For instance, this is how we clear an interval execution set with `setInterval`: + +```ts +import { Observable } from 'rxjs'; + +const observable = new Observable(function subscribe(subscriber) { + // Keep track of the interval resource + const intervalId = setInterval(() => { + subscriber.next('hi'); + }, 1000); + + // Provide a way of canceling and disposing the interval resource + return function unsubscribe() { + clearInterval(intervalId); + }; +}); +``` + +Just like `observable.subscribe` resembles `new Observable(function subscribe() {...})`, the `unsubscribe` we return from `subscribe` is conceptually equal to `subscription.unsubscribe`. In fact, if we remove the ReactiveX types surrounding these concepts, we're left with rather straightforward JavaScript. + +```ts +function subscribe(subscriber) { + const intervalId = setInterval(() => { + subscriber.next('hi'); + }, 1000); + + return function unsubscribe() { + clearInterval(intervalId); + }; +} + +const unsubscribe = subscribe({ next: (x) => console.log(x) }); + +// Later: +unsubscribe(); // dispose the resources +``` + +The reason why we use Rx types like Observable, Observer, and Subscription is to get safety (such as the Observable Contract) and composability with Operators. diff --git a/apps/rxjs.dev-next/docs/guide/observer.md b/apps/rxjs.dev-next/docs/guide/observer.md new file mode 100644 index 0000000000..c59e54c8d0 --- /dev/null +++ b/apps/rxjs.dev-next/docs/guide/observer.md @@ -0,0 +1,38 @@ +# Observer + +**What is an Observer?** An Observer is a consumer of values delivered by an Observable. Observers are simply a set of callbacks, one for each type of notification delivered by the Observable: `next`, `error`, and `complete`. The following is an example of a typical Observer object: + +```ts +const observer = { + next: (x) => console.log('Observer got a next value: ' + x), + error: (err) => console.error('Observer got an error: ' + err), + complete: () => console.log('Observer got a complete notification'), +}; +``` + +To use the Observer, provide it to the `subscribe` of an Observable: + +```ts +observable.subscribe(observer); +``` + +Observers are just objects with three callbacks, one for each type of notification that an Observable may deliver. + +Observers in RxJS may also be _partial_. If you don't provide one of the callbacks, the execution of the Observable will still happen normally, except some types of notifications will be ignored, because they don't have a corresponding callback in the Observer. + +The example below is an `Observer` without the `complete` callback: + +```ts +const observer = { + next: (x) => console.log('Observer got a next value: ' + x), + error: (err) => console.error('Observer got an error: ' + err), +}; +``` + +When subscribing to an `Observable`, you may also just provide the next callback as an argument, without being attached to an `Observer` object, for instance like this: + +```ts +observable.subscribe((x) => console.log('Observer got a next value: ' + x)); +``` + +Internally in `observable.subscribe`, it will create an `Observer` object using the callback argument as the `next` handler. diff --git a/apps/rxjs.dev-next/docs/guide/operators.md b/apps/rxjs.dev-next/docs/guide/operators.md new file mode 100644 index 0000000000..3cfd991f85 --- /dev/null +++ b/apps/rxjs.dev-next/docs/guide/operators.md @@ -0,0 +1,346 @@ +# RxJS Operators + +RxJS is mostly useful for its _operators_, even though the Observable is the foundation. Operators are the essential pieces that allow complex asynchronous code to be easily composed in a declarative manner. + +## What are operators? + +Operators are **functions**. There are two kinds of operators: + +**Pipeable Operators** are the kind that can be piped to Observables using the syntax `observableInstance.pipe(operator)` or, more commonly, `observableInstance.pipe(operatorFactory())`. Operator factory functions include, [`filter(...)`](/api/operators/filter), and [`mergeMap(...)`](/api/operators/mergeMap). + +When Pipeable Operators are called, they do not _change_ the existing Observable instance. Instead, they return a _new_ Observable, whose subscription logic is based on the first Observable. + +A Pipeable Operator is a function that takes an Observable as its input and returns another Observable. It is a pure operation: the previous Observable stays unmodified. + +A Pipeable Operator Factory is a function that can take parameters to set the context and return a Pipeable Operator. The factory’s arguments belong to the operator’s lexical scope. + +A Pipeable Operator is essentially a pure function which takes one Observable as input and generates another Observable as output. Subscribing to the output Observable will also subscribe to the input Observable. + +**Creation Operators** are the other kind of operator, which can be called as standalone functions to create a new Observable. For example: `of(1, 2, 3)` creates an observable that will emit 1, 2, and 3, one right after another. Creation operators will be discussed in more detail in a later section. + +For example, the operator called [`map`](/api/operators/map) is analogous to the Array method of the same name. Just as `[1, 2, 3].map(x => x * x)` will yield `[1, 4, 9]`, the Observable created like this: + +```ts +import { of, map } from 'rxjs'; + +of(1, 2, 3) + .pipe(map((x) => x * x)) + .subscribe((v) => console.log(`value: ${v}`)); + +// Logs: +// value: 1 +// value: 4 +// value: 9 +``` + +will emit `1`, `4`, `9`. Another useful operator is [`first`](/api/operators/first): + +```ts +import { of, first } from 'rxjs'; + +of(1, 2, 3) + .pipe(first()) + .subscribe((v) => console.log(`value: ${v}`)); + +// Logs: +// value: 1 +``` + +Note that `map` logically must be constructed on the fly, since it must be given the mapping function to. By contrast, `first` could be a constant, but is nonetheless constructed on the fly. As a general practice, all operators are constructed, whether they need arguments or not. + +## Piping + +Pipeable operators are functions, so they _could_ be used like ordinary functions: `op()(obs)` — but in practice, there tend to be many of them convolved together, and quickly become unreadable: `op4()(op3()(op2()(op1()(obs))))`. For that reason, Observables have a method called `.pipe()` that accomplishes the same thing while being much easier to read: + +```ts +obs.pipe(op1(), op2(), op3(), op4()); +``` + +As a stylistic matter, `op()(obs)` is never used, even if there is only one operator; `obs.pipe(op())` is universally preferred. + +## Creation Operators + +**What are creation operators?** Distinct from pipeable operators, creation operators are functions that can be used to create an Observable with some common predefined behavior or by joining other Observables. + +A typical example of a creation operator would be the `interval` function. It takes a number (not an Observable) as input argument, and produces an Observable as output: + +```ts +import { interval } from 'rxjs'; + +const observable = interval(1000 /* number of milliseconds */); +``` + +See the list of all static creation operators [here](#creation-operators-list). + +## Higher-order Observables + +Observables most commonly emit ordinary values like strings and numbers, but surprisingly often, it is necessary to handle Observables _of_ Observables, so-called higher-order Observables. For example, imagine you had an Observable emitting strings that were the URLs of files you wanted to see. The code might look like this: + +```ts +const fileObservable = urlObservable.pipe(map((url) => http.get(url))); +``` + +`http.get()` returns an Observable (of string or string arrays probably) for each individual URL. Now you have an Observable _of_ Observables, a higher-order Observable. + +But how do you work with a higher-order Observable? Typically, by _flattening_: by (somehow) converting a higher-order Observable into an ordinary Observable. For example: + +```ts +const fileObservable = urlObservable.pipe( + map((url) => http.get(url)), + concatAll() +); +``` + +The [`concatAll()`](/api/operators/concatAll) operator subscribes to each "inner" Observable that comes out of the "outer" Observable, and copies all the emitted values until that Observable completes, and goes on to the next one. All of the values are in that way concatenated. Other useful flattening operators (called [_join operators_](#join-operators)) are + +- [`mergeAll()`](/api/operators/mergeAll) — subscribes to each inner Observable as it arrives, then emits each value as it arrives +- [`switchAll()`](/api/operators/switchAll) — subscribes to the first inner Observable when it arrives, and emits each value as it arrives, but when the next inner Observable arrives, unsubscribes to the previous one, and subscribes to the new one. +- [`exhaustAll()`](/api/operators/exhaustAll) — subscribes to the first inner Observable when it arrives, and emits each value as it arrives, discarding all newly arriving inner Observables until that first one completes, then waits for the next inner Observable. + +Just as many array libraries combine [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) and [`flat()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) (or `flatten()`) into a single [`flatMap()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap), there are mapping equivalents of all the RxJS flattening operators [`concatMap()`](/api/operators/concatMap), [`mergeMap()`](/api/operators/mergeMap), [`switchMap()`](/api/operators/switchMap), and [`exhaustMap()`](/api/operators/exhaustMap). + +## Marble diagrams + +To explain how operators work, textual descriptions are often not enough. Many operators are related to time, they may for instance delay, sample, throttle, or debounce value emissions in different ways. Diagrams are often a better tool for that. _Marble Diagrams_ are visual representations of how operators work, and include the input Observable(s), the operator and its parameters, and the output Observable. + +In a marble diagram, time flows to the right, and the diagram describes how values ("marbles") are emitted on the Observable execution. + +Below you can see the anatomy of a marble diagram. + + + +Throughout this documentation site, we extensively use marble diagrams to explain how operators work. They may be really useful in other contexts too, like on a whiteboard or even in our unit tests (as ASCII diagrams). + +## Categories of operators + +There are operators for different purposes, and they may be categorized as: creation, transformation, filtering, joining, multicasting, error handling, utility, etc. In the following list you will find all the operators organized in categories. + +For a complete overview, see the [references page](/api). + +### Creation Operators + +- [`ajax`](/api/ajax/ajax) +- [`bindCallback`](/api/index/function/bindCallback) +- [`bindNodeCallback`](/api/index/function/bindNodeCallback) +- [`defer`](/api/index/function/defer) +- [`EMPTY`](/api/index/const/EMPTY) +- [`from`](/api/index/function/from) +- [`fromEvent`](/api/index/function/fromEvent) +- [`fromEventPattern`](/api/index/function/fromEventPattern) +- [`generate`](/api/index/function/generate) +- [`interval`](/api/index/function/interval) +- [`of`](/api/index/function/of) +- [`range`](/api/index/function/range) +- [`throwError`](/api/index/function/throwError) +- [`timer`](/api/index/function/timer) +- [`iif`](/api/index/function/iif) + +### Join Creation Operators + +These are Observable creation operators that also have join functionality -- emitting values of multiple source Observables. + +- [`combineLatest`](/api/index/function/combineLatest) +- [`concat`](/api/index/function/concat) +- [`forkJoin`](/api/index/function/forkJoin) +- [`merge`](/api/index/function/merge) +- [`partition`](/api/index/function/partition) +- [`race`](/api/index/function/race) +- [`zip`](/api/index/function/zip) + +### Transformation Operators + +- [`buffer`](/api/operators/buffer) +- [`bufferCount`](/api/operators/bufferCount) +- [`bufferTime`](/api/operators/bufferTime) +- [`bufferToggle`](/api/operators/bufferToggle) +- [`bufferWhen`](/api/operators/bufferWhen) +- [`concatMap`](/api/operators/concatMap) +- [`concatMapTo`](/api/operators/concatMapTo) +- [`exhaustMap`](/api/operators/exhaustMap) +- [`expand`](/api/operators/expand) +- [`groupBy`](/api/operators/groupBy) +- [`map`](/api/operators/map) +- [`mapTo`](/api/operators/mapTo) +- [`mergeMap`](/api/operators/mergeMap) +- [`mergeMapTo`](/api/operators/mergeMapTo) +- [`mergeScan`](/api/operators/mergeScan) +- [`pairwise`](/api/operators/pairwise) +- [`partition`](/api/operators/partition) +- [`scan`](/api/operators/scan) +- [`switchScan`](/api/operators/switchScan) +- [`switchMap`](/api/operators/switchMap) +- [`switchMapTo`](/api/operators/switchMapTo) +- [`window`](/api/operators/window) +- [`windowCount`](/api/operators/windowCount) +- [`windowTime`](/api/operators/windowTime) +- [`windowToggle`](/api/operators/windowToggle) +- [`windowWhen`](/api/operators/windowWhen) + +### Filtering Operators + +- [`audit`](/api/operators/audit) +- [`auditTime`](/api/operators/auditTime) +- [`debounce`](/api/operators/debounce) +- [`debounceTime`](/api/operators/debounceTime) +- [`distinct`](/api/operators/distinct) +- [`distinctUntilChanged`](/api/operators/distinctUntilChanged) +- [`distinctUntilKeyChanged`](/api/operators/distinctUntilKeyChanged) +- [`elementAt`](/api/operators/elementAt) +- [`filter`](/api/operators/filter) +- [`first`](/api/operators/first) +- [`ignoreElements`](/api/operators/ignoreElements) +- [`last`](/api/operators/last) +- [`sample`](/api/operators/sample) +- [`sampleTime`](/api/operators/sampleTime) +- [`single`](/api/operators/single) +- [`skip`](/api/operators/skip) +- [`skipLast`](/api/operators/skipLast) +- [`skipUntil`](/api/operators/skipUntil) +- [`skipWhile`](/api/operators/skipWhile) +- [`take`](/api/operators/take) +- [`takeLast`](/api/operators/takeLast) +- [`takeUntil`](/api/operators/takeUntil) +- [`takeWhile`](/api/operators/takeWhile) +- [`throttle`](/api/operators/throttle) +- [`throttleTime`](/api/operators/throttleTime) + +### Join Operators + +Also see the [Join Creation Operators](#join-creation-operators) section above. + +- [`combineLatestAll`](/api/operators/combineLatestAll) +- [`concatAll`](/api/operators/concatAll) +- [`exhaustAll`](/api/operators/exhaustAll) +- [`mergeAll`](/api/operators/mergeAll) +- [`switchAll`](/api/operators/switchAll) +- [`startWith`](/api/operators/startWith) +- [`withLatestFrom`](/api/operators/withLatestFrom) + +### Multicasting Operators + +- [`share`](/api/operators/share) + +### Error Handling Operators + +- [`catchError`](/api/operators/catchError) +- [`retry`](/api/operators/retry) +- [`retryWhen`](/api/operators/retryWhen) + +### Utility Operators + +- [`tap`](/api/operators/tap) +- [`delay`](/api/operators/delay) +- [`delayWhen`](/api/operators/delayWhen) +- [`dematerialize`](/api/operators/dematerialize) +- [`materialize`](/api/operators/materialize) +- [`observeOn`](/api/operators/observeOn) +- [`subscribeOn`](/api/operators/subscribeOn) +- [`timeInterval`](/api/operators/timeInterval) +- [`timestamp`](/api/operators/timestamp) +- [`timeout`](/api/operators/timeout) +- [`timeoutWith`](/api/operators/timeoutWith) +- [`toArray`](/api/operators/toArray) + +### Conditional and Boolean Operators + +- [`defaultIfEmpty`](/api/operators/defaultIfEmpty) +- [`every`](/api/operators/every) +- [`find`](/api/operators/find) +- [`findIndex`](/api/operators/findIndex) +- [`isEmpty`](/api/operators/isEmpty) + +### Mathematical and Aggregate Operators + +- [`count`](/api/operators/count) +- [`max`](/api/operators/max) +- [`min`](/api/operators/min) +- [`reduce`](/api/operators/reduce) + +## Creating custom operators + +### Use the `pipe()` function to make new operators + +If there is a commonly used sequence of operators in your code, use the `pipe()` function to extract the sequence into a new operator. Even if a sequence is not that common, breaking it out into a single operator can improve readability. + +For example, you could make a function that discarded odd values and doubled even values like this: + +```ts +import { pipe, filter, map } from 'rxjs'; + +function discardOddDoubleEven() { + return pipe( + filter((v) => !(v % 2)), + map((v) => v + v) + ); +} +``` + +(The `pipe()` function is analogous to, but not the same thing as, the `.pipe()` method on an Observable.) + +### Creating new operators from scratch + +It is more complicated, but if you have to write an operator that cannot be made from a combination of existing operators (a rare occurrence), you can write an operator from scratch using the Observable constructor, like this: + +```ts +import { Observable, of } from 'rxjs'; + +function delay(delayInMillis: number) { + return (observable: Observable) => + new Observable((subscriber) => { + // this function will be called each time this + // Observable is subscribed to. + const allTimerIDs = new Set(); + let hasCompleted = false; + const subscription = observable.subscribe({ + next(value) { + // Start a timer to delay the next value + // from being pushed. + const timerID = setTimeout(() => { + subscriber.next(value); + // after we push the value, we need to clean up the timer timerID + allTimerIDs.delete(timerID); + // If the source has completed, and there are no more timers running, + // we can complete the resulting observable. + if (hasCompleted && allTimerIDs.size === 0) { + subscriber.complete(); + } + }, delayInMillis); + + allTimerIDs.add(timerID); + }, + error(err) { + // We need to make sure we're propagating our errors through. + subscriber.error(err); + }, + complete() { + hasCompleted = true; + // If we still have timers running, we don't want to complete yet. + if (allTimerIDs.size === 0) { + subscriber.complete(); + } + }, + }); + + // Return the finalization logic. This will be invoked when + // the result errors, completes, or is unsubscribed. + return () => { + subscription.unsubscribe(); + // Clean up our timers. + for (const timerID of allTimerIDs) { + clearTimeout(timerID); + } + }; + }); +} + +// Try it out! +of(1, 2, 3).pipe(delay(1000)).subscribe(console.log); +``` + +Note that you must + +1. implement all three Observer functions, `next()`, `error()`, and `complete()` when subscribing to the input Observable. +2. implement a "finalization" function that cleans up when the Observable completes (in this case by unsubscribing and clearing any pending timeouts). +3. return that finalization function from the function passed to the Observable constructor. + +Of course, this is only an example; the [`delay()`](/api/operators/delay) operator already exists. diff --git a/apps/rxjs.dev-next/docs/guide/overview.md b/apps/rxjs.dev-next/docs/guide/overview.md new file mode 100644 index 0000000000..8267959103 --- /dev/null +++ b/apps/rxjs.dev-next/docs/guide/overview.md @@ -0,0 +1,124 @@ +# Introduction + +RxJS is a library for composing asynchronous and event-based programs by using observable sequences. It provides one core type, the [Observable](/guide/observable), satellite types (Observer, Schedulers, Subjects) and operators inspired by `Array` methods (`map`, `filter`, `reduce`, `every`, etc) to allow handling asynchronous events as collections. + +Think of RxJS as Lodash for events. + +ReactiveX combines the [Observer pattern](https://en.wikipedia.org/wiki/Observer_pattern) with the [Iterator pattern](https://en.wikipedia.org/wiki/Iterator_pattern) and [functional programming with collections](http://martinfowler.com/articles/collection-pipeline/#NestedOperatorExpressions) to fill the need for an ideal way of managing sequences of events. + +The essential concepts in RxJS which solve async event management are: + +- **Observable:** represents the idea of an invokable collection of future values or events. +- **Observer:** is a collection of callbacks that knows how to listen to values delivered by the Observable. +- **Subscription:** represents the execution of an Observable, is primarily useful for cancelling the execution. +- **Operators:** are pure functions that enable a functional programming style of dealing with collections with operations like `map`, `filter`, `concat`, `reduce`, etc. +- **Subject:** is equivalent to an EventEmitter, and the only way of multicasting a value or event to multiple Observers. +- **Schedulers:** are centralized dispatchers to control concurrency, allowing us to coordinate when computation happens on e.g. `setTimeout` or `requestAnimationFrame` or others. + +## First examples + +Normally you register event listeners. + +```ts +document.addEventListener('click', () => console.log('Clicked!')); +``` + +Using RxJS you create an observable instead. + +```ts +import { fromEvent } from 'rxjs'; + +fromEvent(document, 'click').subscribe(() => console.log('Clicked!')); +``` + +### Purity + +What makes RxJS powerful is its ability to produce values using pure functions. That means your code is less prone to errors. + +Normally you would create an impure function, where other +pieces of your code can mess up your state. + +```ts +let count = 0; +document.addEventListener('click', () => console.log(`Clicked ${++count} times`)); +``` + +Using RxJS you isolate the state. + +```ts +import { fromEvent, scan } from 'rxjs'; + +fromEvent(document, 'click') + .pipe(scan((count) => count + 1, 0)) + .subscribe((count) => console.log(`Clicked ${count} times`)); +``` + +The **scan** operator works just like **reduce** for arrays. It takes a value which is exposed to a callback. The returned value of the callback will then become the next value exposed the next time the callback runs. + +### Flow + +RxJS has a whole range of operators that helps you control how the events flow through your observables. + +This is how you would allow at most one click per second, with plain JavaScript: + +```ts +let count = 0; +let rate = 1000; +let lastClick = Date.now() - rate; +document.addEventListener('click', () => { + if (Date.now() - lastClick >= rate) { + console.log(`Clicked ${++count} times`); + lastClick = Date.now(); + } +}); +``` + +With RxJS: + +```ts +import { fromEvent, throttleTime, scan } from 'rxjs'; + +fromEvent(document, 'click') + .pipe( + throttleTime(1000), + scan((count) => count + 1, 0) + ) + .subscribe((count) => console.log(`Clicked ${count} times`)); +``` + +Other flow control operators are [**filter**](/api/operators/filter), [**delay**](/api/operators/delay), [**debounceTime**](/api/operators/debounceTime), [**take**](/api/operators/take), [**takeUntil**](/api/operators/takeUntil), [**distinct**](/api/operators/distinct), [**distinctUntilChanged**](/api/operators/distinctUntilChanged) etc. + +### Values + +You can transform the values passed through your observables. + +Here's how you can add the current mouse x position for every click, in plain JavaScript: + +```ts +let count = 0; +const rate = 1000; +let lastClick = Date.now() - rate; +document.addEventListener('click', (event) => { + if (Date.now() - lastClick >= rate) { + count += event.clientX; + console.log(count); + lastClick = Date.now(); + } +}); +``` + +With RxJS: + +```ts +import { fromEvent, throttleTime, map, scan } from 'rxjs'; + +fromEvent(document, 'click') + .pipe( + throttleTime(1000), + map((event) => event.clientX), + scan((count, clientX) => count + clientX, 0) + ) + .subscribe((count) => console.log(count)); +``` + +Other value producing operators are [**pairwise**](/api/operators/pairwise), [**sample**](/api/operators/sample) etc. diff --git a/apps/rxjs.dev-next/docs/guide/scheduler.md b/apps/rxjs.dev-next/docs/guide/scheduler.md new file mode 100644 index 0000000000..93087b6422 --- /dev/null +++ b/apps/rxjs.dev-next/docs/guide/scheduler.md @@ -0,0 +1,147 @@ +# Scheduler + +**What is a Scheduler?** A scheduler controls when a subscription starts and when notifications are delivered. It consists of three components. + +- **A Scheduler is a data structure.** It knows how to store and queue tasks based on priority or other criteria. +- **A Scheduler is an execution context.** It denotes where and when the task is executed (e.g. immediately, or in another callback mechanism such as setTimeout or process.nextTick, or the animation frame). +- **A Scheduler has a (virtual) clock.** It provides a notion of "time" by a getter method `now()` on the scheduler. Tasks being scheduled on a particular scheduler will adhere only to the time denoted by that clock. + +A Scheduler lets you define in what execution context will an Observable deliver notifications to its Observer. + +In the example below, we take the usual simple Observable that emits values `1`, `2`, `3` synchronously, and use the operator `observeOn` to specify the `asyncScheduler` scheduler to use for delivering those values. + + +```ts +import { Observable, observeOn, asyncScheduler } from 'rxjs'; + +const observable = new Observable((observer) => { + observer.next(1); + observer.next(2); + observer.next(3); + observer.complete(); +}).pipe( + observeOn(asyncScheduler) +); + +console.log('just before subscribe'); +observable.subscribe({ + next(x) { + console.log('got value ' + x); + }, + error(err) { + console.error('something wrong occurred: ' + err); + }, + complete() { + console.log('done'); + }, +}); +console.log('just after subscribe'); +``` + +Which executes with the output: + +```plaintext +just before subscribe +just after subscribe +got value 1 +got value 2 +got value 3 +done +``` + +Notice how the notifications `got value...` were delivered after `just after subscribe`, which is different to the default behavior we have seen so far. This is because `observeOn(asyncScheduler)` introduces a proxy Observer between `new Observable` and the final Observer. Let's rename some identifiers to make that distinction obvious in the example code: + + +```ts +import { Observable, observeOn, asyncScheduler } from 'rxjs'; + +const observable = new Observable((proxyObserver) => { + proxyObserver.next(1); + proxyObserver.next(2); + proxyObserver.next(3); + proxyObserver.complete(); +}).pipe( + observeOn(asyncScheduler) +); + +const finalObserver = { + next(x) { + console.log('got value ' + x); + }, + error(err) { + console.error('something wrong occurred: ' + err); + }, + complete() { + console.log('done'); + }, +}; + +console.log('just before subscribe'); +observable.subscribe(finalObserver); +console.log('just after subscribe'); +``` + +The `proxyObserver` is created in `observeOn(asyncScheduler)`, and its `next(val)` function is approximately the following: + + +```ts +const proxyObserver = { + next(val) { + asyncScheduler.schedule( + (x) => finalObserver.next(x), + 0 /* delay */, + val /* will be the x for the function above */ + ); + }, + + // ... +}; +``` + +The `asyncScheduler` Scheduler operates with a `setTimeout` or `setInterval`, even if the given `delay` was zero. As usual, in JavaScript, `setTimeout(fn, 0)` is known to run the function `fn` earliest on the next event loop iteration. This explains why `got value 1` is delivered to the `finalObserver` after `just after subscribe` happened. + +The `schedule()` method of a Scheduler takes a `delay` argument, which refers to a quantity of time relative to the Scheduler's own internal clock. A Scheduler's clock need not have any relation to the actual wall-clock time. This is how temporal operators like `delay` operate not on actual time, but on time dictated by the Scheduler's clock. This is specially useful in testing, where a _virtual time Scheduler_ may be used to fake wall-clock time while in reality executing scheduled tasks synchronously. + +## Scheduler Types + +The `asyncScheduler` Scheduler is one of the built-in schedulers provided by RxJS. Each of these can be created and returned by using static properties of the `Scheduler` object. + +| Scheduler | Purpose | +| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `null` | By not passing any scheduler, notifications are delivered synchronously and recursively. Use this for constant-time operations or tail recursive operations. | +| `queueScheduler` | Schedules on a queue in the current event frame (trampoline scheduler). Use this for iteration operations. | +| `asapScheduler` | Schedules on the micro task queue, which is the same queue used for promises. Basically after the current job, but before the next job. Use this for asynchronous conversions. | +| `asyncScheduler` | Schedules work with `setInterval`. Use this for time-based operations. | +| `animationFrameScheduler` | Schedules task that will happen just before next browser content repaint. Can be used to create smooth browser animations. | + +## Using Schedulers + +You may have already used schedulers in your RxJS code without explicitly stating the type of schedulers to be used. This is because all Observable operators that deal with concurrency have optional schedulers. If you do not provide the scheduler, RxJS will pick a default scheduler by using the principle of least concurrency. This means that the scheduler which introduces the least amount of concurrency that satisfies the needs of the operator is chosen. For example, for operators returning an observable with a finite and small number of messages, RxJS uses no Scheduler, i.e. `null` or `undefined`. For operators returning a potentially large or infinite number of messages, `queueScheduler` Scheduler is used. For operators which use timers, `asyncScheduler` is used. + +Because RxJS uses the least concurrency scheduler, you can pick a different scheduler if you want to introduce concurrency for performance purpose. To specify a particular scheduler, you can use those operator methods that take a scheduler, e.g., `from([10, 20, 30], asyncScheduler)`. + +**Static creation operators usually take a Scheduler as argument.** For instance, `from(array, scheduler)` lets you specify the Scheduler to use when delivering each notification converted from the `array`. It is usually the last argument to the operator. The following static creation operators take a Scheduler argument: + +- `bindCallback` +- `bindNodeCallback` +- `combineLatest` +- `concat` +- `empty` +- `from` +- `fromPromise` +- `interval` +- `merge` +- `of` +- `range` +- `throw` +- `timer` + +**Use `subscribeOn` to schedule in what context will the `subscribe()` call happen.** By default, a `subscribe()` call on an Observable will happen synchronously and immediately. However, you may delay or schedule the actual subscription to happen on a given Scheduler, using the instance operator `subscribeOn(scheduler)`, where `scheduler` is an argument you provide. + +**Use `observeOn` to schedule in what context will notifications be delivered.** As we saw in the examples above, instance operator `observeOn(scheduler)` introduces a mediator Observer between the source Observable and the destination Observer, where the mediator schedules calls to the destination Observer using your given `scheduler`. + +**Instance operators may take a Scheduler as argument.** + +Time-related operators like `bufferTime`, `debounceTime`, `delay`, `auditTime`, `sampleTime`, `throttleTime`, `timeInterval`, `timeout`, `timeoutWith`, `windowTime` all take a Scheduler as the last argument, and otherwise operate by default on the `asyncScheduler`. + +Other instance operators that take a Scheduler as argument: `combineLatest`, `concat`, `expand`, `merge`, `startWith`. diff --git a/apps/rxjs.dev-next/docs/guide/subject.md b/apps/rxjs.dev-next/docs/guide/subject.md new file mode 100644 index 0000000000..2938b633d9 --- /dev/null +++ b/apps/rxjs.dev-next/docs/guide/subject.md @@ -0,0 +1,377 @@ +# Subject + +**What is a Subject?** An RxJS Subject is a special type of Observable that allows values to be multicasted to many Observers. While plain Observables are unicast (each subscribed Observer owns an independent execution of the Observable), Subjects are multicast. + +A Subject is like an Observable, but can multicast to many Observers. Subjects are like EventEmitters: they maintain a registry of many listeners. + +**Every Subject is an Observable.** Given a Subject, you can `subscribe` to it, providing an Observer, which will start receiving values normally. From the perspective of the Observer, it cannot tell whether the Observable execution is coming from a plain unicast Observable or a Subject. + +Internally to the Subject, `subscribe` does not invoke a new execution that delivers values. It simply registers the given Observer in a list of Observers, similarly to how `addListener` usually works in other libraries and languages. + +**Every Subject is an Observer.** It is an object with the methods `next(v)`, `error(e)`, and `complete()`. To feed a new value to the Subject, just call `next(theValue)`, and it will be multicasted to the Observers registered to listen to the Subject. + +In the example below, we have two Observers attached to a Subject, and we feed some values to the Subject: + +```ts +import { Subject } from 'rxjs'; + +const subject = new Subject(); + +subject.subscribe({ + next: (v) => console.log(`observerA: ${v}`), +}); +subject.subscribe({ + next: (v) => console.log(`observerB: ${v}`), +}); + +subject.next(1); +subject.next(2); + +// Logs: +// observerA: 1 +// observerB: 1 +// observerA: 2 +// observerB: 2 +``` + +Since a Subject is an Observer, this also means you may provide a Subject as the argument to the `subscribe` of any Observable, like the example below shows: + +```ts +import { Subject, from } from 'rxjs'; + +const subject = new Subject(); + +subject.subscribe({ + next: (v) => console.log(`observerA: ${v}`), +}); +subject.subscribe({ + next: (v) => console.log(`observerB: ${v}`), +}); + +const observable = from([1, 2, 3]); + +observable.subscribe(subject); // You can subscribe providing a Subject + +// Logs: +// observerA: 1 +// observerB: 1 +// observerA: 2 +// observerB: 2 +// observerA: 3 +// observerB: 3 +``` + +With the approach above, we essentially just converted a unicast Observable execution to multicast, through the Subject. This demonstrates how Subjects are the only way of making any Observable execution be shared to multiple Observers. + +There are also a few specializations of the `Subject` type: `BehaviorSubject`, `ReplaySubject`, and `AsyncSubject`. + +## Multicasted Observables + +A "multicasted Observable" passes notifications through a Subject which may have many subscribers, whereas a plain "unicast Observable" only sends notifications to a single Observer. + +A multicasted Observable uses a Subject under the hood to make multiple Observers see the same Observable execution. + +Under the hood, this is how the `multicast` operator works: Observers subscribe to an underlying Subject, and the Subject subscribes to the source Observable. The following example is similar to the previous example which used `observable.subscribe(subject)`: + +```ts +import { from, Subject, multicast } from 'rxjs'; + +const source = from([1, 2, 3]); +const subject = new Subject(); +const multicasted = source.pipe(multicast(subject)); + +// These are, under the hood, `subject.subscribe({...})`: +multicasted.subscribe({ + next: (v) => console.log(`observerA: ${v}`), +}); +multicasted.subscribe({ + next: (v) => console.log(`observerB: ${v}`), +}); + +// This is, under the hood, `source.subscribe(subject)`: +multicasted.connect(); +``` + +`multicast` returns an Observable that looks like a normal Observable, but works like a Subject when it comes to subscribing. `multicast` returns a `ConnectableObservable`, which is simply an Observable with the `connect()` method. + +The `connect()` method is important to determine exactly when the shared Observable execution will start. Because `connect()` does `source.subscribe(subject)` under the hood, `connect()` returns a Subscription, which you can unsubscribe from in order to cancel the shared Observable execution. + +### Reference counting + +Calling `connect()` manually and handling the Subscription is often cumbersome. Usually, we want to _automatically_ connect when the first Observer arrives, and automatically cancel the shared execution when the last Observer unsubscribes. + +Consider the following example where subscriptions occur as outlined by this list: + +1. First Observer subscribes to the multicasted Observable +2. **The multicasted Observable is connected** +3. The `next` value `0` is delivered to the first Observer +4. Second Observer subscribes to the multicasted Observable +5. The `next` value `1` is delivered to the first Observer +6. The `next` value `1` is delivered to the second Observer +7. First Observer unsubscribes from the multicasted Observable +8. The `next` value `2` is delivered to the second Observer +9. Second Observer unsubscribes from the multicasted Observable +10. **The connection to the multicasted Observable is unsubscribed** + +To achieve that with explicit calls to `connect()`, we write the following code: + +```ts +import { interval, Subject, multicast } from 'rxjs'; + +const source = interval(500); +const subject = new Subject(); +const multicasted = source.pipe(multicast(subject)); +let subscription1, subscription2, subscriptionConnect; + +subscription1 = multicasted.subscribe({ + next: (v) => console.log(`observerA: ${v}`), +}); +// We should call `connect()` here, because the first +// subscriber to `multicasted` is interested in consuming values +subscriptionConnect = multicasted.connect(); + +setTimeout(() => { + subscription2 = multicasted.subscribe({ + next: (v) => console.log(`observerB: ${v}`), + }); +}, 600); + +setTimeout(() => { + subscription1.unsubscribe(); +}, 1200); + +// We should unsubscribe the shared Observable execution here, +// because `multicasted` would have no more subscribers after this +setTimeout(() => { + subscription2.unsubscribe(); + subscriptionConnect.unsubscribe(); // for the shared Observable execution +}, 2000); +``` + +If we wish to avoid explicit calls to `connect()`, we can use ConnectableObservable's `refCount()` method (reference counting), which returns an Observable that keeps track of how many subscribers it has. When the number of subscribers increases from `0` to `1`, it will call `connect()` for us, which starts the shared execution. Only when the number of subscribers decreases from `1` to `0` will it be fully unsubscribed, stopping further execution. + +`refCount` makes the multicasted Observable automatically start executing when the first subscriber arrives, and stop executing when the last subscriber leaves. + +Below is an example: + +```ts +import { interval, Subject, multicast, refCount } from 'rxjs'; + +const source = interval(500); +const subject = new Subject(); +const refCounted = source.pipe(multicast(subject), refCount()); +let subscription1, subscription2; + +// This calls `connect()`, because +// it is the first subscriber to `refCounted` +console.log('observerA subscribed'); +subscription1 = refCounted.subscribe({ + next: (v) => console.log(`observerA: ${v}`), +}); + +setTimeout(() => { + console.log('observerB subscribed'); + subscription2 = refCounted.subscribe({ + next: (v) => console.log(`observerB: ${v}`), + }); +}, 600); + +setTimeout(() => { + console.log('observerA unsubscribed'); + subscription1.unsubscribe(); +}, 1200); + +// This is when the shared Observable execution will stop, because +// `refCounted` would have no more subscribers after this +setTimeout(() => { + console.log('observerB unsubscribed'); + subscription2.unsubscribe(); +}, 2000); + +// Logs +// observerA subscribed +// observerA: 0 +// observerB subscribed +// observerA: 1 +// observerB: 1 +// observerA unsubscribed +// observerB: 2 +// observerB unsubscribed +``` + +The `refCount()` method only exists on ConnectableObservable, and it returns an `Observable`, not another ConnectableObservable. + +## BehaviorSubject + +One of the variants of Subjects is the `BehaviorSubject`, which has a notion of "the current value". It stores the latest value emitted to its consumers, and whenever a new Observer subscribes, it will immediately receive the "current value" from the `BehaviorSubject`. + +BehaviorSubjects are useful for representing "values over time". For instance, an event stream of birthdays is a Subject, but the stream of a person's age would be a BehaviorSubject. + +In the following example, the BehaviorSubject is initialized with the value `0` which the first Observer receives when it subscribes. The second Observer receives the value `2` even though it subscribed after the value `2` was sent. + +```ts +import { BehaviorSubject } from 'rxjs'; +const subject = new BehaviorSubject(0); // 0 is the initial value + +subject.subscribe({ + next: (v) => console.log(`observerA: ${v}`), +}); + +subject.next(1); +subject.next(2); + +subject.subscribe({ + next: (v) => console.log(`observerB: ${v}`), +}); + +subject.next(3); + +// Logs +// observerA: 0 +// observerA: 1 +// observerA: 2 +// observerB: 2 +// observerA: 3 +// observerB: 3 +``` + +## ReplaySubject + +A `ReplaySubject` is similar to a `BehaviorSubject` in that it can send old values to new subscribers, but it can also _record_ a part of the Observable execution. + +A `ReplaySubject` records multiple values from the Observable execution and replays them to new subscribers. + +When creating a `ReplaySubject`, you can specify how many values to replay: + +```ts +import { ReplaySubject } from 'rxjs'; +const subject = new ReplaySubject(3); // buffer 3 values for new subscribers + +subject.subscribe({ + next: (v) => console.log(`observerA: ${v}`), +}); + +subject.next(1); +subject.next(2); +subject.next(3); +subject.next(4); + +subject.subscribe({ + next: (v) => console.log(`observerB: ${v}`), +}); + +subject.next(5); + +// Logs: +// observerA: 1 +// observerA: 2 +// observerA: 3 +// observerA: 4 +// observerB: 2 +// observerB: 3 +// observerB: 4 +// observerA: 5 +// observerB: 5 +``` + +You can also specify a _window time_ in milliseconds, besides of the buffer size, to determine how old the recorded values can be. In the following example we use a large buffer size of `100`, but a window time parameter of just `500` milliseconds. + + + +```ts +import { ReplaySubject } from 'rxjs'; +const subject = new ReplaySubject(100, 500 /* windowTime */); + +subject.subscribe({ + next: (v) => console.log(`observerA: ${v}`), +}); + +let i = 1; +setInterval(() => subject.next(i++), 200); + +setTimeout(() => { + subject.subscribe({ + next: (v) => console.log(`observerB: ${v}`), + }); +}, 1000); + +// Logs +// observerA: 1 +// observerA: 2 +// observerA: 3 +// observerA: 4 +// observerA: 5 +// observerB: 3 +// observerB: 4 +// observerB: 5 +// observerA: 6 +// observerB: 6 +// ... +``` + +## AsyncSubject + +The AsyncSubject is a variant where only the last value of the Observable execution is sent to its observers, and only when the execution completes. + +```js +import { AsyncSubject } from 'rxjs'; +const subject = new AsyncSubject(); + +subject.subscribe({ + next: (v) => console.log(`observerA: ${v}`), +}); + +subject.next(1); +subject.next(2); +subject.next(3); +subject.next(4); + +subject.subscribe({ + next: (v) => console.log(`observerB: ${v}`), +}); + +subject.next(5); +subject.complete(); + +// Logs: +// observerA: 5 +// observerB: 5 +``` + +The AsyncSubject is similar to the [`last()`](/api/operators/last) operator, in that it waits for the `complete` notification in order to deliver a single value. + +## Void subject + +Sometimes the emitted value doesn't matter as much as the fact that a value was emitted. + +For instance, the code below signals that one second has passed. + +```ts +const subject = new Subject(); +setTimeout(() => subject.next('dummy'), 1000); +``` + +Passing a dummy value this way is clumsy and can confuse users. + +By declaring a _void subject_, you signal that the value is irrelevant. Only the event itself matters. + +```ts +const subject = new Subject(); +setTimeout(() => subject.next(), 1000); +``` + +A complete example with context is shown below: + +```ts +import { Subject } from 'rxjs'; + +const subject = new Subject(); // Shorthand for Subject + +subject.subscribe({ + next: () => console.log('One second has passed'), +}); + +setTimeout(() => subject.next(), 1000); +``` + +Before version 7, the default type of Subject values was `any`. `Subject` disables type checking of the emitted values, whereas `Subject` prevents accidental access to the emitted value. If you want the old behavior, then replace `Subject` with `Subject`. diff --git a/apps/rxjs.dev-next/docs/guide/subscription.md b/apps/rxjs.dev-next/docs/guide/subscription.md new file mode 100644 index 0000000000..398ea8207a --- /dev/null +++ b/apps/rxjs.dev-next/docs/guide/subscription.md @@ -0,0 +1,47 @@ +# Subscription + +**What is a Subscription?** A Subscription is an object that represents a disposable resource, usually the execution of an Observable. A Subscription has one important method, `unsubscribe`, that takes no argument and just disposes the resource held by the subscription. In previous versions of RxJS, Subscription was called "Disposable". + +```ts +import { interval } from 'rxjs'; + +const observable = interval(1000); +const subscription = observable.subscribe((x) => console.log(x)); +// Later: +// This cancels the ongoing Observable execution which +// was started by calling subscribe with an Observer. +subscription.unsubscribe(); +``` + +A Subscription essentially just has an `unsubscribe()` function to release resources or cancel Observable executions. + +Subscriptions can also be put together, so that a call to an `unsubscribe()` of one Subscription may unsubscribe multiple Subscriptions. You can do this by "adding" one subscription into another: + +```ts +import { interval } from 'rxjs'; + +const observable1 = interval(400); +const observable2 = interval(300); + +const subscription = observable1.subscribe((x) => console.log('first: ' + x)); +const childSubscription = observable2.subscribe((x) => console.log('second: ' + x)); + +subscription.add(childSubscription); + +setTimeout(() => { + // Unsubscribes BOTH subscription and childSubscription + subscription.unsubscribe(); +}, 1000); +``` + +When executed, we see in the console: + +```plaintext +second: 0 +first: 0 +second: 1 +first: 1 +second: 2 +``` + +Subscriptions also have a `remove(otherSubscription)` method, in order to undo the addition of a child Subscription. diff --git a/apps/rxjs.dev-next/docs/guide/testing/marble-testing.md b/apps/rxjs.dev-next/docs/guide/testing/marble-testing.md new file mode 100644 index 0000000000..14e2fd7632 --- /dev/null +++ b/apps/rxjs.dev-next/docs/guide/testing/marble-testing.md @@ -0,0 +1,292 @@ +# Testing RxJS Code with Marble Diagrams + +:::info +This guide refers to usage of marble diagrams when using the new [`testScheduler.run(callback)`](/api/testing/classes/TestScheduler#run). Some details here do not apply to using the TestScheduler manually, without using the `run()` helper. +::: + +We can test our _asynchronous_ RxJS code _synchronously_ and deterministically by virtualizing time using the TestScheduler. **Marble diagrams** provide a visual way for us to represent the behavior of an Observable. We can use them to assert that a particular Observable behaves as expected, as well as to create [hot and cold Observables](https://medium.com/@benlesh/hot-vs-cold-observables-f8094ed53339) we can use as mocks. + +> At this time, the TestScheduler can only be used to test code that uses RxJS schedulers - `AsyncScheduler`, etc. If the code consumes a Promise, for example, it cannot be reliably tested with `TestScheduler`, but instead should be tested more traditionally. See the [Known Issues](#known-issues) section for more details. + +```ts +import { TestScheduler } from 'rxjs/testing'; +import { throttleTime } from 'rxjs'; + +const testScheduler = new TestScheduler((actual, expected) => { + // asserting the two objects are equal - required + // for TestScheduler assertions to work via your test framework + // e.g. using chai. + expect(actual).deep.equal(expected); +}); + +// This test runs synchronously. +it('generates the stream correctly', () => { + testScheduler.run((helpers) => { + const { cold, time, expectObservable, expectSubscriptions } = helpers; + const e1 = cold(' -a--b--c---|'); + const e1subs = ' ^----------!'; + const t = time(' ---| '); // t = 3 + const expected = '-a-----c---|'; + + expectObservable(e1.pipe(throttleTime(t))).toBe(expected); + expectSubscriptions(e1.subscriptions).toBe(e1subs); + }); +}); +``` + +## API + +The callback function you provide to `testScheduler.run(callback)` is called with `helpers` object that contains functions you'll use to write your tests. + +:::info +When the code inside this callback is being executed, any operator that uses timers/AsyncScheduler (like delay, debounceTime, etc.,) will automatically use the TestScheduler instead, so that we have "virtual time". You do not need to pass the TestScheduler to them, like in the past. +::: + +```ts +testScheduler.run((helpers) => { + const { cold, hot, expectObservable, expectSubscriptions, flush, time, animate } = helpers; + // use them +}); +``` + +Although `run()` executes entirely synchronously, the helper functions inside your callback function do not! These functions **schedule assertions** that will execute either when your callback completes or when you explicitly call `flush()`. Be wary of calling synchronous assertions, for example `expect`, from your testing library of choice, from within the callback. See [Synchronous Assertion](#synchronous-assertion) for more information on how to do this. + +- `cold(marbleDiagram: string, values?: object, error?: any)` - creates a "cold" observable whose subscription starts when the test begins. +- `hot(marbleDiagram: string, values?: object, error?: any)` - creates a "hot" observable (like a subject) that will behave as though it's already "running" when the test begins. An interesting difference is that `hot` marbles allow a `^` character to signal where the "zero frame" is. That is the point at which the subscription to observables being tested begins. +- `expectObservable(actual: Observable, subscriptionMarbles?: string).toBe(marbleDiagram: string, values?: object, error?: any)` - schedules an assertion for when the TestScheduler flushes. Give `subscriptionMarbles` as parameter to change the schedule of subscription and unsubscription. If you don't provide the `subscriptionMarbles` parameter it will subscribe at the beginning and never unsubscribe. Read below about subscription marble diagram. +- `expectSubscriptions(actualSubscriptionLogs: SubscriptionLog[]).toBe(subscriptionMarbles: string)` - like `expectObservable` schedules an assertion for when the testScheduler flushes. Both `cold()` and `hot()` return an observable with a property `subscriptions` of type `SubscriptionLog[]`. Give `subscriptions` as parameter to `expectSubscriptions` to assert whether it matches the `subscriptionsMarbles` marble diagram given in `toBe()`. Subscription marble diagrams are slightly different than Observable marble diagrams. Read more below. +- `flush()` - immediately starts virtual time. Not often used since `run()` will automatically flush for you when your callback returns, but in some cases you may wish to flush more than once or otherwise have more control. +- `time()` - converts marbles into a number indicating number of frames. It can be used by operators expecting a specific timeout. It measures time based on the position of the complete (`|`) signal: + + ```ts + testScheduler.run((helpers) => { + const { time, cold } = helpers; + const source = cold('---a--b--|'); + const t = time(' --| '); + // --| + const expected = ' -----a--b|'; + const result = source.pipe(delay(t)); + expectObservable(result).toBe(expected); + }); + ``` + +- `animate()` - specifies when requested animation frames will be 'painted'. `animate` accepts a marble diagram and each value emission in the diagram indicates when a 'paint' occurs - at which time, any queued `requestAnimationFrame` callbacks will be executed. Call `animate` at the beginning of your test and align the marble diagrams so that it's clear when the callbacks will be executed: + + ```ts + testScheduler.run((helpers) => { + const { animate, cold } = helpers; + animate(' ---x---x---x---x'); + const requests = cold('-r-------r------'); + /* ... */ + const expected = ' ---a-------b----'; + }); + ``` + +## Marble syntax + +In the context of TestScheduler, a marble diagram is a string containing special syntax representing events happening over virtual time. Time progresses by _frames_. The first character of any marble string always represents the _zero frame_, or the start of time. Inside of `testScheduler.run(callback)` the frameTimeFactor is set to 1, which means one frame is equal to one virtual millisecond. + +How many virtual milliseconds one frame represents depends on the value of `TestScheduler.frameTimeFactor`. For legacy reasons the value of `frameTimeFactor` is 1 _only_ when your code inside the `testScheduler.run(callback)` callback is running. Outside of it, it's set to 10. This will likely change in a future version of RxJS so that it is always 1. + +> IMPORTANT: This syntax guide refers to usage of marble diagrams when using the new `testScheduler.run(callback)`. The semantics of marble diagrams when using the TestScheduler manually are different, and some features like the new time progression syntax are not supported. + +- `' '` whitespace: horizontal whitespace is ignored, and can be used to help vertically align multiple marble diagrams. +- `'-'` frame: 1 "frame" of virtual time passing (see above description of frames). +- `[0-9]+[ms|s|m]` time progression: the time progression syntax lets you progress virtual time by a specific amount. It's a number, followed by a time unit of `ms` (milliseconds), `s` (seconds), or `m` (minutes) without any space between them, e.g. `a 10ms b`. See [Time progression syntax](#time-progression-syntax) for more details. +- `'|'` complete: The successful completion of an observable. This is the observable producer signaling `complete()`. +- `'#'` error: An error terminating the observable. This is the observable producer signaling `error()`. +- `[a-z0-9]` e.g. `'a'` any alphanumeric character: Represents a value being emitted by the producer signaling `next()`. Also consider that you could map this into an object or an array like this: + + + ```ts + const expected = '400ms (a-b|)'; + const values = { + a: 'value emitted', + b: 'another value emitted', + }; + + expectObservable(someStreamForTesting).toBe(expected, values); + + // This would work also + const expected = '400ms (0-1|)'; + const values = [ + 'value emitted', + 'another value emitted' + ]; + + expectObservable(someStreamForTesting).toBe(expected, values); + ``` + +- `'()'` sync groupings: When multiple events need to be in the same frame synchronously, parentheses are used to group those events. You can group next'd values, a completion, or an error in this manner. The position of the initial `(` determines the time at which its values are emitted. While it can be counter-intuitive at first, after all the values have synchronously emitted time will progress a number of frames equal to the number of ASCII characters in the group, including the parentheses. e.g. `'(abc)'` will emit the values of a, b, and c synchronously in the same frame and then advance virtual time by 5 frames, `'(abc)'.length === 5`. This is done because it often helps you vertically align your marble diagrams, but it's a known pain point in real-world testing. [Learn more about known issues](#known-issues). +- `'^'` subscription point: (hot observables only) shows the point at which the tested observables will be subscribed to the hot observable. This is the "zero frame" for that observable, every frame before the `^` will be negative. Negative time might seem pointless, but there are in fact advanced cases where this is necessary, usually involving ReplaySubjects. + +### Time progression syntax + +The new time progression syntax takes inspiration from the CSS duration syntax. It's a number (integer or floating point) immediately followed by a unit; ms (milliseconds), s (seconds), m (minutes). e.g. `100ms`, `1.4s`, `5.25m`. + +When it's not the first character of the diagram it must be padded a space before/after to disambiguate it from a series of marbles. e.g. `a 1ms b` needs the spaces because `a1msb` will be interpreted as `['a', '1', 'm', 's', 'b']` where each of these characters is a value that will be next()'d as-is. + +**NOTE**: You may have to subtract 1 millisecond from the time you want to progress because the alphanumeric marbles (representing an actual emitted value) _advance time 1 virtual frame_ themselves already, after they emit. This can be counter-intuitive and frustrating, but for now it is indeed correct. + + +```ts +const input = ' -a-b-c|'; +const expected = '-- 9ms a 9ms b 9ms (c|)'; + +// Depending on your personal preferences you could also +// use frame dashes to keep vertical alignment with the input. +// const input = ' -a-b-c|'; +// const expected = '------- 4ms a 9ms b 9ms (c|)'; +// or +// const expected = '-----------a 9ms b 9ms (c|)'; + +const result = cold(input).pipe( + concatMap((d) => of(d).pipe( + delay(10) + )) +); + +expectObservable(result).toBe(expected); +``` + +### Examples + +`'-'` or `'------'`: Equivalent to [`NEVER`](/api/functions/NEVER), or an observable that never emits or errors or completes. + +`|`: Equivalent to [`EMPTY`](/api/functions/EMPTY), or an observable that never emits and completes immediately. + +`#`: Equivalent to [`throwError`](/api/functions/throwError), or an observable that never emits and errors immediately. + +`'--a--'`: An observable that waits 2 "frames", emits value `a` on frame 2 and then never completes. + +`'--a--b--|'`: On frame 2 emit `a`, on frame 5 emit `b`, and on frame 8, `complete`. + +`'--a--b--#'`: On frame 2 emit `a`, on frame 5 emit `b`, and on frame 8, `error`. + +`'-a-^-b--|'`: In a hot observable, on frame -2 emit `a`, then on frame 2 emit `b`, and on frame 5, `complete`. + +`'--(abc)-|'`: on frame 2 emit `a`, `b`, and `c`, then on frame 8, `complete`. + +`'-----(a|)'`: on frame 5 emit `a` and `complete`. + +`'a 9ms b 9s c|'`: on frame 0 emit `a`, on frame 10 emit `b`, on frame 9,011 emit `c`, then on frame 9,012 `complete`. + +`'--a 2.5m b'`: on frame 2 emit `a`, on frame 150,003 emit `b` and never complete. + +## Subscription marbles + +The `expectSubscriptions` helper allows you to assert that a `cold()` or `hot()` Observable you created was subscribed/unsubscribed to at the correct point in time. The `subscriptionMarbles` parameter to `expectObservable` allows your test to defer subscription to a later virtual time, and/or unsubscribe even if the observable being tested has not yet completed. + +The subscription marble syntax is slightly different to conventional marble syntax. + +- `'-'` time: 1 frame time passing. +- `[0-9]+[ms|s|m]` time progression: the time progression syntax lets you progress virtual time by a specific amount. It's a number, followed by a time unit of `ms` (milliseconds), `s` (seconds), or `m` (minutes) without any space between them, e.g. `a 10ms b`. See [Time progression syntax](#time-progression-syntax) for more details. +- `'^'` subscription point: shows the point in time at which a subscription happens. +- `'!'` unsubscription point: shows the point in time at which a subscription is unsubscribed. + +There should be **at most one** `^` point in a subscription marble diagram, and **at most one** `!` point. Other than that, the `-` character is the only one allowed in a subscription marble diagram. + +### Examples + +`'-'` or `'------'`: no subscription ever happened. + +`'--^--'`: a subscription happened after 2 "frames" of time passed, and the subscription was not unsubscribed. + +`'--^--!-'`: on frame 2 a subscription happened, and on frame 5 was unsubscribed. + +`'500ms ^ 1s !'`: on frame 500 a subscription happened, and on frame 1,501 was unsubscribed. + +Given a hot source, test multiple subscribers that subscribe at different times: + +```ts +testScheduler.run(({ hot, expectObservable }) => { + const source = hot('--a--a--a--a--a--a--a--'); + const sub1 = ' --^-----------!'; + const sub2 = ' ---------^--------!'; + const expect1 = ' --a--a--a--a--'; + const expect2 = ' -----------a--a--a-'; + + expectObservable(source, sub1).toBe(expect1); + expectObservable(source, sub2).toBe(expect2); +}); +``` + +Manually unsubscribe from a source that will never complete: + +```ts +it('should repeat forever', () => { + const testScheduler = createScheduler(); + + testScheduler.run(({ expectObservable }) => { + const foreverStream$ = interval(1).pipe(mapTo('a')); + + // Omitting this arg may crash the test suite. + const unsub = '------!'; + + expectObservable(foreverStream$, unsub).toBe('-aaaaa'); + }); +}); +``` + +## Synchronous Assertion + +Sometimes, we need to assert changes in state _after_ an observable stream has completed - such as when a side effect like `tap` updates a variable. Outside of Marbles testing with TestScheduler, we might think of this as creating a delay or waiting before making our assertion. + +For example: + +```ts +let eventCount = 0; + +const s1 = cold('--a--b|', { a: 'x', b: 'y' }); + +// side effect using 'tap' updates a variable +const result = s1.pipe(tap(() => eventCount++)); + +expectObservable(result).toBe('--a--b|', { a: 'x', b: 'y' }); + +// flush - run 'virtual time' to complete all outstanding hot or cold observables +flush(); + +expect(eventCount).toBe(2); +``` + +In the above situation we need the observable stream to complete so that we can test the variable was set to the correct value. The TestScheduler runs in 'virtual time' (synchronously), but doesn't normally run (and complete) until the testScheduler callback returns. The flush() method manually triggers the virtual time so that we can test the local variable after the observable completes. + +--- + +## Known issues + +### RxJS code that consumes Promises cannot be directly tested + +If you have RxJS code that uses asynchronous scheduling - e.g. Promises, etc. - you can't reliably use marble diagrams _for that particular code_. This is because those other scheduling methods won't be virtualized or known to TestScheduler. + +The solution is to test that code in isolation, with the traditional asynchronous testing methods of your testing framework. The specifics depend on your testing framework of choice, but here's a pseudo-code example: + +```ts +// Some RxJS code that also consumes a Promise, so TestScheduler won't be able +// to correctly virtualize and the test will always be really asynchronous. +const myAsyncCode = () => from(Promise.resolve('something')); + +it('has async code', (done) => { + myAsyncCode().subscribe((d) => { + assertEqual(d, 'something'); + done(); + }); +}); +``` + +On a related note, you also can't currently assert delays of zero, even with `AsyncScheduler`, e.g. `delay(0)` is like saying `setTimeout(work, 0)`. This schedules a new ["task" aka "macrotask"](https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/), so it's asynchronous, but without an explicit passage of time. + +### Behavior is different outside of `testScheduler.run(callback)` + +The `TestScheduler` has been around since v5, but was actually intended for testing RxJS itself by the maintainers, rather than for use in regular user apps. Because of this, some of the default behaviors and features of the TestScheduler did not work well (or at all) for users. In v6 we introduced the `testScheduler.run(callback)` method which allowed us to provide new defaults and features in a non-breaking way, but it's still possible to [use the TestScheduler outside](https://github.com/ReactiveX/rxjs/blob/7113ae4b451dd8463fae71b68edab96079d089df/docs_app/content/guide/testing/internal-marble-tests.md) of `testScheduler.run(callback)`. It's important to note that if you do so, there are some major differences in how it will behave. + +- `TestScheduler` helper methods have more verbose names, like `testScheduler.createColdObservable()` instead of `cold()`. +- The testScheduler instance is _not_ automatically used by operators that use `AsyncScheduler`, e.g. `delay`, `debounceTime`, etc., so you have to explicitly pass it to them. +- There is NO support for time progression syntax e.g. `-a 100ms b-|`. +- 1 frame is 10 virtual milliseconds by default. i.e. `TestScheduler.frameTimeFactor = 10`. +- Each whitespace `' '` equals 1 frame, same as a hyphen `'-'`. +- There is a hard maximum number of frames set at 750 i.e. `maxFrames = 750`. After 750 they are silently ignored. +- You must explicitly flush the scheduler. + +While at this time usage of the TestScheduler outside of `testScheduler.run(callback)` has not been officially deprecated, it is discouraged because it is likely to cause confusion. diff --git a/apps/rxjs.dev-next/docs/index.md b/apps/rxjs.dev-next/docs/index.md new file mode 100644 index 0000000000..e2e476aa59 --- /dev/null +++ b/apps/rxjs.dev-next/docs/index.md @@ -0,0 +1,36 @@ +--- +layout: home + +hero: + name: 'RxJS' + text: 'Reactive Extensions Library for JavaScript' + image: + src: /Rx_Logo-512-512.png + alt: RxJS logo + actions: + - theme: brand + text: Get Started + link: /guide/overview + - theme: alt + text: API Docs + link: /api +--- + +## Version 7 Released! + +Here are some of the benefits of running on the latest version: + +- ~50% smaller +- Improved typings +- More consistent APIs +- and much more... + +[Learn more about the breaking changes →](/deprecations/breaking-changes) + +## Reactive Extensions Library for JavaScript + +RxJS is a library for reactive programming using Observables, to make it easier to compose asynchronous or callback-based code. This project is a rewrite of Reactive-Extensions/RxJS with better performance, better modularity, better debuggable call stacks, while staying mostly backwards compatible, with some breaking changes that reduce the API surface. + +## Code of Conduct + +When participating in our community, you must follow our [Code of Conduct](/code-of-conduct). diff --git a/apps/rxjs.dev-next/docs/license.md b/apps/rxjs.dev-next/docs/license.md new file mode 100644 index 0000000000..12023baa47 --- /dev/null +++ b/apps/rxjs.dev-next/docs/license.md @@ -0,0 +1,23 @@ +@title +@description +The MIT License + +Copyright (c) 2014-2018 Google, Inc., RxJS Team Members and Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/apps/rxjs.dev-next/docs/maintainer-guidelines.md b/apps/rxjs.dev-next/docs/maintainer-guidelines.md new file mode 100644 index 0000000000..51a8d82490 --- /dev/null +++ b/apps/rxjs.dev-next/docs/maintainer-guidelines.md @@ -0,0 +1,35 @@ +# Maintainer Guidelines + +These are guidelines for maintainers of this repository as (mostly) [gifted to us by](https://github.com/ReactiveX/RxJS/issues/121#issue-97747542) +His Beardliness, @jeffbcross. They are words to live by for those that are tasked with reviewing and merging pull requests and otherwise +shepherding the community. As the roster of trusted maintainers grows, we'll expect these guidelines to stay pretty +much the same (but suggestions are always welcome). + +### The ~~10~~ 6 Commandments + +- **[Code of Conduct](../../../CODE_OF_CONDUCT.md)**. We should be setting a good example and be welcoming to all. We should be listening + to all feedback from everyone in our community and respect their viewpoints and opinions. +- **Be sure PRs meet [Contribution Guidelines](../../../CONTRIBUTING.md)**. It's important we keep our code base + and repository consistent. The best way to do this is to know and enforce the contribution guidelines. +- **Clean, flat commit history**. We never click the green merge button on PRs, but instead we pull down + the PR branch and rebase it against master then replace master with the PR branch. See + [example gist](https://gist.github.com/jeffbcross/307c6da45d26e29030ef). This reduces noise in the commit + history, removing all of the merge commits, and keeps history flat. The flat history is beneficial + to tools/scripts that analyze commit ancestry. +- **Always green master**. Failing master builds tend to cascade into other broken builds, and + frustration among other contributors who have rebased against a broken master. Much of our deployment + and other infrastructure is based on the assumption that master is always green, nothing should be + merged before Travis has confirmed that a PR is green, even for seemingly insignificant changes. + Nothing should be merged into a red master, and whomever broke it should drop everything and fix it + right away. Fixes should be submitted as a PR and verified as green instead of immediately merging + to master. +- **No force pushes to master**. Only in rare circumstances should a force push to master be made, + and other maintainers should be notified beforehand. The most common situation for a justified force + push is when a commit has been pushed with an invalid message. The force push should be made as soon + as possible to reduce side effects. +- **Small, logical commits**. A PR should be focused on a single problem, though that problem may be + reasonable to be broken into a few logical commits. For example, a global renaming may be best to be + broken into a single commit that renames all files, and then a commit that renames symbols within files. + This makes the review process simpler easier, so the diff of the meaty commit (where symbols are + renamed) can be easily understood than if both were done in the same commit, in which case github would + just show a deleted file and an added file. diff --git a/apps/rxjs.dev-next/docs/public/Rx_Logo-512-512.png b/apps/rxjs.dev-next/docs/public/Rx_Logo-512-512.png new file mode 100644 index 0000000000..675907962c Binary files /dev/null and b/apps/rxjs.dev-next/docs/public/Rx_Logo-512-512.png differ diff --git a/apps/rxjs.dev-next/docs/public/images/favicons/apple-touch-icon.png b/apps/rxjs.dev-next/docs/public/images/favicons/apple-touch-icon.png new file mode 100644 index 0000000000..517d001a8e Binary files /dev/null and b/apps/rxjs.dev-next/docs/public/images/favicons/apple-touch-icon.png differ diff --git a/apps/rxjs.dev-next/docs/public/images/favicons/favicon-96x96.png b/apps/rxjs.dev-next/docs/public/images/favicons/favicon-96x96.png new file mode 100644 index 0000000000..aeb275d9ae Binary files /dev/null and b/apps/rxjs.dev-next/docs/public/images/favicons/favicon-96x96.png differ diff --git a/apps/rxjs.dev-next/docs/public/images/favicons/favicon.ico b/apps/rxjs.dev-next/docs/public/images/favicons/favicon.ico new file mode 100644 index 0000000000..99d51f48a7 Binary files /dev/null and b/apps/rxjs.dev-next/docs/public/images/favicons/favicon.ico differ diff --git a/apps/rxjs.dev-next/docs/public/images/favicons/favicon.svg b/apps/rxjs.dev-next/docs/public/images/favicons/favicon.svg new file mode 100644 index 0000000000..3784e51584 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/favicons/favicon.svg @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/apps/rxjs.dev-next/docs/public/images/favicons/web-app-manifest-192x192.png b/apps/rxjs.dev-next/docs/public/images/favicons/web-app-manifest-192x192.png new file mode 100644 index 0000000000..3c7162cd3f Binary files /dev/null and b/apps/rxjs.dev-next/docs/public/images/favicons/web-app-manifest-192x192.png differ diff --git a/apps/rxjs.dev-next/docs/public/images/favicons/web-app-manifest-512x512.png b/apps/rxjs.dev-next/docs/public/images/favicons/web-app-manifest-512x512.png new file mode 100644 index 0000000000..dadba27faa Binary files /dev/null and b/apps/rxjs.dev-next/docs/public/images/favicons/web-app-manifest-512x512.png differ diff --git a/apps/rxjs.dev-next/docs/public/images/guide/marble-diagram-anatomy.svg b/apps/rxjs.dev-next/docs/public/images/guide/marble-diagram-anatomy.svg new file mode 100644 index 0000000000..c144f6f037 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/guide/marble-diagram-anatomy.svg @@ -0,0 +1 @@ +marble-diagram-anatomymultiplyByTen406046a8This is time flowing from left to right to represent the execution of the input Observable.These are values emitted by the Observable.This vertical line represents the "complete" notification and indicates that the Observable has completed successfully.This box indicates the operator which takes the input Observable (above) to produce the output Observable (below). The text inside the box shows the nature of the transformation.This Observable is the output of the operator call.This X represents an error emitted by the output Observable, indicating abnormal termination. Neither values nor the vertical will be delivered thereafter. \ No newline at end of file diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/audit-dark.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/audit-dark.svg new file mode 100644 index 0000000000..9ea22280ff --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/audit-dark.svg @@ -0,0 +1,6 @@ + +zyxcxbyxaiiiaudit()zxy \ No newline at end of file diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/audit-light.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/audit-light.svg new file mode 100644 index 0000000000..ed233a305d --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/audit-light.svg @@ -0,0 +1 @@ +zyxcxbyxaiiiaudit()zxy \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/auditTime.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/auditTime.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/auditTime.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/auditTime.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/buffer.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/buffer.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/buffer.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/buffer.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/bufferCount.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/bufferCount.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/bufferCount.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/bufferCount.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/bufferTime.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/bufferTime.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/bufferTime.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/bufferTime.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/bufferToggle.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/bufferToggle.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/bufferToggle.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/bufferToggle.png diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/bufferWhen-dark.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/bufferWhen-dark.svg new file mode 100644 index 0000000000..9b53e3e66c --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/bufferWhen-dark.svg @@ -0,0 +1,6 @@ + +hgfedcbasbufferWhen()[g, h][d, e, f][a, b, c] \ No newline at end of file diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/bufferWhen-light.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/bufferWhen-light.svg new file mode 100644 index 0000000000..831dd8c8f0 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/bufferWhen-light.svg @@ -0,0 +1 @@ +hgfedcbasbufferWhen()[g, h][d, e, f][a, b, c] \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/catch.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/catch.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/catch.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/catch.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/combineAll.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/combineAll.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/combineAll.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/combineAll.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/combineLatest.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/combineLatest.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/combineLatest.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/combineLatest.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/concat.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/concat.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/concat.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/concat.png diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/concatAll-dark.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/concatAll-dark.svg new file mode 100644 index 0000000000..2fd6e6bd48 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/concatAll-dark.svg @@ -0,0 +1,6 @@ + +fedcbaconcatAllfedcba \ No newline at end of file diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/concatAll-light.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/concatAll-light.svg new file mode 100644 index 0000000000..dc95e8de76 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/concatAll-light.svg @@ -0,0 +1 @@ +fedcbaconcatAllfedcba \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/concatAll.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/concatAll.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/concatAll.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/concatAll.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/concatMap.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/concatMap.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/concatMap.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/concatMap.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/concatMapTo.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/concatMapTo.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/concatMapTo.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/concatMapTo.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/count.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/count.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/count.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/count.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/create.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/create.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/create.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/create.png diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/debounce-dark.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/debounce-dark.svg new file mode 100644 index 0000000000..e5a132c4a7 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/debounce-dark.svg @@ -0,0 +1,6 @@ + +fedcbaxxxdebounce()fca \ No newline at end of file diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/debounce-light.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/debounce-light.svg new file mode 100644 index 0000000000..7b085100d3 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/debounce-light.svg @@ -0,0 +1 @@ +fedcbaxxxdebounce()fca \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/debounceTime.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/debounceTime.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/debounceTime.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/debounceTime.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/defaultIfEmpty.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/defaultIfEmpty.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/defaultIfEmpty.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/defaultIfEmpty.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/defer.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/defer.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/defer.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/defer.png diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/delay-dark.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/delay-dark.svg new file mode 100644 index 0000000000..75ec74aace --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/delay-dark.svg @@ -0,0 +1,6 @@ + +cbadelay(20)cba \ No newline at end of file diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/delay-light.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/delay-light.svg new file mode 100644 index 0000000000..c8438f8cc8 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/delay-light.svg @@ -0,0 +1 @@ +cbadelay(20)cba \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/delayWhen.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/delayWhen.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/delayWhen.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/delayWhen.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/dematerialize.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/dematerialize.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/dematerialize.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/dematerialize.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/distinctUntilChanged.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/distinctUntilChanged.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/distinctUntilChanged.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/distinctUntilChanged.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/distinctUntilKeyChanged.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/distinctUntilKeyChanged.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/distinctUntilKeyChanged.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/distinctUntilKeyChanged.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/elementAt.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/elementAt.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/elementAt.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/elementAt.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/empty.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/empty.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/empty.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/empty.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/endWith.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/endWith.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/endWith.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/endWith.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/every.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/every.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/every.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/every.png diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/exhaustAll-dark.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/exhaustAll-dark.svg new file mode 100644 index 0000000000..7b3d000bab --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/exhaustAll-dark.svg @@ -0,0 +1,6 @@ + +ihgfedcbaexhaustAllihgcba \ No newline at end of file diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/exhaustAll-light.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/exhaustAll-light.svg new file mode 100644 index 0000000000..925f9d9ec7 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/exhaustAll-light.svg @@ -0,0 +1 @@ +ihgfedcbaexhaustAllihgcba \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/exhaustMap.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/exhaustMap.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/exhaustMap.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/exhaustMap.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/expand.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/expand.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/expand.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/expand.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/filter.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/filter.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/filter.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/filter.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/find.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/find.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/find.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/find.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/findIndex.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/findIndex.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/findIndex.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/findIndex.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/first.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/first.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/first.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/first.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/forkJoin.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/forkJoin.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/forkJoin.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/forkJoin.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/from.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/from.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/from.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/from.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/fromEvent.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/fromEvent.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/fromEvent.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/fromEvent.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/fromEventPattern.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/fromEventPattern.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/fromEventPattern.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/fromEventPattern.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/generate.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/generate.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/generate.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/generate.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/groupBy.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/groupBy.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/groupBy.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/groupBy.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/ignoreElements.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/ignoreElements.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/ignoreElements.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/ignoreElements.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/interval.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/interval.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/interval.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/interval.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/isEmpty.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/isEmpty.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/isEmpty.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/isEmpty.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/last.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/last.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/last.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/last.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/map.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/map.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/map.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/map.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/mapTo.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/mapTo.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/mapTo.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/mapTo.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/materialize.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/materialize.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/materialize.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/materialize.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/max.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/max.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/max.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/max.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/merge.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/merge.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/merge.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/merge.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/mergeAll.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/mergeAll.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/mergeAll.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/mergeAll.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/mergeMap.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/mergeMap.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/mergeMap.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/mergeMap.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/mergeMapTo.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/mergeMapTo.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/mergeMapTo.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/mergeMapTo.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/min.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/min.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/min.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/min.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/never.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/never.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/never.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/never.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/observeOn.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/observeOn.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/observeOn.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/observeOn.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/of.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/of.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/of.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/of.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/onErrorResumeNext.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/onErrorResumeNext.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/onErrorResumeNext.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/onErrorResumeNext.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/pairwise.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/pairwise.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/pairwise.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/pairwise.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/partition.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/partition.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/partition.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/partition.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/race.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/race.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/race.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/race.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/range.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/range.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/range.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/range.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/reduce.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/reduce.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/reduce.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/reduce.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/repeat.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/repeat.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/repeat.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/repeat.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/repeatWhen.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/repeatWhen.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/repeatWhen.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/repeatWhen.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/retry.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/retry.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/retry.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/retry.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/retryWhen.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/retryWhen.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/retryWhen.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/retryWhen.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/sample.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/sample.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/sample.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/sample.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/sampleTime.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/sampleTime.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/sampleTime.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/sampleTime.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/scan.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/scan.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/scan.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/scan.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/sequenceEqual.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/sequenceEqual.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/sequenceEqual.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/sequenceEqual.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/share.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/share.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/share.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/share.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/single.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/single.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/single.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/single.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/skip.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/skip.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/skip.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/skip.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/skipLast.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/skipLast.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/skipLast.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/skipLast.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/skipUntil.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/skipUntil.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/skipUntil.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/skipUntil.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/skipWhile.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/skipWhile.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/skipWhile.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/skipWhile.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/startWith.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/startWith.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/startWith.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/startWith.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/subscribeOn.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/subscribeOn.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/subscribeOn.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/subscribeOn.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/switchAll.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/switchAll.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/switchAll.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/switchAll.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/switchMap.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/switchMap.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/switchMap.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/switchMap.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/switchMapTo.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/switchMapTo.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/switchMapTo.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/switchMapTo.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/take.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/take.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/take.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/take.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/takeLast.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/takeLast.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/takeLast.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/takeLast.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/takeUntil.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/takeUntil.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/takeUntil.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/takeUntil.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/takeWhile.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/takeWhile.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/takeWhile.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/takeWhile.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/tap.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/tap.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/tap.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/tap.png diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/throttle-dark.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/throttle-dark.svg new file mode 100644 index 0000000000..3aab2e1791 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/throttle-dark.svg @@ -0,0 +1,6 @@ + +zyxcxbyxaiiithrottle()cba \ No newline at end of file diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/throttle-light.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/throttle-light.svg new file mode 100644 index 0000000000..4dc6bf9bc0 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/throttle-light.svg @@ -0,0 +1 @@ +zyxcxbyxaiiithrottle()cba \ No newline at end of file diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/throttle.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/throttle.svg new file mode 100644 index 0000000000..ee87c53947 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/throttle.svg @@ -0,0 +1 @@ +zyxcxbyxaiiithrottle()cba \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/throttleTime.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/throttleTime.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/throttleTime.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/throttleTime.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/throw.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/throw.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/throw.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/throw.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/throwIfEmpty.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/throwIfEmpty.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/throwIfEmpty.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/throwIfEmpty.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/timeInterval.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/timeInterval.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/timeInterval.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/timeInterval.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/timeout.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/timeout.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/timeout.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/timeout.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/timeoutWith.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/timeoutWith.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/timeoutWith.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/timeoutWith.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/timer.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/timer.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/timer.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/timer.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/timestamp.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/timestamp.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/timestamp.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/timestamp.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/toArray.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/toArray.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/toArray.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/toArray.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/window.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/window.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/window.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/window.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/windowCount.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowCount.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/windowCount.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowCount.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/windowTime.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowTime.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/windowTime.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowTime.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/windowToggle.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowToggle.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/windowToggle.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowToggle.png diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowWhen-dark.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowWhen-dark.svg new file mode 100644 index 0000000000..42bf826ce4 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowWhen-dark.svg @@ -0,0 +1,6 @@ + +hgfedcbaxwindowWhen()hggfedcba \ No newline at end of file diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowWhen-light.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowWhen-light.svg new file mode 100644 index 0000000000..d0b88b867b --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowWhen-light.svg @@ -0,0 +1 @@ +hgfedcbaxwindowWhen()hggfedcba \ No newline at end of file diff --git a/apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowWhen.svg b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowWhen.svg new file mode 100644 index 0000000000..a711d5b14f --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/windowWhen.svg @@ -0,0 +1 @@ +hgfedcbaxwindowWhen()hggfedcba \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/withLatestFrom.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/withLatestFrom.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/withLatestFrom.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/withLatestFrom.png diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/zipAll.png b/apps/rxjs.dev-next/docs/public/images/marble-diagrams/zipAll.png similarity index 100% rename from apps/rxjs.dev/src/assets/images/marble-diagrams/zipAll.png rename to apps/rxjs.dev-next/docs/public/images/marble-diagrams/zipAll.png diff --git a/apps/rxjs.dev-next/docs/public/images/marketing/home/Rx_Logo-512-512.png b/apps/rxjs.dev-next/docs/public/images/marketing/home/Rx_Logo-512-512.png new file mode 100644 index 0000000000..09e0e7369d Binary files /dev/null and b/apps/rxjs.dev-next/docs/public/images/marketing/home/Rx_Logo-512-512.png differ diff --git a/apps/rxjs.dev-next/docs/public/images/marketing/home/rxjs-live-london.svg b/apps/rxjs.dev-next/docs/public/images/marketing/home/rxjs-live-london.svg new file mode 100644 index 0000000000..bf393b77c9 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marketing/home/rxjs-live-london.svg @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + LONDON + + diff --git a/apps/rxjs.dev-next/docs/public/images/marketing/home/rxjs-live.svg b/apps/rxjs.dev-next/docs/public/images/marketing/home/rxjs-live.svg new file mode 100644 index 0000000000..2756a0e6c3 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/images/marketing/home/rxjs-live.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/rxjs.dev-next/docs/public/images/support/rxjs-404.png b/apps/rxjs.dev-next/docs/public/images/support/rxjs-404.png new file mode 100644 index 0000000000..956f31912a Binary files /dev/null and b/apps/rxjs.dev-next/docs/public/images/support/rxjs-404.png differ diff --git a/apps/rxjs.dev-next/docs/public/site.webmanifest b/apps/rxjs.dev-next/docs/public/site.webmanifest new file mode 100644 index 0000000000..c8f190d540 --- /dev/null +++ b/apps/rxjs.dev-next/docs/public/site.webmanifest @@ -0,0 +1,21 @@ +{ + "name": "RxJS Documentation", + "short_name": "RxJS", + "icons": [ + { + "src": "/images/web-app-manifest-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "/images/web-app-manifest-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/apps/rxjs.dev-next/docs/team.md b/apps/rxjs.dev-next/docs/team.md new file mode 100644 index 0000000000..0118def1b1 --- /dev/null +++ b/apps/rxjs.dev-next/docs/team.md @@ -0,0 +1,244 @@ +--- +layout: page +--- + + + + + + + + + + + + + + diff --git a/apps/rxjs.dev-next/package.json b/apps/rxjs.dev-next/package.json new file mode 100644 index 0000000000..13802a8941 --- /dev/null +++ b/apps/rxjs.dev-next/package.json @@ -0,0 +1,34 @@ +{ + "name": "rxjs-dev-next", + "version": "0.0.1", + "private": true, + "type": "module", + "scripts": { + "marbles:generate": "tsx tools/marbles/generate-diagrams.ts", + "preapi:generate": "npm run marbles:generate", + "api:generate": "typedoc && tsx tools/api-generator/index.ts", + "dev": "npm run api:generate && vitepress dev", + "build": "npm run api:generate && vitepress build", + "preview": "vitepress preview" + }, + "devDependencies": { + "@tailwindcss/cli": "^4.1.18", + "@swirly/parser": "^0.18.1", + "@swirly/renderer-node": "^0.18.2", + "@swirly/types": "^0.18.1", + "tailwindcss": "^4.0.0", + "postcss": "^8.5.3", + "autoprefixer": "^10.4.20", + "@tailwindcss/postcss": "^4.1.18", + "@nuxt/ui": "^4.3.0", + "typedoc": "^0.28.15", + "typedoc-vitepress-theme": "^1.1.2", + "typedoc-plugin-markdown": "^4.9.0", + "typedoc-plugin-default-groups": "^1.0.2", + "tsx": "^4.7.0", + "shiki": "^1.0.0", + "svgo": "^3.0.0", + "@vueuse/core": "^14.1.0", + "vitepress": "^1.6.4" + } +} diff --git a/apps/rxjs.dev-next/postcss.config.mjs b/apps/rxjs.dev-next/postcss.config.mjs new file mode 100644 index 0000000000..9463996dfd --- /dev/null +++ b/apps/rxjs.dev-next/postcss.config.mjs @@ -0,0 +1,7 @@ +// postcss.config.js (ESM, since "type": "module") +export default { + plugins: { + '@tailwindcss/postcss': {}, + autoprefixer: {}, + }, +} diff --git a/apps/rxjs.dev-next/tailwind.config.mjs b/apps/rxjs.dev-next/tailwind.config.mjs new file mode 100644 index 0000000000..bf6e2cae41 --- /dev/null +++ b/apps/rxjs.dev-next/tailwind.config.mjs @@ -0,0 +1,19 @@ +import { fileURLToPath } from 'node:url' +import { dirname, join } from 'node:path' + +const __dirname = dirname(fileURLToPath(import.meta.url)) + +/** @type {import('tailwindcss').Config} */ +export default { + // content: [ + // './**/*.{js,ts,vue,md,mdx}', + // join(__dirname, '../../node_modules/@nuxt/ui/**/*.{js,ts,vue,md,mdx}'), + // ], + theme: { + extend: {}, + }, + corePlugins: { + preflight: false, + }, + plugins: [], +} diff --git a/apps/rxjs.dev-next/tools/api-generator/index.ts b/apps/rxjs.dev-next/tools/api-generator/index.ts new file mode 100644 index 0000000000..6cab6e6523 --- /dev/null +++ b/apps/rxjs.dev-next/tools/api-generator/index.ts @@ -0,0 +1,22 @@ +import { execSync } from 'child_process'; +import { dirname, resolve } from 'path'; +import { writeFileSync } from 'fs'; +import { fileURLToPath } from 'url'; +import sidebar from '../../docs/api/typedoc-sidebar.json'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +// Get the absolute path of the pages directory relative to this file +const pagesDir = resolve(__dirname, 'pages'); +const docsDir = resolve(__dirname, '../../docs/api'); + +// Recursively copy all files from pagesDir to docsDir +execSync(`cp -R ${pagesDir}/. ${docsDir}/`); + +const newSidebar = [{ text: 'API Explorer', link: '/api#explorer' }, ...sidebar]; + +writeFileSync( + resolve(docsDir, 'typedoc-sidebar.json'), + JSON.stringify(newSidebar, null, 2), +); diff --git a/apps/rxjs.dev-next/tools/api-generator/pages/index.md b/apps/rxjs.dev-next/tools/api-generator/pages/index.md new file mode 100644 index 0000000000..faaffaa48f --- /dev/null +++ b/apps/rxjs.dev-next/tools/api-generator/pages/index.md @@ -0,0 +1,83 @@ + + +# RxJS API Explorer + +## All Modules + +- [@rxjs/observable](@rxjs/observable/index.md) +- [ajax](ajax/index.md) +- [fetch](fetch/index.md) +- [operators](operators/index.md) +- [rxjs](rxjs/index.md) +- [testing](testing/index.md) +- [webSocket](webSocket/index.md) + +## Explorer + + + +### RxJS (index) + + + +### @rxjs/observable + + + +### Ajax + + + +### Fetch + + + +### Operators + + + +### Testing + + + +### Web Socket + + diff --git a/apps/rxjs.dev-next/tools/api-generator/typedoc-plugin-rxjs.mjs b/apps/rxjs.dev-next/tools/api-generator/typedoc-plugin-rxjs.mjs new file mode 100644 index 0000000000..687daff3a4 --- /dev/null +++ b/apps/rxjs.dev-next/tools/api-generator/typedoc-plugin-rxjs.mjs @@ -0,0 +1,550 @@ +// @ts-check +import { ReflectionKind, Converter } from 'typedoc'; +import { MarkdownPageEvent } from 'typedoc-plugin-markdown'; +import { existsSync } from 'fs'; +import { resolve, dirname } from 'path'; +import { fileURLToPath } from 'url'; + +/** + * Formats the description section by extracting the first paragraph and rendering it under a Description header. + * Also removes the first paragraph from the TypeDoc model to prevent duplication. + * + * @param {import('typedoc').Reflection} model - The reflection model + * @param {any} context - The markdown theme context (from content.begin hook) + * @returns {string} The formatted description markdown + */ +function formatDescriptionSection(model, context) { + // Only process reflections that have comments (classes, interfaces, functions, etc.) + const isPackage = model.kind === 2; + if (!model || !model.comment || !model.comment.summary || model.comment.summary.length === 0 || isPackage) { + return ''; + } + + // Get the full comment summary as markdown + const fullSummary = context.helpers.getCommentParts(model.comment.summary); + + if (!fullSummary || !fullSummary.trim()) { + return ''; + } + + // Split on double newline (paragraph break) to get first paragraph + const trimmedSummary = fullSummary.trim(); + const paragraphMatch = trimmedSummary.match(/^([^\n]+(?:\n[^\n]+)*)\n\n(.*)$/s); + + let firstParagraph = ''; + + if (paragraphMatch) { + firstParagraph = paragraphMatch[1].trim(); + + // Remove the first paragraph from the TypeDoc model's comment summary + // We'll render the full description ourselves, so we need to prevent TypeDoc from rendering it + if (model.comment.summary) { + model.comment.summary = []; + } + } + + // Build output: first paragraph as blockquote, then Description section with full description + let output = ''; + + // Render first paragraph as blockquote if it exists + if (firstParagraph) { + const blockquoteLines = firstParagraph.split('\n').map(line => `> ${line}`).join('\n'); + output += `${blockquoteLines}\n\n`; + } + + // Render full description in Description section + output += '## Description\n\n'; + + // If we extracted a first paragraph, show the rest; otherwise show the full summary + const remainingDescription = firstParagraph + ? trimmedSummary.replace(firstParagraph, '').trim() + : trimmedSummary; + if (remainingDescription) { + output += `${remainingDescription}\n\n`; + } + + // Render relevant block tags if they exist + if (model.comment.blockTags && model.comment.blockTags.length > 0) { + // Filter relevant block tags (excluding @example, @param, @returns which are handled elsewhere) + const relevantTags = model.comment.blockTags.filter( + tag => !['@example', '@param', '@returns', '@throws', '@see'].includes(tag.tag) + ); + + // Render block tags + for (const tag of relevantTags) { + const tagContent = context.helpers.getCommentParts(tag.content); + if (tagContent && tagContent.trim()) { + output += `**${tag.tag.substring(1)}**: ${tagContent}\n\n`; + } + } + } + + return output; +} + +/** + * Removes horizontal rules from markdown content. + * + * @param {string} content - The markdown content + * @returns {string} Content with horizontal rules removed + */ +function removeHorizontalRules(content) { + return content + // Remove HTML hr tags (with optional attributes) + .replace(//gi, '') + // Remove markdown horizontal rules (3+ dashes, asterisks, or underscores on their own line) + .replace(/^[-*_]{3,}\s*$/gm, '') + // Clean up multiple consecutive blank lines that might result + .replace(/\n{3,}/g, '\n\n'); +} + +/** + * Removes empty Type Parameters sections from markdown content. + * + * @param {string} content - The markdown content + * @returns {string} Content with empty Type Parameters sections removed + */ +function removeEmptyTypeParameters(content) { + // Remove "## Type Parameters" heading followed by an empty table (just headers, no data rows) + // This matches sections like: + // ## Type Parameters + // + // | Type Parameter | + // | ------ | + // The table separator can have varying numbers of dashes + return content.replace( + /^## Type Parameters\s*\n+\|\s*Type Parameter\s*\|\s*\n\|\s*[-:]+\s*\|\s*\n(?=\n|##|$)/gm, + '' + ); +} + +/** + * Converts standalone "Param" sections into a proper "Parameters" section with parameter names. + * TypeDoc sometimes renders @param tags as separate "## Param" sections without parameter names. + * This function collects them and formats them properly. + * + * @param {string} content - The markdown content + * @param {import('typedoc').Reflection} model - The reflection model to extract parameter info from + * @param {any} context - The markdown theme context for helper functions + * @returns {string} Content with Param sections converted to Parameters section + */ +function convertParamSectionsToParameters(content, model, context) { + // Match pattern: ## Param\n\n + const paramSectionRegex = /^## Param\s*\n\n([^\n]+(?:\n[^\n]+)*?)(?=\n##|\n###|$)/gm; + + const paramSections = []; + let match; + + // Collect all Param sections + while ((match = paramSectionRegex.exec(content)) !== null) { + paramSections.push({ + description: match[1].trim(), + index: match.index + }); + } + + // If we found Param sections, replace them with a proper Parameters section + if (paramSections.length > 0) { + // Extract parameter names from @param tags in the JSDoc comments + const paramNames = []; + if (model && model.comment && model.comment.blockTags) { + const paramTags = model.comment.blockTags.filter(tag => tag.tag === '@param'); + paramNames.push(...paramTags.map(tag => tag.name).filter(Boolean)); + } + + // Build the Parameters section + let parametersSection = '## Parameters\n\n'; + + for (let i = 0; i < paramSections.length; i++) { + const paramName = paramNames[i] || `param${i + 1}`; + parametersSection += `### \`${paramName}\`\n\n${paramSections[i].description}\n\n`; + } + + // Remove all the individual Param sections + content = content.replace(/^## Param\s*\n\n[^\n]+(?:\n[^\n]+)*?(?=\n##|\n###|$)/gm, ''); + + // Find where to insert the Parameters section (after Examples, before Call Signature) + const examplesEndMatch = content.match(/^## Examples[\s\S]*?(?=\n## (?:Call Signature|Param|$))/m); + if (examplesEndMatch && examplesEndMatch.index !== undefined) { + // Insert after Examples section + const insertIndex = examplesEndMatch.index + examplesEndMatch[0].length; + content = content.slice(0, insertIndex) + '\n' + parametersSection + content.slice(insertIndex); + } else { + // Insert before first Call Signature or at the end + const callSignatureMatch = content.match(/^## Call Signature/m); + if (callSignatureMatch && callSignatureMatch.index !== undefined) { + content = content.slice(0, callSignatureMatch.index) + parametersSection + content.slice(callSignatureMatch.index); + } else { + // Append at the end + content += '\n' + parametersSection; + } + } + } + + return content; +} + +/** + * Adds a Returns section from @returns JSDoc tag if it exists. + * The Returns section should appear after Parameters and before Call Signature sections. + * + * @param {string} content - The markdown content + * @param {import('typedoc').Reflection} model - The reflection model to extract return info from + * @param {any} context - The markdown theme context for helper functions + */ +function addReturnsSection(content, model, context) { + // Check if @returns tag exists in JSDoc + if (!model || !model.comment || !model.comment.blockTags) { + return content; + } + + const returnsTag = model.comment.blockTags.find(tag => tag.tag === '@returns' || tag.tag === '@return'); + if (!returnsTag) { + return content; + } + + // Extract return type and description from the @returns tag + let returnType = ''; + let returnDescription = ''; + + if (returnsTag.content && returnsTag.content.length > 0) { + // Get the full content as markdown + if (context && context.helpers && context.helpers.getCommentParts) { + const fullContent = context.helpers.getCommentParts(returnsTag.content); + // Try to extract type (usually first word before dash or colon) + const typeMatch = fullContent.match(/^([^-:]+?)(?:\s*[-:]\s*|\s+)(.*)$/s); + if (typeMatch) { + returnType = typeMatch[1].trim(); + returnDescription = typeMatch[2].trim(); + } else { + // No type specified, just description + returnDescription = fullContent.trim(); + } + } else { + // Fallback: extract from content array, handling both text and inline-tag parts + let fullText = ''; + for (const part of returnsTag.content) { + if (part.kind === 'text') { + fullText += part.text; + } else if (part.kind === 'inline-tag') { + // Handle inline tags like {@link ...} + if (part.text) { + fullText += part.text; + } + } + } + + // Try to extract type (format: "Type - description" or "Type: description" or "Type description") + const typeMatch = fullText.match(/^([^-:]+?)(?:\s*[-:]\s*|\s{2,})(.*)$/s); + if (typeMatch) { + returnType = typeMatch[1].trim(); + returnDescription = typeMatch[2].trim(); + } else { + // No clear separator, check if first word looks like a type + const words = fullText.trim().split(/\s+/); + if (words.length > 1 && /^[A-Z]/.test(words[0])) { + // First word capitalized, likely a type + returnType = words[0]; + returnDescription = words.slice(1).join(' '); + } else { + // Just description + returnDescription = fullText.trim(); + } + } + } + } + + // Build the Returns section + let returnsSection = '## Returns\n\n'; + if (returnType) { + returnsSection += `\`${returnType}\`\n\n`; + } + if (returnDescription) { + returnsSection += `${returnDescription}\n\n`; + } + + // Check if Returns section already exists (look for "## Returns" followed by content) + if (content.match(/^## Returns\s*\n/m)) { + return content; // Already exists, don't add again + } + + // Find where to insert the Returns section (after Parameters, before Call Signature) + const parametersEndMatch = content.match(/^## Parameters[\s\S]*?(?=\n## (?:Call Signature|Returns|$))/m); + if (parametersEndMatch && parametersEndMatch.index !== undefined) { + // Insert after Parameters section + const insertIndex = parametersEndMatch.index + parametersEndMatch[0].length; + content = content.slice(0, insertIndex) + '\n' + returnsSection + content.slice(insertIndex); + } else { + // Insert before first Call Signature + const callSignatureMatch = content.match(/^## Call Signature/m); + if (callSignatureMatch && callSignatureMatch.index !== undefined) { + content = content.slice(0, callSignatureMatch.index) + returnsSection + content.slice(callSignatureMatch.index); + } else { + // Append at the end if no Call Signature found + content += '\n' + returnsSection; + } + } + + return content; +} + +/** + * Processes marble diagram images to support light/dark themes. + * Replaces markdown images with picture elements if both theme versions exist. + * + * @param {string} content - The markdown content + * @param {string} marbleDiagramsPath - Path to the marble diagrams directory + * @returns {string} Content with marble diagrams processed + */ +function processMarbleDiagrams(content, marbleDiagramsPath) { + // Helper function to check and replace image with picture element + const processMarbleImage = (operatorName, extension, altText = '') => { + // Skip if operatorName already has a theme suffix + if (operatorName.endsWith('-light') || operatorName.endsWith('-dark')) { + return null; + } + + // Check if both light and dark versions exist + const lightPath = resolve(marbleDiagramsPath, `${operatorName}-light${extension}`); + const darkPath = resolve(marbleDiagramsPath, `${operatorName}-dark${extension}`); + + const hasLight = existsSync(lightPath); + const hasDark = existsSync(darkPath); + + if (hasLight && hasDark) { + // Both versions exist - return picture element + const lightSrc = `/images/marble-diagrams/${operatorName}-light${extension}`; + const darkSrc = `/images/marble-diagrams/${operatorName}-dark${extension}`; + const alt = altText || 'Marble diagram'; + + return `
${alt} +${alt}
`; + } + + return null; + }; + + // Process markdown images: ![alt text](/images/marble-diagrams/operatorName.svg) + return content.replace( + /!\[([^\]]*)\]\s*\(([^)]*\/images\/marble-diagrams\/([^/)\-]+)(\.svg))\)/g, + (match, altText, fullPath, operatorName, extension) => { + const replacement = processMarbleImage(operatorName, extension, altText); + return replacement || match; + } + ); +} + +/** + * Removes type parameters from a reflection. + * + * @param {import('typedoc').Reflection} reflection - The reflection to process + * @param {import('typedoc').Application} app - The TypeDoc application instance + */ +function removeTypeParameters(reflection, app) { + if (reflection && 'typeParameters' in reflection) { + const declReflection = /** @type {import('typedoc').DeclarationReflection | import('typedoc').SignatureReflection} */ (reflection); + if (Array.isArray(declReflection.typeParameters) && declReflection.typeParameters.length > 0) { + const originalLength = declReflection.typeParameters.length; + declReflection.typeParameters = []; + app.logger.verbose( + `[typedoc-plugin-rxjs] Removed ${originalLength} typeParameter(s) from ${declReflection.name || 'reflection'}` + ); + } + } +} + +/** + * Processes CallSignature overloads to ensure all overloads are preserved for proper documentation. + * Removes typeParameters from signatures but keeps all overloads visible. + * + * @param {import('typedoc').DeclarationReflection} declReflection - The declaration reflection + * @param {import('typedoc').Application} app - The TypeDoc application instance + */ +function filterCallSignatureOverloads(declReflection, app) { + if (!Array.isArray(declReflection.signatures)) { + return; + } + + // Remove typeParameters from each signature + for (const signature of declReflection.signatures) { + if (signature && 'typeParameters' in signature && Array.isArray(signature.typeParameters)) { + signature.typeParameters = []; + } + } + + const originalLength = declReflection.signatures.length; + + // Only filter if there are multiple signatures (indicating overloads) + if (declReflection.signatures.length > 1) { + // Separate CallSignatures from other signature types + const callSignatures = declReflection.signatures.filter( + (sig) => sig.kind === ReflectionKind.CallSignature + ); + const otherSignatures = declReflection.signatures.filter( + (sig) => sig.kind !== ReflectionKind.CallSignature + ); + + // Filter CallSignatures that don't have their own comments + const callSignaturesWithComments = callSignatures.filter((signature) => { + return signature.comment && ( + (signature.comment.summary && signature.comment.summary.length > 0) || + (signature.comment.blockTags && signature.comment.blockTags.length > 0) + ); + }); + + // If we have other signatures (non-CallSignature), filter all CallSignatures without comments + // If we only have CallSignatures, keep all of them to properly render overloads + if (otherSignatures.length > 0) { + // We have non-CallSignature signatures, so filter all CallSignatures without comments + declReflection.signatures = [ + ...otherSignatures, + ...callSignaturesWithComments + ]; + } else if (callSignaturesWithComments.length > 0) { + // Only CallSignatures, but some have comments - keep all CallSignatures + // This preserves overloads while showing the ones with comments + // TypeDoc will handle rendering all signatures properly + declReflection.signatures = callSignatures; + } else if (callSignatures.length > 0) { + // Only CallSignatures and none have individual comments - keep all of them + // This ensures all overloads are shown, with the implementation (usually last) having the main JSDoc comment + declReflection.signatures = callSignatures; + } + } + + if (declReflection.signatures.length !== originalLength) { + app.logger.verbose( + `[rxjs-docs-plugin] Filtered ${originalLength - declReflection.signatures.length} CallSignature(s) without comments from ${declReflection.name}` + ); + } +} + +/** + * Filters TypeParameter kinds from children arrays. + * + * @param {import('typedoc').DeclarationReflection} declReflection - The declaration reflection + * @param {import('typedoc').Application} app - The TypeDoc application instance + */ +function filterTypeParameterChildren(declReflection, app) { + if (!Array.isArray(declReflection.children)) { + return; + } + + const originalLength = declReflection.children.length; + // Filter out TypeParameter kinds + declReflection.children = declReflection.children.filter( + (child) => child.kind !== ReflectionKind.TypeParameter + ); + + if (declReflection.children.length !== originalLength) { + app.logger.verbose( + `[rxjs-docs-plugin] Filtered ${originalLength - declReflection.children.length} TypeParameter(s) from ${declReflection.name || 'reflection'}` + ); + } +} + +/** + * Recursively filters CallSignature kinds without comments from all reflections. + * + * @param {import('typedoc').Reflection} reflection - The reflection to process + * @param {import('typedoc').Application} app - The TypeDoc application instance + */ +function filterReflections(reflection, app) { + // Remove typeParameters from declarations and signatures + removeTypeParameters(reflection, app); + + // Check if this is a DeclarationReflection with signatures + if (reflection && 'signatures' in reflection) { + const declReflection = /** @type {import('typedoc').DeclarationReflection} */ (reflection); + filterCallSignatureOverloads(declReflection, app); + } + + // Filter out type parameters from children + if (reflection && 'children' in reflection) { + const declReflection = /** @type {import('typedoc').DeclarationReflection} */ (reflection); + filterTypeParameterChildren(declReflection, app); + + // Recursively process remaining children + if (Array.isArray(declReflection.children)) { + for (const child of declReflection.children) { + filterReflections(child, app); + } + } + } +} + +/** + * TypeDoc plugin for customizing markdown output for RxJS documentation. + * + * This plugin provides several enhancements to the generated markdown documentation: + * + * 1. **Description Section Formatting** + * - Adds a "Description" section header for all reflections with comments + * - Renders relevant block tags in the Description section if present + * - Note: TypeDoc already renders the comment summary automatically, so only the header and block tags are added here + * - Includes relevant block tags (excluding `@example`, `@param`, `@returns`, `@throws`, `@see` which are handled elsewhere) + * + * 2. **Horizontal Rule Removal** + * - Removes all HTML `
` tags and markdown horizontal rules (---, ***, ___) from rendered pages + * - Cleans up resulting multiple consecutive blank lines + * + * 3. **Marble Diagram Theme Support** + * - Automatically detects marble diagram images in markdown format + * - Replaces single images with picture elements that support both light and dark themes + * - Looks for `-light` and `-dark` suffixed versions of images in `/images/marble-diagrams/` + * - Generates HTML with `only-light` and `only-dark` CSS classes for theme switching + * + * 4. **Signature Processing** + * - Preserves all CallSignature overloads to ensure proper documentation of function overloads + * - Removes typeParameters from signatures for cleaner documentation + * - Separates CallSignatures from other signature types (e.g., ConstructSignatures) + * - When only CallSignatures exist, all are kept to show complete overload information + * + * 5. **Type Parameter Removal** + * - Removes all typeParameters from declarations, signatures, and their children + * - Filters out TypeParameter reflection kinds from children arrays + * - This simplifies the generated documentation by hiding generic type parameters + * + * @param {import('typedoc-plugin-markdown').MarkdownApplication} app - The TypeDoc markdown application instance + */ +export function load(app) { + // Add hook to inject Description section at the top of content + app.renderer.markdownHooks.on('content.begin', (context) => { + return formatDescriptionSection(context.page.model, context); + }); + + // Remove all horizontal rule tags from the rendered markdown and process marble diagrams + app.renderer.on(MarkdownPageEvent.END, (page) => { + // Remove HTML
tags and markdown horizontal rules + page.contents = removeHorizontalRules(page.contents); + + // Remove empty Type Parameters sections + page.contents = removeEmptyTypeParameters(page.contents); + + // Convert standalone "Param" sections to proper "Parameters" section + // Only process if model is a Reflection type (has comment property) + if (page.model && 'comment' in page.model) { + page.contents = convertParamSectionsToParameters(page.contents, page.model, null); + // Add Returns section from @returns tag + page.contents = addReturnsSection(page.contents, page.model, null); + } + + // Process marble diagram images - replace HTML img tags and markdown images with picture elements + const pluginPath = fileURLToPath(import.meta.url); + const pluginDir = dirname(pluginPath); + // Go up from tools/api-generator to apps/rxjs.dev-next/docs + const docsDir = resolve(pluginDir, '../../docs'); + const marbleDiagramsPath = resolve(docsDir, 'public/images/marble-diagrams'); + + // Process markdown images: ![alt text](/images/marble-diagrams/operatorName.svg) + page.contents = processMarbleDiagrams(page.contents, marbleDiagramsPath); + }); + + // Use TypeDoc's converter hook to filter signatures after resolution + app.converter.on(Converter.EVENT_RESOLVE_END, (context) => { + // Process the project and all its children + if (context.project) { + filterReflections(context.project, app); + } + }); +} diff --git a/apps/rxjs.dev-next/tools/marbles/diagrams/audit.txt b/apps/rxjs.dev-next/tools/marbles/diagrams/audit.txt new file mode 100644 index 0000000000..21cfa75e78 --- /dev/null +++ b/apps/rxjs.dev-next/tools/marbles/diagrams/audit.txt @@ -0,0 +1,11 @@ +-a-xy-----b--x--cxyz-| + + ----i + + ----i + + ----i + +> audit() + +-----y--------x-----z| diff --git a/apps/rxjs.dev-next/tools/marbles/diagrams/bufferWhen.txt b/apps/rxjs.dev-next/tools/marbles/diagrams/bufferWhen.txt new file mode 100644 index 0000000000..65a73e61dc --- /dev/null +++ b/apps/rxjs.dev-next/tools/marbles/diagrams/bufferWhen.txt @@ -0,0 +1,15 @@ +[styles] +event_radius = 33 +operator_height = 60 +completion_height = 80 + +---a---b---c---d---e---f---g---h---| + +-------------s + +> bufferWhen() + +-------------x------------y--------(z|) +x := [a, b, c] +y := [d, e, f] +z := [g, h] diff --git a/apps/rxjs.dev-next/tools/marbles/diagrams/concatAll.txt b/apps/rxjs.dev-next/tools/marbles/diagrams/concatAll.txt new file mode 100644 index 0000000000..eddffb105e --- /dev/null +++ b/apps/rxjs.dev-next/tools/marbles/diagrams/concatAll.txt @@ -0,0 +1,11 @@ +x = ----a------b------| + +y = ---c-d---| + +z = ---e--f-| + +-x---y----z------| + +> concatAll + +-----a------b---------c-d------e--f-| \ No newline at end of file diff --git a/apps/rxjs.dev-next/tools/marbles/diagrams/debounce.txt b/apps/rxjs.dev-next/tools/marbles/diagrams/debounce.txt new file mode 100644 index 0000000000..485431d65f --- /dev/null +++ b/apps/rxjs.dev-next/tools/marbles/diagrams/debounce.txt @@ -0,0 +1,11 @@ +-a----bc----d-ef----| + + ---x + + ---x + + ---x + +> debounce() + +----a-----c-------f-| diff --git a/apps/rxjs.dev-next/tools/marbles/diagrams/delay.txt b/apps/rxjs.dev-next/tools/marbles/diagrams/delay.txt new file mode 100644 index 0000000000..4b98bc4518 --- /dev/null +++ b/apps/rxjs.dev-next/tools/marbles/diagrams/delay.txt @@ -0,0 +1,8 @@ +[styles] +event_radius = 15 + +---a--b--c---| + +> delay(20) + +-----a--b--c-| diff --git a/apps/rxjs.dev-next/tools/marbles/diagrams/exhaustAll.txt b/apps/rxjs.dev-next/tools/marbles/diagrams/exhaustAll.txt new file mode 100644 index 0000000000..68ec84a816 --- /dev/null +++ b/apps/rxjs.dev-next/tools/marbles/diagrams/exhaustAll.txt @@ -0,0 +1,12 @@ +x = --a---b---c--| + +y = ---d--e---f---| + +z = ---g--h---i---| + +------x-------y------z--| +ghosts = y + +> exhaustAll + +--------a---b---c-------g--h---i---| diff --git a/apps/rxjs.dev-next/tools/marbles/diagrams/throttle.txt b/apps/rxjs.dev-next/tools/marbles/diagrams/throttle.txt new file mode 100644 index 0000000000..47b3ac0122 --- /dev/null +++ b/apps/rxjs.dev-next/tools/marbles/diagrams/throttle.txt @@ -0,0 +1,11 @@ +-a-xy-----b--x--cxyz-| + + ----i + + ----i + + ----i + +> throttle() + +-a--------b-----c----| diff --git a/apps/rxjs.dev-next/tools/marbles/diagrams/windowWhen.txt b/apps/rxjs.dev-next/tools/marbles/diagrams/windowWhen.txt new file mode 100644 index 0000000000..0a72c48dc1 --- /dev/null +++ b/apps/rxjs.dev-next/tools/marbles/diagrams/windowWhen.txt @@ -0,0 +1,20 @@ +[styles] +event_radius = 33 +operator_height = 60 +completion_height = 80 + +---a---b---c---d---e---f---g---h---| + +-------------x| + -------------x| + -------------x| + +> windowWhen() + +x = ---a---b---c-| + +y = --d---e---f---g| + +z = -g---h---| + +x------------y------------z--------| diff --git a/apps/rxjs.dev-next/tools/marbles/generate-diagrams.ts b/apps/rxjs.dev-next/tools/marbles/generate-diagrams.ts new file mode 100644 index 0000000000..dae1c75c79 --- /dev/null +++ b/apps/rxjs.dev-next/tools/marbles/generate-diagrams.ts @@ -0,0 +1,147 @@ +#!/usr/bin/env node + +/** + * Marble Diagram Generator + * + * Generates SVG marble diagrams from text specifications using @swirly. + * Reads .txt files from tools/marbles/diagrams/ and outputs SVG files to + * docs/public/images/marble-diagrams/ + */ + +import { renderMarbleDiagram } from '@swirly/renderer-node'; +import { readdir, readFileSync, writeFileSync, mkdir } from 'fs'; +import { join, resolve, dirname } from 'path'; +import { parseMarbleDiagramSpecification } from '@swirly/parser'; +import { DiagramStyles } from '@swirly/types'; +import { optimize } from 'svgo'; +import { fileURLToPath } from 'url'; +import { promisify } from 'util'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +const readdirAsync = promisify(readdir); +const mkdirAsync = promisify(mkdir); + +// Light theme styles +const lightStyles: DiagramStyles = { + frame_width: 20, + completion_height: 20, + higher_order_angle: 30, + arrow_fill_color: 'black', + background_color: 'rgb(246, 246, 247)', + operator_fill_color: 'rgba(255, 255, 255, 0.0)' +}; + +// Dark theme styles +const darkStyles: DiagramStyles = { + frame_width: 20, + completion_height: 20, + higher_order_angle: 30, + arrow_fill_color: 'rgb(223, 223, 214)', + arrow_stroke_color: 'rgb(223, 223, 214)', + completion_stroke_color: 'rgb(223, 223, 214)', + stream_title_color: 'rgb(223, 223, 214)', + error_color: 'red', + event_stroke_color: 'white', + barrier_color: 'rgb(223, 223, 214)', + background_color: 'rgb(27, 27, 31)', + operator_fill_color: 'rgb(27, 27, 31)', + operator_stroke_color: 'rgb(223, 223, 214)', + operator_title_color: 'rgb(223, 223, 214)', +}; + +const optimizeXml = async (unoptXml: string): Promise => { + const result = await optimize(unoptXml, { + plugins: [ + { + name: 'preset-default', + params: { + overrides: { + removeViewBox: false + } + } + } + ] + }); + return result.data || unoptXml; +}; + +const renderMarble = async ( + path: string, + fileName: string, + styles: DiagramStyles, + suffix: string +): Promise => { + const file = readFileSync(join(path, fileName)); + const diagramSpec = parseMarbleDiagramSpecification(file.toString()); + const { xml: unoptXml } = renderMarbleDiagram(diagramSpec, { styles }); + let svgXML = await optimizeXml(unoptXml); + + // Post-process dark mode SVGs: inject style tag + if (suffix === 'dark') { + // Inject style tag right after the opening tag + const styleBlock = ``; + + // Insert the style block right after the opening tag + // Handle both minified (no newline) and formatted SVGs + svgXML = svgXML.replace(/]*)>/, `\n${styleBlock}`); + } + + const baseName = fileName.split('.')[0]; + const svgFileName = suffix ? `${baseName}-${suffix}.svg` : `${baseName}.svg`; + const outputDir = resolve(__dirname, '../../docs/public/images/marble-diagrams'); + + // Ensure output directory exists + await mkdirAsync(outputDir, { recursive: true }); + + const svgPath = join(outputDir, svgFileName); + writeFileSync(svgPath, svgXML, { encoding: 'utf-8', flag: 'w' }); + console.log(` ✓ Generated ${svgFileName}`); +}; + +async function main() { + console.log('Generating marble diagrams...\n'); + + const diagramsPath = resolve(__dirname, 'diagrams'); + + try { + const files = await readdirAsync(diagramsPath); + const txtFiles = files.filter(file => file.endsWith('.txt')); + + if (txtFiles.length === 0) { + console.log('No .txt files found in diagrams directory.'); + return; + } + + console.log(`Found ${txtFiles.length} diagram specification(s):\n`); + + // Generate both light and dark versions for each diagram + const renderTasks: Promise[] = []; + for (const fileName of txtFiles) { + // Generate light version + renderTasks.push(renderMarble(diagramsPath, fileName, lightStyles, 'light')); + // Generate dark version + renderTasks.push(renderMarble(diagramsPath, fileName, darkStyles, 'dark')); + } + + await Promise.all(renderTasks); + + console.log(`\n✅ All ${txtFiles.length * 2} SVG(s) created successfully! (${txtFiles.length} light + ${txtFiles.length} dark)`); + } catch (error) { + console.error('\n❌ Error generating marble diagrams:', error); + process.exit(1); + } +} + +// Run if called directly +if (import.meta.url === `file://${process.argv[1]}`) { + main(); +} + +export { main as generateMarbleDiagrams }; + diff --git a/apps/rxjs.dev-next/tsconfig.typedoc.json b/apps/rxjs.dev-next/tsconfig.typedoc.json new file mode 100644 index 0000000000..30762301f1 --- /dev/null +++ b/apps/rxjs.dev-next/tsconfig.typedoc.json @@ -0,0 +1,15 @@ +{ + "extends": "../../packages/rxjs/tsconfig.json", + "compilerOptions": { + "noEmit": true, + }, + "include": [ + "../../packages/rxjs/src/**/*.ts" + ], + "exclude": [ + "node_modules", + "dist", + "**/*.spec.ts", + "**/*.test.ts" + ] +} diff --git a/apps/rxjs.dev-next/tsconfig.typedoc.tsbuildinfo b/apps/rxjs.dev-next/tsconfig.typedoc.tsbuildinfo new file mode 100644 index 0000000000..8dc1b43e87 --- /dev/null +++ b/apps/rxjs.dev-next/tsconfig.typedoc.tsbuildinfo @@ -0,0 +1 @@ +{"version":"5.3.3"} \ No newline at end of file diff --git a/apps/rxjs.dev-next/typedoc.config.mjs b/apps/rxjs.dev-next/typedoc.config.mjs new file mode 100644 index 0000000000..debedadb32 --- /dev/null +++ b/apps/rxjs.dev-next/typedoc.config.mjs @@ -0,0 +1,85 @@ +// @ts-check +import { resolve, dirname } from 'path'; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +const PROJECT_ROOT = resolve(__dirname, '../../'); +const RXJS_PACKAGE = resolve(PROJECT_ROOT, 'packages/rxjs'); +const OBSERVABLE_PACKAGE = resolve(PROJECT_ROOT, 'packages/observable'); +const RXJS_SRC = resolve(RXJS_PACKAGE, 'src'); +const TYPEDOC_TSCONFIG = resolve(__dirname, 'tsconfig.typedoc.json'); + +export default { + name: 'API', + entryPoints: [ + resolve(RXJS_SRC, 'index.ts'), + resolve(OBSERVABLE_PACKAGE, 'src/index.ts'), + resolve(RXJS_SRC, 'operators/index.ts'), + resolve(RXJS_SRC, 'ajax/index.ts'), + resolve(RXJS_SRC, 'fetch/index.ts'), + resolve(RXJS_SRC, 'webSocket/index.ts'), + resolve(RXJS_SRC, 'testing/index.ts'), + ], + entryPointStrategy: 'resolve', + tsconfig: TYPEDOC_TSCONFIG, + exclude: [ + '**/node_modules/**', + '**/dist/**', + '**/*.spec.ts', + '**/*.test.ts', + ], + readme: 'none', + navigation: { + includeGroups: false, + }, + excludePrivate: true, + excludeProtected: true, + excludeInternal: true, + excludeExternals: false, // Need to include externals to resolve @rxjs/observable + gitRevision: 'master', + // Don't include source file paths in output + // TypeDoc-specific options + categorizeByGroup: false, + // Log level - only show warnings and errors, not info + logLevel: 'Warn', + // JSON output path (will be overridden in generate script) + plugin: [ + 'typedoc-plugin-markdown', // @ts-ignore + 'typedoc-vitepress-theme', + './tools/api-generator/typedoc-plugin-rxjs.mjs' + ], + hidePageHeader: true, + hideBreadcrumbs: false, + hidePageTitle: false, + expandObjects: true, + expandParameters: true, + useCodeBlocks: true, + jsDocCompatibility: true, + includeHierarchySummary: false, + parametersFormat: 'table', + interfacePropertiesFormat: 'table', + classPropertiesFormat: 'table', + sidebar: { + petty: true, + }, + tableColumnSettings: { + hideDefaults: false, + hideInherited: false, + hideModifiers: true, + hideOverrides: false, + hideSources: true, + hideValues: false, + leftAlignHeaders: false + }, + typeAliasPropertiesFormat: 'table', + enumMembersFormat: 'table', + propertyMembersFormat: 'table', + typeDeclarationFormat: 'table', + + emit: 'both', + out: './docs/api', + docsRoot: './docs' +}; + diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/audit.svg b/apps/rxjs.dev/src/assets/images/marble-diagrams/audit.svg deleted file mode 100644 index 2c510189d6..0000000000 --- a/apps/rxjs.dev/src/assets/images/marble-diagrams/audit.svg +++ /dev/null @@ -1 +0,0 @@ -zyxcxbyxaiiiaudit()zxy \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/bufferWhen.svg b/apps/rxjs.dev/src/assets/images/marble-diagrams/bufferWhen.svg deleted file mode 100644 index faa0c3da80..0000000000 --- a/apps/rxjs.dev/src/assets/images/marble-diagrams/bufferWhen.svg +++ /dev/null @@ -1 +0,0 @@ -hgfedcbasbufferWhen()[g, h][d, e, f][a, b, c] \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/concatAll.svg b/apps/rxjs.dev/src/assets/images/marble-diagrams/concatAll.svg deleted file mode 100755 index f7a5258ab7..0000000000 --- a/apps/rxjs.dev/src/assets/images/marble-diagrams/concatAll.svg +++ /dev/null @@ -1 +0,0 @@ -fedcbaconcatAllfedcba \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/debounce.svg b/apps/rxjs.dev/src/assets/images/marble-diagrams/debounce.svg deleted file mode 100644 index 689f7ef820..0000000000 --- a/apps/rxjs.dev/src/assets/images/marble-diagrams/debounce.svg +++ /dev/null @@ -1 +0,0 @@ -fedcbaxxxdebounce()fca \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/delay.svg b/apps/rxjs.dev/src/assets/images/marble-diagrams/delay.svg deleted file mode 100644 index def3ea4eb0..0000000000 --- a/apps/rxjs.dev/src/assets/images/marble-diagrams/delay.svg +++ /dev/null @@ -1 +0,0 @@ -cbadelay(20)cba \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/exhaustAll.svg b/apps/rxjs.dev/src/assets/images/marble-diagrams/exhaustAll.svg deleted file mode 100644 index a23b01c035..0000000000 --- a/apps/rxjs.dev/src/assets/images/marble-diagrams/exhaustAll.svg +++ /dev/null @@ -1 +0,0 @@ -ihgfedcbaexhaustAllihgcba \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/throttle.svg b/apps/rxjs.dev/src/assets/images/marble-diagrams/throttle.svg deleted file mode 100644 index ee250face1..0000000000 --- a/apps/rxjs.dev/src/assets/images/marble-diagrams/throttle.svg +++ /dev/null @@ -1 +0,0 @@ -zyxcxbyxaiiithrottle()cba \ No newline at end of file diff --git a/apps/rxjs.dev/src/assets/images/marble-diagrams/windowWhen.svg b/apps/rxjs.dev/src/assets/images/marble-diagrams/windowWhen.svg deleted file mode 100644 index e896495023..0000000000 --- a/apps/rxjs.dev/src/assets/images/marble-diagrams/windowWhen.svg +++ /dev/null @@ -1 +0,0 @@ -hgfedcbaxwindowWhen()hggfedcba \ No newline at end of file diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000000..1e6836cd2d --- /dev/null +++ b/mise.toml @@ -0,0 +1,3 @@ +[tools] +node = "20.19.0" +yarn = "1.22" diff --git a/package.json b/package.json index aa9d433642..20dde1e5eb 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "workspaces": { "packages": [ "packages/*", - "apps/rxjs.dev" + "apps/rxjs.dev", + "apps/rxjs.dev-next" ], "nohoist": [ "**/@types/jasmine", @@ -57,4 +58,3 @@ "*.{js,css,md}": "prettier --write" } } - diff --git a/packages/observable/src/index.ts b/packages/observable/src/index.ts index 9f4d320922..d1d71ab7ee 100644 --- a/packages/observable/src/index.ts +++ b/packages/observable/src/index.ts @@ -1,3 +1,6 @@ +/** + * @module @rxjs/observable + */ export { Observable, Subscriber, Subscription, UnsubscriptionError, config, from, isObservable, operate } from './observable.js'; export type { GlobalConfig, SubscriberOverrides } from './observable.js'; diff --git a/packages/observable/src/observable.ts b/packages/observable/src/observable.ts index 31f8403d15..284766d32c 100644 --- a/packages/observable/src/observable.ts +++ b/packages/observable/src/observable.ts @@ -18,7 +18,7 @@ import type { /** * An error thrown when one or more errors have occurred during the - * `unsubscribe` of a {@link Subscription}. + * `unsubscribe` of a {@link rxjs!Subscription | Subscription }. */ export class UnsubscriptionError extends Error { /** @@ -66,9 +66,9 @@ export class Subscription implements SubscriptionLike { /** * @param initialTeardown A function executed first as part of the finalization - * process that is kicked off when {@link #unsubscribe} is called. + * process that is kicked off when {@link rxjs!Subscription#unsubscribe | unsubscribe} is called. */ - constructor(private initialTeardown?: () => void) {} + constructor(private initialTeardown?: () => void) { } /** * Disposes the resources held by the subscription. May, for instance, cancel @@ -115,7 +115,7 @@ export class Subscription implements SubscriptionLike { /** * Adds a finalizer to this subscription, so that finalization will be unsubscribed/called - * when this subscription is unsubscribed. If this subscription is already {@link #closed}, + * when this subscription is unsubscribed. If this subscription is already {@link @rxjs/observable!Subscription#closed | closed}, * because it has already been unsubscribed, then whatever finalizer is passed to it * will automatically be executed (unless the finalizer itself is also a closed subscription). * @@ -126,8 +126,8 @@ export class Subscription implements SubscriptionLike { * operation at all. (A noop). * * `Subscription` instances that are added to this instance will automatically remove themselves - * if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove - * will need to be removed manually with {@link #remove} + * if they are unsubscribed. Functions and {@link rxjs!Unsubscribable | Unsubscribable} objects that you wish to remove + * will need to be removed manually with {@link @rxjs/observable!Subscription#remove | remove} * * @param teardown The finalization logic to add to this subscription. */ @@ -155,7 +155,7 @@ export class Subscription implements SubscriptionLike { } /** - * Removes a finalizer from this subscription that was previously added with the {@link #add} method. + * Removes a finalizer from this subscription that was previously added with the {@link @rxjs/observable!Subscription#add | add} method. * * Note that `Subscription` instances, when unsubscribed, will automatically remove themselves * from every other `Subscription` they have been added to. This means that using the `remove` method @@ -199,7 +199,7 @@ function execFinalizer(finalizer: Unsubscribable | (() => void)) { export interface SubscriberOverrides { /** - * If provided, this function will be called whenever the {@link Subscriber}'s + * If provided, this function will be called whenever the {@link rxjs!Subscriber | Subscriber}'s * `next` method is called, with the value that was passed to that call. If * an error is thrown within this function, it will be handled and passed to * the destination's `error` method. @@ -207,7 +207,7 @@ export interface SubscriberOverrides { */ next?: (value: T) => void; /** - * If provided, this function will be called whenever the {@link Subscriber}'s + * If provided, this function will be called whenever the {@link rxjs!Subscriber | Subscriber}'s * `error` method is called, with the error that was passed to that call. If * an error is thrown within this function, it will be handled and passed to * the destination's `error` method. @@ -215,23 +215,23 @@ export interface SubscriberOverrides { */ error?: (err: any) => void; /** - * If provided, this function will be called whenever the {@link Subscriber}'s + * If provided, this function will be called whenever the {@link rxjs!Subscriber | Subscriber}'s * `complete` method is called. If an error is thrown within this function, it * will be handled and passed to the destination's `error` method. */ complete?: () => void; /** * If provided, this function will be called after all teardown has occurred - * for this {@link Subscriber}. This is generally used for cleanup purposes + * for this {@link rxjs!Subscriber | Subscriber}. This is generally used for cleanup purposes * during operator development. */ finalize?: () => void; } /** - * Implements the {@link Observer} interface and extends the - * {@link Subscription} class. While the {@link Observer} is the public API for - * consuming the values of an {@link Observable}, all Observers get converted to + * Implements the {@link rxjs!Observer | Observer} interface and extends the + * {@link rxjs!Subscription | Subscription} class. While the {@link rxjs!Observer | Observer} is the public API for + * consuming the values of an {@link rxjs!Observable | Observable}, all Observers get converted to * a Subscriber, in order to provide Subscription-like capabilities such as * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for * implementing operators, but it is rarely used as a public API. @@ -252,7 +252,7 @@ export class Subscriber extends Subscription implements Observer { protected readonly _onFinalize: (() => void) | null = null; /** - * @deprecated Do not create instances of `Subscriber` directly. Use {@link operate} instead. + * @deprecated Do not create instances of `Subscriber` directly. Use {@link rxjs!operate | operate} instead. */ constructor(destination?: Subscriber | Partial> | ((value: T) => void) | null); @@ -272,7 +272,7 @@ export class Subscriber extends Subscription implements Observer { * If a next-handler function is passed in, it will be wrapped and appropriate safeguards will be applied. * * @param destination A subscriber, partial observer, or function that receives the next value. - * @deprecated Do not create instances of `Subscriber` directly. Use {@link operate} instead. + * @deprecated Do not create instances of `Subscriber` directly. Use {@link rxjs!operate | operate} instead. */ constructor(destination?: Subscriber | Partial> | ((value: T) => void) | null, overrides?: SubscriberOverrides) { super(); @@ -309,7 +309,7 @@ export class Subscriber extends Subscription implements Observer { } /** - * The {@link Observer} callback to receive notifications of type `next` from + * The {@link rxjs!Observer | Observer} callback to receive notifications of type `next` from * the Observable, with a value. The Observable may call this method 0 or more * times. * @param value The `next` value. @@ -323,7 +323,7 @@ export class Subscriber extends Subscription implements Observer { } /** - * The {@link Observer} callback to receive notifications of type `error` from + * The {@link rxjs!Observer | Observer} callback to receive notifications of type `error` from * the Observable, with an attached `Error`. Notifies the Observer that * the Observable has experienced an error condition. * @param err The `error` exception. @@ -338,7 +338,7 @@ export class Subscriber extends Subscription implements Observer { } /** - * The {@link Observer} callback to receive a valueless notification of type + * The {@link rxjs!Observer | Observer} callback to receive a valueless notification of type * `complete` from the Observable. Notifies the Observer that the Observable * has finished sending push-based notifications. */ @@ -381,7 +381,7 @@ export class Subscriber extends Subscription implements Observer { } /** - * The {@link GlobalConfig} object for RxJS. It is used to configure things + * The {@link rxjs!GlobalConfig | GlobalConfig} object for RxJS. It is used to configure things * like how to react on unhandled errors. */ export const config: GlobalConfig = { @@ -391,7 +391,7 @@ export const config: GlobalConfig = { /** * The global configuration object for RxJS, used to configure things - * like how to react on unhandled errors. Accessible via {@link config} + * like how to react on unhandled errors. Accessible via {@link rxjs!config | config} * object. */ export interface GlobalConfig { @@ -448,7 +448,7 @@ function overrideComplete(this: Subscriber): void { } class ConsumerObserver implements Observer { - constructor(private partialObserver: Partial>) {} + constructor(private partialObserver: Partial>) { } next(value: T): void { const { partialObserver } = this; @@ -514,7 +514,7 @@ export interface OperateConfig extends SubscriberOverrides { } /** - * Creates a new {@link Subscriber} instance that passes notifications on to the + * Creates a new {@link rxjs!Subscriber | Subscriber} instance that passes notifications on to the * supplied `destination`. The overrides provided in the `config` argument for * `next`, `error`, and `complete` will be called in such a way that any * errors are caught and forwarded to the destination's `error` handler. The returned @@ -547,6 +547,87 @@ declare global { /** * A representation of any set of values over any amount of time. This is the most basic building block * of RxJS. + * + * @example - Basic Subscription + * + * Subscribe with an {@link https://rxjs.dev/guide/observer | Observer} + * + * ```ts + * import { of } from 'rxjs'; + * + * const sumObserver = { + * sum: 0, + * next(value) { + * console.log('Adding: ' + value); + * this.sum = this.sum + value; + * }, + * error() { + * // We actually could just remove this method, + * // since we do not really care about errors right now. + * }, + * complete() { + * console.log('Sum equals: ' + this.sum); + * } + * }; + * + * of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes. + * .subscribe(sumObserver); + * + * // Logs: + * // 'Adding: 1' + * // 'Adding: 2' + * // 'Adding: 3' + * // 'Sum equals: 6' + * ``` + * + * Subscribe with functions ({@link https://rxjs.dev/deprecations/subscribe-arguments | deprecated}) + * + * ```ts + * import { of } from 'rxjs' + * + * let sum = 0; + * + * of(1, 2, 3).subscribe( + * value => { + * console.log('Adding: ' + value); + * sum = sum + value; + * }, + * undefined, + * () => console.log('Sum equals: ' + sum) + * ); + * + * // Logs: + * // 'Adding: 1' + * // 'Adding: 2' + * // 'Adding: 3' + * // 'Sum equals: 6' + * ``` + * + * Cancel a subscription + * + * ```ts + * import { interval } from 'rxjs'; + * + * const subscription = interval(1000).subscribe({ + * next(num) { + * console.log(num) + * }, + * complete() { + * // Will not be called, even when cancelling subscription. + * console.log('completed!'); + * } + * }); + * + * setTimeout(() => { + * subscription.unsubscribe(); + * console.log('unsubscribed!'); + * }, 2500); + * + * // Logs: + * // 0 after 1s + * // 1 after 2s + * // 'unsubscribed!' after 2.5s + * ``` */ export class Observable implements Subscribable { /** @@ -576,14 +657,14 @@ export class Observable implements Subscribable { * that an Observable emits, as well as for when it completes or errors. You can achieve this in two * of the following ways. * - * The first way is creating an object that implements {@link Observer} interface. It should have methods + * The first way is creating an object that implements {@link rxjs!Observer | Observer} interface. It should have methods * defined by that interface, but note that it should be just a regular JavaScript object, which you can create * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also * that your object does not have to implement all methods. If you find yourself creating a method that doesn't * do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens, * it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead, - * use the {@link onUnhandledError} configuration option or use a runtime handler (like `window.onerror` or + * use the {@link rxjs!GlobalConfig.onUnhandledError | onUnhandledError} configuration option or use a runtime handler (like `window.onerror` or * `process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide * an `error` method to avoid missing thrown errors. * @@ -603,92 +684,11 @@ export class Observable implements Subscribable { * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable. * * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously. - * It is an Observable itself that decides when these functions will be called. For example {@link of} + * It is an Observable itself that decides when these functions will be called. For example {@link rxjs!of | of} * by default emits all its values synchronously. Always check documentation for how given Observable * will behave when subscribed and if its default behavior can be modified with a `scheduler`. * - * #### Examples - * - * Subscribe with an {@link guide/observer Observer} - * - * ```ts - * import { of } from 'rxjs'; - * - * const sumObserver = { - * sum: 0, - * next(value) { - * console.log('Adding: ' + value); - * this.sum = this.sum + value; - * }, - * error() { - * // We actually could just remove this method, - * // since we do not really care about errors right now. - * }, - * complete() { - * console.log('Sum equals: ' + this.sum); - * } - * }; - * - * of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes. - * .subscribe(sumObserver); - * - * // Logs: - * // 'Adding: 1' - * // 'Adding: 2' - * // 'Adding: 3' - * // 'Sum equals: 6' - * ``` - * - * Subscribe with functions ({@link deprecations/subscribe-arguments deprecated}) - * - * ```ts - * import { of } from 'rxjs' - * - * let sum = 0; - * - * of(1, 2, 3).subscribe( - * value => { - * console.log('Adding: ' + value); - * sum = sum + value; - * }, - * undefined, - * () => console.log('Sum equals: ' + sum) - * ); - * - * // Logs: - * // 'Adding: 1' - * // 'Adding: 2' - * // 'Adding: 3' - * // 'Sum equals: 6' - * ``` - * - * Cancel a subscription - * - * ```ts - * import { interval } from 'rxjs'; - * - * const subscription = interval(1000).subscribe({ - * next(num) { - * console.log(num) - * }, - * complete() { - * // Will not be called, even when cancelling subscription. - * console.log('completed!'); - * } - * }); - * - * setTimeout(() => { - * subscription.unsubscribe(); - * console.log('unsubscribed!'); - * }, 2500); - * - * // Logs: - * // 0 after 1s - * // 1 after 2s - * // 'unsubscribed!' after 2.5s - * ``` - * - * @param observerOrNext Either an {@link Observer} with some or all callback methods, + * @param observerOrNext Either an {@link rxjs!Observer | Observer} with some or all callback methods, * or the `next` handler that is called for each value emitted from the subscribed Observable. * @return A subscription reference to the registered handlers. */ @@ -717,10 +717,10 @@ export class Observable implements Subscribable { * **WARNING**: Only use this with observables you *know* will complete. If the source * observable does not complete, you will end up with a promise that is hung up, and * potentially all of the state of an async function hanging out in memory. To avoid - * this situation, look into adding something like {@link timeout}, {@link take}, - * {@link takeWhile}, or {@link takeUntil} amongst others. + * this situation, look into adding something like {@link rxjs!timeout | timeout}, {@link rxjs!take | take}, + * {@link rxjs!takeWhile | takeWhile}, or {@link rxjs!takeUntil | takeUntil} amongst others. * - * #### Example + * @example * * ```ts * import { interval, take } from 'rxjs'; @@ -863,7 +863,7 @@ export class Observable implements Subscribable { /** * Used to stitch together functional operators into a chain. * - * ## Example + * @example * * ```ts * import { interval, filter, map, scan } from 'rxjs'; @@ -893,13 +893,13 @@ export class Observable implements Subscribable { * cancel the subscription. Note that the subscription to the observable does not start * until the first value is requested from the AsyncIterable. * - * Functionally, this is equivalent to using a {@link concatMap} with an `async` function. + * Functionally, this is equivalent to using a {@link rxjs!concatMap | concatMap} with an `async` function. * That means that while the body of the `for await` loop is executing, any values that arrive * from the observable source will be queued up, so they can be processed by the `for await` - * loop in order. So, like {@link concatMap} it's important to understand the speed your + * loop in order. So, like {@link rxjs!concatMap | concatMap} it's important to understand the speed your * source emits at, and the speed of the body of your `for await` loop. * - * ## Example + * @example * * ```ts * import { interval } from 'rxjs'; @@ -1012,7 +1012,7 @@ function pipeReducer(prev: any, fn: UnaryFunction) { } /** - * Handles an error on another job either with the user-configured {@link onUnhandledError}, + * Handles an error on another job either with the user-configured {@link rxjs!GlobalConfig.onUnhandledError | onUnhandledError}, * or by throwing it on that new job so it can be picked up by `window.onerror`, `process.on('error')`, etc. * * This should be called whenever there is an error that is out-of-band with the subscription @@ -1038,7 +1038,7 @@ export function reportUnhandledError(err: any) { * * Converts almost anything to an Observable. * - * ![](from.png) + * ![](/images/marble-diagrams/from.png) * * `from` converts various other objects and data types into Observables. It also converts a Promise, an array-like, or an * iterable @@ -1046,7 +1046,7 @@ export function reportUnhandledError(err: any) { * as an array of characters. Observable-like objects (contains a function named with the ES2015 Symbol for Observable) can also be * converted through this operator. * - * ## Examples + * @example * * Converts an array to an Observable * @@ -1095,8 +1095,8 @@ export function reportUnhandledError(err: any) { * // 1536 * ``` * - * @see {@link fromEvent} - * @see {@link fromEventPattern} + * @see {@link rxjs!fromEvent | fromEvent} + * @see {@link rxjs!fromEventPattern | fromEventPattern} * @see {@link scheduled} * * @param input A subscription object, a Promise, an Observable-like, @@ -1261,8 +1261,7 @@ export function getObservableInputType(input: unknown): ObservableInputType { return ObservableInputType.ReadableStreamLike; } throw new TypeError( - `You provided ${ - input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'` + `You provided ${input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'` } where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.` ); } @@ -1323,7 +1322,7 @@ export function isArrayLike(x: any): x is ArrayLike { } /** - * Tests to see if the object is an RxJS {@link Observable} + * Tests to see if the object is an RxJS {@link rxjs!Observable | Observable} * @param obj the object to test */ export function isObservable(obj: any): obj is Observable { diff --git a/packages/observable/src/types.ts b/packages/observable/src/types.ts index 8109e31b70..0ffab6c9d7 100644 --- a/packages/observable/src/types.ts +++ b/packages/observable/src/types.ts @@ -19,24 +19,24 @@ declare global { * A function type interface that describes a function that accepts one parameter `T` * and returns another parameter `R`. * - * Usually used to describe {@link OperatorFunction} - it always takes a single + * Usually used to describe {@link rxjs!OperatorFunction | OperatorFunction} - it always takes a single * parameter (the source Observable) and returns another Observable. */ export interface UnaryFunction { (source: T): R; } -export interface OperatorFunction extends UnaryFunction, Observable> {} +export interface OperatorFunction extends UnaryFunction, Observable> { } export type FactoryOrValue = T | (() => T); /** * A function type interface that describes a function that accepts and returns a parameter of the same type. * - * Used to describe {@link OperatorFunction} with the only one type: `OperatorFunction`. + * Used to describe {@link rxjs!OperatorFunction | OperatorFunction} with the only one type: `OperatorFunction`. * */ -export interface MonoTypeOperatorFunction extends OperatorFunction {} +export interface MonoTypeOperatorFunction extends OperatorFunction { } /** * A value and the time at which it was emitted. @@ -114,7 +114,7 @@ export interface InteropObservable { /** * A notification representing a "next" from an observable. - * Can be used with {@link dematerialize}. + * Can be used with {@link rxjs!dematerialize | dematerialize}. */ export interface NextNotification { /** The kind of notification. Always "N" */ @@ -125,7 +125,7 @@ export interface NextNotification { /** * A notification representing an "error" from an observable. - * Can be used with {@link dematerialize}. + * Can be used with {@link rxjs!dematerialize | dematerialize}. */ export interface ErrorNotification { /** The kind of notification. Always "E" */ @@ -135,7 +135,7 @@ export interface ErrorNotification { /** * A notification representing a "completion" from an observable. - * Can be used with {@link dematerialize}. + * Can be used with {@link rxjs!dematerialize | dematerialize}. */ export interface CompleteNotification { kind: 'C'; @@ -173,10 +173,10 @@ export type PartialObserver = NextObserver | ErrorObserver | Completion /** * An object interface that defines a set of callback functions a user can use to get - * notified of any set of {@link Observable} - * {@link guide/glossary-and-semantics#notification notification} events. + * notified of any set of {@link rxjs!Observable | Observable} + * {@link https://rxjs.dev/guide/glossary-and-semantics#notification | notification} events. * - * For more info, please refer to {@link guide/observer this guide}. + * For more info, please refer to {@link https://rxjs.dev/guide/observer | this guide}. */ export interface Observer { /** @@ -184,7 +184,7 @@ export interface Observer { * the producer "has" the `value`. It won't be called if `error` or `complete` callback * functions have been called, nor after the consumer has unsubscribed. * - * For more info, please refer to {@link guide/glossary-and-semantics#next this guide}. + * For more info, please refer to {@link https://rxjs.dev/guide/glossary-and-semantics#next this | guide}. */ next: (value: T) => void; /** @@ -194,7 +194,7 @@ export interface Observer { * `complete` callback function have been called previously, nor it can't be called if * the consumer has unsubscribed. * - * For more info, please refer to {@link guide/glossary-and-semantics#error this guide}. + * For more info, please refer to {@link https://rxjs.dev/guide/glossary-and-semantics#error this | guide}. */ error: (err: any) => void; /** @@ -204,12 +204,12 @@ export interface Observer { * if the `error` callback function have been called previously, nor it can't be called * if the consumer has unsubscribed. * - * For more info, please refer to {@link guide/glossary-and-semantics#complete this guide}. + * For more info, please refer to {@link https://rxjs.dev/guide/glossary-and-semantics#complete this | guide}. */ complete: () => void; } -export interface SubjectLike extends Observer, Subscribable {} +export interface SubjectLike extends Observer, Subscribable { } /* SCHEDULER INTERFACES */ @@ -262,7 +262,7 @@ export type ObservedValueUnionFromArray = X extends Array = { [K in keyof X]: ObservedValueOf }; /** - * Used to infer types from arguments to functions like {@link forkJoin}. + * Used to infer types from arguments to functions like {@link rxjs!forkJoin | forkJoin}. * So that you can have `forkJoin([Observable, PromiseLike]): Observable<[A, B]>` * et al. */ @@ -296,14 +296,14 @@ export type Tail = ((...args: X) => any) extends (arg: export type ValueFromArray = A extends Array ? T : never; /** - * Gets the value type from an {@link ObservableNotification}, if possible. + * Gets the value type from an {@link rxjs!ObservableNotification | ObservableNotification}, if possible. */ export type ValueFromNotification = T extends { kind: 'N' | 'E' | 'C' } ? T extends NextNotification - ? T extends { value: infer V } - ? V - : undefined - : never + ? T extends { value: infer V } + ? V + : undefined + : never : never; /** @@ -318,7 +318,7 @@ export type TruthyTypesOf = T extends Falsy ? never : T; /** * The base signature RxJS will look for to identify and use * a [ReadableStream](https://streams.spec.whatwg.org/#rs-class) - * as an {@link ObservableInput} source. + * as an {@link rxjs!ObservableInput | ObservableInput} source. */ export type ReadableStreamLike = Pick, 'getReader'>; @@ -329,7 +329,7 @@ export type ReadableStreamLike = Pick, 'getReader'>; export interface Connectable extends Observable { /** * (Idempotent) Calling this method will connect the underlying source observable to all subscribed consumers - * through an underlying {@link Subject}. + * through an underlying {@link rxjs!Subject | Subject}. * @returns A subscription, that when unsubscribed, will "disconnect" the source from the connector subject, * severing notifications to all consumers. */ diff --git a/packages/rxjs/src/ajax/index.ts b/packages/rxjs/src/ajax/index.ts index e41bcfa3a2..e1e5861b4f 100644 --- a/packages/rxjs/src/ajax/index.ts +++ b/packages/rxjs/src/ajax/index.ts @@ -1,3 +1,6 @@ +/** + * @module ajax + */ export { ajax } from '../internal/ajax/ajax.js'; export { AjaxError, AjaxTimeoutError } from '../internal/ajax/errors.js'; export { AjaxResponse } from '../internal/ajax/AjaxResponse.js'; diff --git a/packages/rxjs/src/fetch/index.ts b/packages/rxjs/src/fetch/index.ts index 4a18486b4a..7dad917e3e 100644 --- a/packages/rxjs/src/fetch/index.ts +++ b/packages/rxjs/src/fetch/index.ts @@ -1 +1,32 @@ +/** + * The module for the RxJS DOM Fetch API. + * + * This is exported separately from the RxJS core API to avoid bringing DOM types into Node.js projects. + * + * @example + * ```ts + * import { fromFetch } from 'rxjs/fetch'; + * import { switchMap, of, catchError } from 'rxjs'; + * + * const data$ = fromFetch('https://api.github.com/users?per_page=5').pipe( + * switchMap(response => { + * if (response.ok) { + * return response.json(); + * } + * }), + * catchError(err => { + * console.error(err); + * return of({ error: true, message: err.message }); + * }) + * ); + * + * data$.subscribe(result => console.log(result)); + * + * // Output: + * // { name: 'John Doe', email: 'john.doe@example.com' } + * ``` + * + * @packageDocumentation + * @module fetch + */ export { fromFetch } from '../internal/observable/dom/fetch.js'; diff --git a/packages/rxjs/src/index.ts b/packages/rxjs/src/index.ts index a401275ffd..2313616219 100644 --- a/packages/rxjs/src/index.ts +++ b/packages/rxjs/src/index.ts @@ -1,3 +1,7 @@ +/** + * @module rxjs + */ + ////////////////////////////////////////////////////////// // Here we need to reference our other deep imports // so VS code will figure out where they are diff --git a/packages/rxjs/src/internal/ajax/AjaxResponse.ts b/packages/rxjs/src/internal/ajax/AjaxResponse.ts index 08554068cb..0d61160aed 100644 --- a/packages/rxjs/src/internal/ajax/AjaxResponse.ts +++ b/packages/rxjs/src/internal/ajax/AjaxResponse.ts @@ -32,15 +32,15 @@ export class AjaxResponse { /** * The total number of bytes loaded so far. To be used with {@link total} while - * calculating progress. (You will want to set {@link includeDownloadProgress} or - * {@link includeDownloadProgress}) + * calculating progress. (You will want to set {@link AjaxConfig.includeDownloadProgress | AjaxConfig.includeDownloadProgress}} or + * {@link AjaxConfig.includeDownloadProgress | AjaxConfig.includeDownloadProgress}}) */ readonly loaded: number; /** * The total number of bytes to be loaded. To be used with {@link loaded} while - * calculating progress. (You will want to set {@link includeDownloadProgress} or - * {@link includeDownloadProgress}) + * calculating progress. (You will want to set {@link AjaxConfig.includeDownloadProgress | AjaxConfig.includeDownloadProgress}} or + * {@link AjaxConfig.includeDownloadProgress | AjaxConfig.includeDownloadProgress}}) */ readonly total: number; @@ -78,8 +78,8 @@ export class AjaxResponse { public readonly request: AjaxRequest, /** * The event type. This can be used to discern between different events - * if you're using progress events with {@link includeDownloadProgress} or - * {@link includeUploadProgress} settings in {@link AjaxConfig}. + * if you're using progress events with {@link AjaxConfig.includeDownloadProgress | AjaxConfig.includeDownloadProgress}} or + * {@link AjaxConfig.includeUploadProgress | AjaxConfig.includeUploadProgress}} settings in {@link AjaxConfig}. * * The event type consists of two parts: the {@link AjaxDirection} and the * the event type. Merged with `_`, they form the `type` string. The @@ -105,14 +105,14 @@ export class AjaxResponse { const allHeaders = xhr.getAllResponseHeaders(); this.responseHeaders = allHeaders ? // Split the header text into lines - allHeaders.split('\n').reduce((headers: Record, line) => { - // Split the lines on the first ": " as - // "key: value". Note that the value could - // technically have a ": " in it. - const index = line.indexOf(': '); - headers[line.slice(0, index)] = line.slice(index + 2); - return headers; - }, {}) + allHeaders.split('\n').reduce((headers: Record, line) => { + // Split the lines on the first ": " as + // "key: value". Note that the value could + // technically have a ": " in it. + const index = line.indexOf(': '); + headers[line.slice(0, index)] = line.slice(index + 2); + return headers; + }, {}) : {}; this.response = xhr.response; diff --git a/packages/rxjs/src/internal/ajax/ajax.ts b/packages/rxjs/src/internal/ajax/ajax.ts index 0ee3fae22e..9d86e40cdc 100644 --- a/packages/rxjs/src/internal/ajax/ajax.ts +++ b/packages/rxjs/src/internal/ajax/ajax.ts @@ -12,7 +12,7 @@ export interface AjaxCreationMethod { * * This is the most configurable option, and the basis for all other AJAX calls in the library. * - * ## Example + * @example * * ```ts * import { ajax } from 'rxjs/ajax'; @@ -38,7 +38,7 @@ export interface AjaxCreationMethod { * [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) in * global scope. Defaults to a `responseType` of `"json"`. * - * ## Example + * @example * * ```ts * import { ajax } from 'rxjs/ajax'; @@ -173,7 +173,7 @@ function ajaxGetJSON(url: string, headers?: Record): Observab * It creates an observable for an Ajax request with either a request object with * url, headers, etc or a string for a URL. * - * ## Examples + * @example * * Using `ajax()` to fetch the response object that is being returned from API * @@ -270,8 +270,8 @@ export const ajax: AjaxCreationMethod = (() => { const config: AjaxConfig = typeof urlOrConfig === 'string' ? { - url: urlOrConfig, - } + url: urlOrConfig, + } : urlOrConfig; return fromAjax(config); }; diff --git a/packages/rxjs/src/internal/ajax/errors.ts b/packages/rxjs/src/internal/ajax/errors.ts index da7809a2dc..2411424b1b 100644 --- a/packages/rxjs/src/internal/ajax/errors.ts +++ b/packages/rxjs/src/internal/ajax/errors.ts @@ -51,7 +51,7 @@ export class AjaxError extends Error { } /** - * Thrown when an AJAX request times out. Not to be confused with {@link TimeoutError}. + * Thrown when an AJAX request times out. Not to be confused with {@link rxjs!TimeoutError | TimeoutError}. * * This is exported only because it is useful for checking to see if errors are an * `instanceof AjaxTimeoutError`. DO NOT use the constructor to create an instance of diff --git a/packages/rxjs/src/internal/ajax/types.ts b/packages/rxjs/src/internal/ajax/types.ts index 2886a04a46..67d999a1e0 100644 --- a/packages/rxjs/src/internal/ajax/types.ts +++ b/packages/rxjs/src/internal/ajax/types.ts @@ -193,7 +193,7 @@ export interface AjaxConfig { * This will **not** error for errored status codes. Rather, it will always _complete_ when * the HTTP response comes back. * - * @deprecated If you're looking for progress events, use {@link includeDownloadProgress} and + * @deprecated If you're looking for progress events, use {@link AjaxConfig.includeDownloadProgress | AjaxConfig.includeDownloadProgress}} and * {@link includeUploadProgress} instead. Will be removed in v8. */ progressSubscriber?: PartialObserver; @@ -211,7 +211,7 @@ export interface AjaxConfig { * If `true`, will emit all upload progress and load complete events as {@link AjaxResponse} * from the observable. The final download event will also be emitted as a {@link AjaxResponse}. * - * If both this and {@link includeDownloadProgress} are `false`, then only the {@link AjaxResponse} will + * If both this and {@link AjaxConfig.includeDownloadProgress | AjaxConfig.includeDownloadProgress}} are `false`, then only the {@link AjaxResponse} will * be emitted from the resulting observable. */ includeUploadProgress?: boolean; @@ -228,8 +228,8 @@ export interface AjaxConfig { * with queryParams of `{ b: 5, c: 6 }` will result in a url of roughly `/test?a=1&b=5&c=6`. */ queryParams?: - | string - | URLSearchParams - | Record - | [string, string | number | boolean | string[] | number[] | boolean[]][]; + | string + | URLSearchParams + | Record + | [string, string | number | boolean | string[] | number[] | boolean[]][]; } diff --git a/packages/rxjs/src/internal/firstValueFrom.ts b/packages/rxjs/src/internal/firstValueFrom.ts index 16b11fece2..2f8df64c35 100644 --- a/packages/rxjs/src/internal/firstValueFrom.ts +++ b/packages/rxjs/src/internal/firstValueFrom.ts @@ -1,4 +1,4 @@ -import type { Observable} from '@rxjs/observable'; +import type { Observable } from '@rxjs/observable'; import { Subscriber } from '@rxjs/observable'; import { EmptyError } from './util/EmptyError.js'; @@ -28,7 +28,7 @@ export function firstValueFrom(source: Observable): Promise; * something like {@link timeout}, {@link take}, {@link takeWhile}, or {@link takeUntil} * amongst others. * - * ## Example + * @example * * Wait for the first value from a stream and emit it from a promise in * an async function diff --git a/packages/rxjs/src/internal/lastValueFrom.ts b/packages/rxjs/src/internal/lastValueFrom.ts index ae68c1f6eb..19d89c7fb0 100644 --- a/packages/rxjs/src/internal/lastValueFrom.ts +++ b/packages/rxjs/src/internal/lastValueFrom.ts @@ -26,7 +26,7 @@ export function lastValueFrom(source: Observable): Promise; * this situation, look into adding something like {@link timeout}, {@link take}, * {@link takeWhile}, or {@link takeUntil} amongst others. * - * ## Example + * @example * * Wait for the last value from a stream and emit it from a promise in * an async function diff --git a/packages/rxjs/src/internal/observable/bindCallback.ts b/packages/rxjs/src/internal/observable/bindCallback.ts index 41c90e7fb6..7ace0f5060 100644 --- a/packages/rxjs/src/internal/observable/bindCallback.ts +++ b/packages/rxjs/src/internal/observable/bindCallback.ts @@ -69,7 +69,7 @@ export function bindCallback>>( * computes a formula using the latest values from all the inputs, then emits * the output of that formula. * - * ![](combineLatest.png) + * ![](/images/marble-diagrams/combineLatest.png) * * `combineLatest` combines the values from all the Observables passed in the * observables array. This is done by subscribing to each Observable in order and, @@ -77,7 +77,7 @@ export function combineLatest>>( * emitted value. On the other hand, if any Observable errors, `combineLatest` * will error immediately as well, and all other Observables will be unsubscribed. * - * ## Examples + * @example * * Combine two timer Observables * @@ -187,8 +187,8 @@ export function combineLatest, R>( keys ? (values: any[]) => createObject(keys, values) : resultSelector - ? (values: readonly any[]) => resultSelector(...values) - : identity + ? (values: readonly any[]) => resultSelector(...values) + : identity ) ); } diff --git a/packages/rxjs/src/internal/observable/concat.ts b/packages/rxjs/src/internal/observable/concat.ts index 4bda7f68df..e156403158 100644 --- a/packages/rxjs/src/internal/observable/concat.ts +++ b/packages/rxjs/src/internal/observable/concat.ts @@ -1,4 +1,4 @@ -import type { Observable} from '@rxjs/observable'; +import type { Observable } from '@rxjs/observable'; import { from } from '@rxjs/observable'; import type { ObservableInputTuple, SchedulerLike } from '../types.js'; import { concatAll } from '../operators/concatAll.js'; @@ -17,7 +17,7 @@ export function concat( * Concatenates multiple Observables together by * sequentially emitting their values, one Observable after the other. * - * ![](concat.png) + * ![](/images/marble-diagrams/concat.png) * * `concat` joins multiple Observables together, by subscribing to them one at a time and * merging their results into the output Observable. You can pass either an array of @@ -47,7 +47,7 @@ export function concat( * as many times as you like. If passing the same Observable to `concat` 1000 times becomes tedious, * you can always use {@link repeat}. * - * ## Examples + * @example * * Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10 * diff --git a/packages/rxjs/src/internal/observable/defer.ts b/packages/rxjs/src/internal/observable/defer.ts index bc7469f01d..bfbfc1a1e6 100644 --- a/packages/rxjs/src/internal/observable/defer.ts +++ b/packages/rxjs/src/internal/observable/defer.ts @@ -9,7 +9,7 @@ import type { ObservedValueOf, ObservableInput } from '../types.js'; * is subscribed. * * - * ![](defer.png) + * ![](/images/marble-diagrams/defer.png) * * `defer` allows you to create an Observable only when the Observer * subscribes. It waits until an Observer subscribes to it, calls the given @@ -18,7 +18,7 @@ import type { ObservedValueOf, ObservableInput } from '../types.js'; * Last but not least, an exception during the factory function call is * transferred to the Observer by calling `error`. * - * ## Example + * @example * * Subscribe to either an Observable of clicks or an Observable of interval, at random * diff --git a/packages/rxjs/src/internal/observable/dom/WebSocketSubject.ts b/packages/rxjs/src/internal/observable/dom/WebSocketSubject.ts index 943e22a51e..b1c6da65b2 100644 --- a/packages/rxjs/src/internal/observable/dom/WebSocketSubject.ts +++ b/packages/rxjs/src/internal/observable/dom/WebSocketSubject.ts @@ -1,4 +1,4 @@ -import type { Subscriber, Subscription} from '@rxjs/observable'; +import type { Subscriber, Subscription } from '@rxjs/observable'; import { Observable, operate } from '@rxjs/observable'; import type { NextObserver } from '../../types.js'; @@ -16,7 +16,7 @@ import type { NextObserver } from '../../types.js'; * to the socket client. By default, `deserializer` is going to apply `JSON.parse` to each message coming * from the Server. * - * ## Examples + * @example * * **deserializer**, the default for this property is `JSON.parse` but since there are just two options * for incoming data, either be text or binary data. We can apply a custom deserialization strategy @@ -134,7 +134,7 @@ export interface WebSocketSubjectConfig { * WebSocket impl in Node (WebSocket is a DOM API), or for mocking a WebSocket * for testing purposes */ - WebSocketCtor?: { new (url: string, protocols?: string | string[]): WebSocket }; + WebSocketCtor?: { new(url: string, protocols?: string | string[]): WebSocket }; /** Sets the `binaryType` property of the underlying WebSocket. */ binaryType?: 'blob' | 'arraybuffer'; } diff --git a/packages/rxjs/src/internal/observable/dom/animationFrames.ts b/packages/rxjs/src/internal/observable/dom/animationFrames.ts index e58ac6b357..027effee3f 100644 --- a/packages/rxjs/src/internal/observable/dom/animationFrames.ts +++ b/packages/rxjs/src/internal/observable/dom/animationFrames.ts @@ -18,7 +18,7 @@ import { animationFrameProvider } from '../../scheduler/animationFrameProvider.j * * This is useful for setting up animations with RxJS. * - * ## Examples + * @example * * Tweening a div to move it on the screen * diff --git a/packages/rxjs/src/internal/observable/dom/fetch.ts b/packages/rxjs/src/internal/observable/dom/fetch.ts index c0c26cadd9..74522a3323 100644 --- a/packages/rxjs/src/internal/observable/dom/fetch.ts +++ b/packages/rxjs/src/internal/observable/dom/fetch.ts @@ -14,8 +14,10 @@ export function fromFetch(input: string | Request, init?: RequestInit): Observab * Uses [the Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to * make an HTTP request. * - * **WARNING** Parts of the fetch API are still experimental. `AbortController` is + * :::warning + * Parts of the fetch API are still experimental. `AbortController` is * required for this implementation to work and use cancellation appropriately. + * ::: * * Will automatically set up an internal [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) * in order to finalize the internal `fetch` when the subscription tears down. @@ -24,9 +26,8 @@ export function fromFetch(input: string | Request, init?: RequestInit): Observab * `fetch`. If the provided `signal` aborts, the error that `fetch` normally rejects with * in that scenario will be emitted as an error from the observable. * - * ## Examples - * - * Basic use + * @example + * ### Basic use * * ```ts * import { fromFetch } from 'rxjs/fetch'; @@ -55,6 +56,7 @@ export function fromFetch(input: string | Request, init?: RequestInit): Observab * }); * ``` * + * @example * ### Use with Chunked Transfer Encoding * * With HTTP responses that use [chunked transfer encoding](https://tools.ietf.org/html/rfc7230#section-3.3.1), @@ -84,11 +86,10 @@ export function fromFetch(input: string | Request, init?: RequestInit): Observab * }); * ``` * - * @param input The resource you would like to fetch. Can be a url or a request object. - * @param initWithSelector A configuration object for the fetch. - * [See MDN for more details](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters) - * @returns An Observable, that when subscribed to, performs an HTTP request using the native `fetch` - * function. The {@link Subscription} is tied to an `AbortController` for the fetch. + * @param input - The resource you would like to fetch. Can be a url or a request object. + * @param initWithSelector - A configuration object for the fetch. [See MDN for more details](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters) + * @returns Observable - An Observable, that when subscribed to, performs an HTTP request using the native `fetch` + * function. The {@link rxjs!Subscription | Subscription} is tied to an `AbortController` for the fetch. */ export function fromFetch( input: string | Request, diff --git a/packages/rxjs/src/internal/observable/dom/webSocket.ts b/packages/rxjs/src/internal/observable/dom/webSocket.ts index a4c10773b8..090f1bd88a 100644 --- a/packages/rxjs/src/internal/observable/dom/webSocket.ts +++ b/packages/rxjs/src/internal/observable/dom/webSocket.ts @@ -4,7 +4,7 @@ import { WebSocketSubject } from './WebSocketSubject.js'; /** * Wrapper around the w3c-compatible WebSocket object provided by the browser. * - * {@link Subject} that communicates with a server via WebSocket + * {@link rxjs!Subject | Subject} that communicates with a server via WebSocket * * `webSocket` is a factory function that produces a `WebSocketSubject`, * which can be used to make WebSocket connection with an arbitrary endpoint. @@ -27,7 +27,7 @@ import { WebSocketSubject } from './WebSocketSubject.js'; * any errors. If at any point (starting, maintaining or closing a connection) there is an error, * stream will also error with whatever WebSocket API has thrown. * - * By virtue of being a {@link Subject}, `WebSocketSubject` allows for receiving and sending messages from the server. In order + * By virtue of being a {@link rxjs!Subject | Subject}, `WebSocketSubject` allows for receiving and sending messages from the server. In order * to communicate with a connected endpoint, use `next`, `error` and `complete` methods. `next` sends a value to the server, so bear in mind * that this value will not be serialized beforehand. Because of This, `JSON.stringify` will have to be called on a value by hand, * before calling `next` with a result. Note also that if at the moment of nexting value @@ -71,7 +71,7 @@ import { WebSocketSubject } from './WebSocketSubject.js'; * as messages pushed via `next`. Also bear in mind that these messages will be sent on *every* subscription and * unsubscription. This is potentially dangerous, because one consumer of an Observable may unsubscribe and the server * might stop sending messages, since it got unsubscription message. This needs to be handled - * on the server or using {@link connectable} on a Observable returned from 'multiplex'. + * on the server or using {@link rxjs!connectable | connectable} on a Observable returned from 'multiplex'. * * Last argument to `multiplex` is a `messageFilter` function which should return a boolean. It is used to filter out messages * sent by the server to only those that belong to simulated WebSocket stream. For example, server might mark these @@ -83,7 +83,7 @@ import { WebSocketSubject } from './WebSocketSubject.js'; * is not a `WebSocketSubject`, so calling `next` or `multiplex` again will fail. For pushing values to the * server, use root `WebSocketSubject`. * - * ## Examples + * @example * * Listening for messages from the server * diff --git a/packages/rxjs/src/internal/observable/empty.ts b/packages/rxjs/src/internal/observable/empty.ts index 9fba94f0f1..626743fc3f 100644 --- a/packages/rxjs/src/internal/observable/empty.ts +++ b/packages/rxjs/src/internal/observable/empty.ts @@ -6,12 +6,12 @@ import { Observable } from '@rxjs/observable'; * * Just emits 'complete', and nothing else. * - * ![](empty.png) + * ![](/images/marble-diagrams/empty.png) * * A simple Observable that only emits the complete notification. It can be used * for composing with other Observables, such as in a {@link mergeMap}. * - * ## Examples + * @example * * Log complete notification * diff --git a/packages/rxjs/src/internal/observable/forkJoin.ts b/packages/rxjs/src/internal/observable/forkJoin.ts index adfab7bfe0..d86a08d694 100644 --- a/packages/rxjs/src/internal/observable/forkJoin.ts +++ b/packages/rxjs/src/internal/observable/forkJoin.ts @@ -53,7 +53,7 @@ export function forkJoin>>( * Wait for Observables to complete and then combine last values they emitted; * complete immediately if an empty array is passed. * - * ![](forkJoin.png) + * ![](/images/marble-diagrams/forkJoin.png) * * `forkJoin` is an operator that takes any number of input observables which can be passed either as an array * or a dictionary of input observables. If no input observables are provided (e.g. an empty array is passed), @@ -91,7 +91,7 @@ export function forkJoin>>( * all its arguments and puts them into an array. Note that the `resultSelector` will be called only * when `forkJoin` is supposed to emit a result. * - * ## Examples + * @example * * Use `forkJoin` with a dictionary of observable inputs * diff --git a/packages/rxjs/src/internal/observable/fromEvent.ts b/packages/rxjs/src/internal/observable/fromEvent.ts index 057064a477..a8df9a7de5 100644 --- a/packages/rxjs/src/internal/observable/fromEvent.ts +++ b/packages/rxjs/src/internal/observable/fromEvent.ts @@ -117,7 +117,7 @@ export function fromEvent( * Creates an Observable from DOM events, or Node.js * EventEmitter events or others. * - * ![](fromEvent.png) + * ![](/images/marble-diagrams/fromEvent.png) * * `fromEvent` accepts as a first argument event target, which is an object with methods * for registering event handler functions. As a second argument it takes string that indicates @@ -185,7 +185,7 @@ export function fromEvent( * installed and removed in each of elements. * * - * ## Examples + * @example * * Emit clicks happening on the DOM document * @@ -297,10 +297,10 @@ function getRegistryMethodNames(target: any) { ? eventTargetMethods : // In all other cases, the call pattern is identical with the exception of the method names. isNodeStyleEventEmitter(target) - ? nodeEventEmitterMethods - : isJQueryStyleEventEmitter(target) - ? jqueryMethods - : []; + ? nodeEventEmitterMethods + : isJQueryStyleEventEmitter(target) + ? jqueryMethods + : []; } /** diff --git a/packages/rxjs/src/internal/observable/fromEventPattern.ts b/packages/rxjs/src/internal/observable/fromEventPattern.ts index 2d28d796d3..cf6d301d8a 100644 --- a/packages/rxjs/src/internal/observable/fromEventPattern.ts +++ b/packages/rxjs/src/internal/observable/fromEventPattern.ts @@ -18,7 +18,7 @@ export function fromEventPattern( * When that method for adding event handler was something {@link fromEvent} * was not prepared for. * - * ![](fromEventPattern.png) + * ![](/images/marble-diagrams/fromEventPattern.png) * * `fromEventPattern` allows you to convert into an Observable any API that supports registering handler functions * for events. It is similar to {@link fromEvent}, but far @@ -57,7 +57,7 @@ export function fromEventPattern( * that default project can be thought of as function that takes its first parameter * and ignores the rest. * - * ## Examples + * @example * * Emits clicks happening on the DOM document * diff --git a/packages/rxjs/src/internal/observable/generate.ts b/packages/rxjs/src/internal/observable/generate.ts index 6f9d43c21d..1efa85321b 100644 --- a/packages/rxjs/src/internal/observable/generate.ts +++ b/packages/rxjs/src/internal/observable/generate.ts @@ -43,9 +43,9 @@ export interface GenerateOptions extends GenerateBaseOptions { * producing the sequence's elements, using the specified scheduler * to send out observer messages. * - * ![](generate.png) + * ![](/images/marble-diagrams/generate.png) * - * ## Examples + * @example * * Produces sequence of numbers * @@ -104,7 +104,7 @@ export function generate( * * Use it instead of nexting values in a for loop. * - * ![](generate.png) + * ![](/images/marble-diagrams/generate.png) * * `generate` allows you to create a stream of values generated with a loop very similar to * a traditional for loop. The first argument of `generate` is a beginning value. The second argument @@ -142,7 +142,7 @@ export function generate( * by default (when no scheduler is passed) values are simply emitted synchronously. * * - * ## Examples + * @example * * Use with condition and iterate functions * @@ -255,9 +255,9 @@ export function generate( * The overload accepts options object that might contain initial state, iterate, * condition and scheduler. * - * ![](generate.png) + * ![](/images/marble-diagrams/generate.png) * - * ## Examples + * @example * * Use options object with condition function * @@ -297,9 +297,9 @@ export function generate(options: GenerateBaseOptions): Observable; * The overload accepts options object that might contain initial state, iterate, * condition, result selector and scheduler. * - * ![](generate.png) + * ![](/images/marble-diagrams/generate.png) * - * ## Examples + * @example * * Use options object with condition and iterate function * @@ -378,10 +378,10 @@ export function generate( return defer( (scheduler ? // If a scheduler was provided, use `scheduleIterable` to ensure that iteration/generation - // happens on the scheduler. - () => scheduleIterable(gen(), scheduler!) + // happens on the scheduler. + () => scheduleIterable(gen(), scheduler!) : // Otherwise, if there's no scheduler, we can just use the generator function directly in - // `defer` and executing it will return the generator (which is iterable). - gen) as () => ObservableInput + // `defer` and executing it will return the generator (which is iterable). + gen) as () => ObservableInput ); } diff --git a/packages/rxjs/src/internal/observable/iif.ts b/packages/rxjs/src/internal/observable/iif.ts index 2ac645666a..6dfa3ecc9d 100644 --- a/packages/rxjs/src/internal/observable/iif.ts +++ b/packages/rxjs/src/internal/observable/iif.ts @@ -14,7 +14,7 @@ import type { ObservableInput } from '../types.js'; * * If you need to check more than two options to choose between more than one observable, have a look at the {@link defer} creation method. * - * ## Examples + * @example * * Change at runtime which Observable will be subscribed * diff --git a/packages/rxjs/src/internal/observable/interval.ts b/packages/rxjs/src/internal/observable/interval.ts index b175c3cc26..21d48e4b96 100644 --- a/packages/rxjs/src/internal/observable/interval.ts +++ b/packages/rxjs/src/internal/observable/interval.ts @@ -9,7 +9,7 @@ import { timer } from './timer.js'; * * Emits incremental numbers periodically in time. * - * ![](interval.png) + * ![](/images/marble-diagrams/interval.png) * * `interval` returns an Observable that emits an infinite sequence of * ascending integers, with a constant interval of time of your choosing @@ -18,7 +18,7 @@ import { timer } from './timer.js'; * `asyncScheduler` {@link SchedulerLike} to provide a notion of time, but you may pass any * {@link SchedulerLike} to it. * - * ## Example + * @example * * Emits ascending numbers, one every second (1000ms) up to the number 3 * diff --git a/packages/rxjs/src/internal/observable/merge.ts b/packages/rxjs/src/internal/observable/merge.ts index 8cd55c724d..7dc3c7e726 100644 --- a/packages/rxjs/src/internal/observable/merge.ts +++ b/packages/rxjs/src/internal/observable/merge.ts @@ -1,4 +1,4 @@ -import type { Observable} from '@rxjs/observable'; +import type { Observable } from '@rxjs/observable'; import { from } from '@rxjs/observable'; import type { ObservableInput, ObservableInputTuple, SchedulerLike } from '../types.js'; import { mergeAll } from '../operators/mergeAll.js'; @@ -24,7 +24,7 @@ export function merge( * Flattens multiple Observables together by blending * their values into one Observable. * - * ![](merge.png) + * ![](/images/marble-diagrams/merge.png) * * `merge` subscribes to each given input Observable (as arguments), and simply * forwards (without doing any transformation) all the values from all the input @@ -32,7 +32,7 @@ export function merge( * once all input Observables have completed. Any error delivered by an input * Observable will be immediately emitted on the output Observable. * - * ## Examples + * @example * * Merge together two Observables: 1s interval and clicks * @@ -90,10 +90,10 @@ export function merge(...args: (ObservableInput | number | SchedulerLik const sources = args as ObservableInput[]; return !sources.length ? // No source provided - EMPTY + EMPTY : sources.length === 1 - ? // One source? Just return it. + ? // One source? Just return it. from(sources[0]) - : // Merge all sources + : // Merge all sources mergeAll(concurrent)(scheduler ? scheduled(sources, scheduler) : from(sources)); } diff --git a/packages/rxjs/src/internal/observable/never.ts b/packages/rxjs/src/internal/observable/never.ts index fa71fa7502..0cd64ad27f 100644 --- a/packages/rxjs/src/internal/observable/never.ts +++ b/packages/rxjs/src/internal/observable/never.ts @@ -4,7 +4,7 @@ import { noop } from '../util/noop.js'; /** * An Observable that emits no items to the Observer and never completes. * - * ![](never.png) + * ![](/images/marble-diagrams/never.png) * * A simple Observable that emits neither values nor errors nor the completion * notification. It can be used for testing purposes or for composing with other diff --git a/packages/rxjs/src/internal/observable/of.ts b/packages/rxjs/src/internal/observable/of.ts index 98a2ffe392..95f29e8a68 100644 --- a/packages/rxjs/src/internal/observable/of.ts +++ b/packages/rxjs/src/internal/observable/of.ts @@ -1,5 +1,5 @@ import type { ValueFromArray } from '../types.js'; -import type { Observable} from '@rxjs/observable'; +import type { Observable } from '@rxjs/observable'; import { fromArrayLike } from '@rxjs/observable'; // Devs are more likely to pass null or undefined than they are a scheduler @@ -19,12 +19,12 @@ export function of(...values: A): ObservableEach argument becomes a `next` notification. * - * ![](of.png) + * ![](/images/marble-diagrams/of.png) * * Unlike {@link from}, it does not do any flattening and emits each argument in whole * as a separate `next` notification. * - * ## Examples + * @example * * Emit the values `10, 20, 30` * diff --git a/packages/rxjs/src/internal/observable/onErrorResumeNext.ts b/packages/rxjs/src/internal/observable/onErrorResumeNext.ts index d4136ec7ab..c2e3ec1116 100644 --- a/packages/rxjs/src/internal/observable/onErrorResumeNext.ts +++ b/packages/rxjs/src/internal/observable/onErrorResumeNext.ts @@ -12,7 +12,7 @@ export function onErrorResumeNext(...sources: [... * * Execute series of Observables no matter what, even if it means swallowing errors. * - * ![](onErrorResumeNext.png) + * ![](/images/marble-diagrams/onErrorResumeNext.png) * * `onErrorResumeNext` will subscribe to each observable source it is provided, in order. * If the source it's subscribed to emits an error or completes, it will move to the next source @@ -27,7 +27,7 @@ export function onErrorResumeNext(...sources: [... * `onErrorResumeNext`. If you want to handle errors thrown in any given source, you can * always use the {@link catchError} operator on them before passing them into `onErrorResumeNext`. * - * ## Example + * @example * * Subscribe to the next Observable after map fails * diff --git a/packages/rxjs/src/internal/observable/partition.ts b/packages/rxjs/src/internal/observable/partition.ts index b9505c08cd..040f666b97 100644 --- a/packages/rxjs/src/internal/observable/partition.ts +++ b/packages/rxjs/src/internal/observable/partition.ts @@ -1,7 +1,7 @@ import { not } from '../util/not.js'; import { filter } from '../operators/filter.js'; import type { ObservableInput } from '../types.js'; -import type { Observable} from '@rxjs/observable'; +import type { Observable } from '@rxjs/observable'; import { from } from '@rxjs/observable'; /** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */ @@ -31,7 +31,7 @@ export function partition(source: ObservableInput, predicate: (value: T, i * one like the output of {@link filter}, and the other with values that did not * pass the condition. * - * ![](partition.png) + * ![](/images/marble-diagrams/partition.png) * * `partition` outputs an array with two Observables that partition the values * from the source Observable through the given `predicate` function. The first @@ -40,7 +40,7 @@ export function partition(source: ObservableInput, predicate: (value: T, i * predicate returns false. The first behaves like {@link filter} and the second * behaves like {@link filter} with the predicate negated. * - * ## Example + * @example * * Partition a set of numbers into odds and evens observables * diff --git a/packages/rxjs/src/internal/observable/race.ts b/packages/rxjs/src/internal/observable/race.ts index d121bfe4af..adf6995a63 100644 --- a/packages/rxjs/src/internal/observable/race.ts +++ b/packages/rxjs/src/internal/observable/race.ts @@ -1,4 +1,4 @@ -import type { Subscription, Subscriber} from '@rxjs/observable'; +import type { Subscription, Subscriber } from '@rxjs/observable'; import { Observable, from, operate } from '@rxjs/observable'; import type { ObservableInput, ObservableInputTuple } from '../types.js'; import { argsOrArgArray } from '../util/argsOrArgArray.js'; @@ -9,7 +9,7 @@ export function race(...inputs: [...ObservableInpu /** * Returns an observable that mirrors the first source observable to emit an item. * - * ![](race.png) + * ![](/images/marble-diagrams/race.png) * * `race` returns an observable, that when subscribed to, subscribes to all source observables immediately. * As soon as one of the source observables emits a value, the result unsubscribes from the other sources. @@ -24,7 +24,7 @@ export function race(...inputs: [...ObservableInpu * HTTP or WebSockets. `race` can also be useful for switching observable context based on user * input. * - * ## Example + * @example * * Subscribes to the observable that was the first to start emitting. * diff --git a/packages/rxjs/src/internal/observable/range.ts b/packages/rxjs/src/internal/observable/range.ts index d03503b50a..ca0d0661ee 100644 --- a/packages/rxjs/src/internal/observable/range.ts +++ b/packages/rxjs/src/internal/observable/range.ts @@ -16,14 +16,14 @@ export function range(start: number, count: number | undefined, scheduler: Sched * * Emits a sequence of numbers in a range. * - * ![](range.png) + * ![](/images/marble-diagrams/range.png) * * `range` operator emits a range of sequential integers, in order, where you * select the `start` of the range and its `length`. By default, uses no * {@link SchedulerLike} and just delivers the notifications synchronously, but may use * an optional {@link SchedulerLike} to regulate those deliveries. * - * ## Example + * @example * * Produce a range of numbers * @@ -71,27 +71,27 @@ export function range(start: number, count?: number, scheduler?: SchedulerLike): return new Observable( scheduler ? // The deprecated scheduled path. - (subscriber) => { - let n = start; - const emit = () => { - if (n < end) { - subscriber.next(n++); - if (!subscriber.closed) { - executeSchedule(subscriber, scheduler, emit); - } - } else { - subscriber.complete(); - } - }; - executeSchedule(subscriber, scheduler, emit); - } - : // Standard synchronous range. - (subscriber) => { - let n = start; - while (n < end && !subscriber.closed) { + (subscriber) => { + let n = start; + const emit = () => { + if (n < end) { subscriber.next(n++); + if (!subscriber.closed) { + executeSchedule(subscriber, scheduler, emit); + } + } else { + subscriber.complete(); } - subscriber.complete(); + }; + executeSchedule(subscriber, scheduler, emit); + } + : // Standard synchronous range. + (subscriber) => { + let n = start; + while (n < end && !subscriber.closed) { + subscriber.next(n++); } + subscriber.complete(); + } ); } diff --git a/packages/rxjs/src/internal/observable/throwError.ts b/packages/rxjs/src/internal/observable/throwError.ts index e07523a23f..318f9ca9e2 100644 --- a/packages/rxjs/src/internal/observable/throwError.ts +++ b/packages/rxjs/src/internal/observable/throwError.ts @@ -6,7 +6,7 @@ import { Observable } from '@rxjs/observable'; * * Just errors and does nothing else * - * ![](throw.png) + * ![](/images/marble-diagrams/throw.png) * * This creation function is useful for creating an observable that will create an error and error every * time it is subscribed to. Generally, inside of most operators when you might want to return an errored @@ -14,7 +14,7 @@ import { Observable } from '@rxjs/observable'; * {@link mergeMap}, {@link defer}, and many others, you can simply throw the error, and RxJS will pick * that up and notify the consumer of the error. * - * ## Example + * @example * * Create a simple observable that will create a new error with a timestamp and log it * and the message every time you subscribe to it diff --git a/packages/rxjs/src/internal/observable/timer.ts b/packages/rxjs/src/internal/observable/timer.ts index bbb3698cb1..516aac36e2 100644 --- a/packages/rxjs/src/internal/observable/timer.ts +++ b/packages/rxjs/src/internal/observable/timer.ts @@ -17,7 +17,7 @@ import { executeSchedule } from '../util/executeSchedule.js'; * The `delay` is specified by default in milliseconds, however providing a custom scheduler could * create a different behavior. * - * ## Examples + * @example * * Wait 3 seconds and start another observable * @@ -91,7 +91,7 @@ export function timer(due: number | Date, scheduler?: SchedulerLike): Observable * The `delay` and `intervalDuration` are specified by default in milliseconds, however providing a custom scheduler could * create a different behavior. * - * ## Example + * @example * * ### Start an interval that starts right away * diff --git a/packages/rxjs/src/internal/observable/zip.ts b/packages/rxjs/src/internal/observable/zip.ts index be3af3ace3..1fa71cba4e 100644 --- a/packages/rxjs/src/internal/observable/zip.ts +++ b/packages/rxjs/src/internal/observable/zip.ts @@ -21,7 +21,7 @@ export function zip( * If the last parameter is a function, this function is used to compute the created value from the input values. * Otherwise, an array of the input values is returned. * - * ## Example + * @example * * Combine age and name from different sources * @@ -55,61 +55,61 @@ export function zip(...args: unknown[]): Observable { return sources.length ? new Observable((destination) => { - // A collection of buffers of values from each source. - // Keyed by the same index with which the sources were passed in. - let buffers: unknown[][] = sources.map(() => []); + // A collection of buffers of values from each source. + // Keyed by the same index with which the sources were passed in. + let buffers: unknown[][] = sources.map(() => []); - // An array of flags of whether or not the sources have completed. - // This is used to check to see if we should complete the result. - // Keyed by the same index with which the sources were passed in. - let completed = sources.map(() => false); + // An array of flags of whether or not the sources have completed. + // This is used to check to see if we should complete the result. + // Keyed by the same index with which the sources were passed in. + let completed = sources.map(() => false); - // When everything is done, release the arrays above. - destination.add(() => { - buffers = completed = null!; - }); + // When everything is done, release the arrays above. + destination.add(() => { + buffers = completed = null!; + }); - // Loop over our sources and subscribe to each one. The index `i` is - // especially important here, because we use it in closures below to - // access the related buffers and completion properties - for (let sourceIndex = 0; !destination.closed && sourceIndex < sources.length; sourceIndex++) { - from(sources[sourceIndex]).subscribe( - operate({ - destination, - next: (value) => { - buffers[sourceIndex].push(value); - // if every buffer has at least one value in it, then we - // can shift out the oldest value from each buffer and emit - // them as an array. - if (buffers.every((buffer) => buffer.length)) { - const result: any = buffers.map((buffer) => buffer.shift()!); - // Emit the array. If theres' a result selector, use that. - destination.next(resultSelector ? resultSelector(...result) : result); - // If any one of the sources is both complete and has an empty buffer - // then we complete the result. This is because we cannot possibly have - // any more values to zip together. - if (buffers.some((buffer, i) => !buffer.length && completed[i])) { - destination.complete(); - } + // Loop over our sources and subscribe to each one. The index `i` is + // especially important here, because we use it in closures below to + // access the related buffers and completion properties + for (let sourceIndex = 0; !destination.closed && sourceIndex < sources.length; sourceIndex++) { + from(sources[sourceIndex]).subscribe( + operate({ + destination, + next: (value) => { + buffers[sourceIndex].push(value); + // if every buffer has at least one value in it, then we + // can shift out the oldest value from each buffer and emit + // them as an array. + if (buffers.every((buffer) => buffer.length)) { + const result: any = buffers.map((buffer) => buffer.shift()!); + // Emit the array. If theres' a result selector, use that. + destination.next(resultSelector ? resultSelector(...result) : result); + // If any one of the sources is both complete and has an empty buffer + // then we complete the result. This is because we cannot possibly have + // any more values to zip together. + if (buffers.some((buffer, i) => !buffer.length && completed[i])) { + destination.complete(); } - }, - complete: () => { - // This source completed. Mark it as complete so we can check it later - // if we have to. - completed[sourceIndex] = true; - // But, if this complete source has nothing in its buffer, then we - // can complete the result, because we can't possibly have any more - // values from this to zip together with the other values. - !buffers[sourceIndex].length && destination.complete(); - }, - }) - ); - } + } + }, + complete: () => { + // This source completed. Mark it as complete so we can check it later + // if we have to. + completed[sourceIndex] = true; + // But, if this complete source has nothing in its buffer, then we + // can complete the result, because we can't possibly have any more + // values from this to zip together with the other values. + !buffers[sourceIndex].length && destination.complete(); + }, + }) + ); + } - // When everything is done, release the arrays above. - return () => { - buffers = completed = null!; - }; - }) + // When everything is done, release the arrays above. + return () => { + buffers = completed = null!; + }; + }) : EMPTY; } diff --git a/packages/rxjs/src/internal/operators/audit.ts b/packages/rxjs/src/internal/operators/audit.ts index d31b4b0583..23108c0adc 100644 --- a/packages/rxjs/src/internal/operators/audit.ts +++ b/packages/rxjs/src/internal/operators/audit.ts @@ -1,4 +1,4 @@ -import type { Subscriber} from '@rxjs/observable'; +import type { Subscriber } from '@rxjs/observable'; import { operate, Observable, from } from '@rxjs/observable'; import type { MonoTypeOperatorFunction, ObservableInput } from '../types.js'; @@ -10,7 +10,7 @@ import type { MonoTypeOperatorFunction, ObservableInput } from '../types.js'; * It's like {@link auditTime}, but the silencing * duration is determined by a second Observable. * - * ![](audit.svg) + * ![](/images/marble-diagrams/audit.svg) * * `audit` is similar to `throttle`, but emits the last value from the silenced * time window, instead of the first value. `audit` emits the most recent value @@ -23,7 +23,7 @@ import type { MonoTypeOperatorFunction, ObservableInput } from '../types.js'; * recent source value is emitted on the output Observable, and this process * repeats for the next source value. * - * ## Example + * @example * * Emit clicks at a rate of at most one click per second * diff --git a/packages/rxjs/src/internal/operators/auditTime.ts b/packages/rxjs/src/internal/operators/auditTime.ts index 5fcd87689c..f52787f313 100644 --- a/packages/rxjs/src/internal/operators/auditTime.ts +++ b/packages/rxjs/src/internal/operators/auditTime.ts @@ -11,7 +11,7 @@ import type { MonoTypeOperatorFunction, SchedulerLike } from '../types.js'; * the next ones for `duration` milliseconds, and then it emits the most recent * value from the source. * - * ![](auditTime.png) + * ![](/images/marble-diagrams/auditTime.png) * * `auditTime` is similar to `throttleTime`, but emits the last value from the * silenced time window, instead of the first value. `auditTime` emits the most @@ -24,7 +24,7 @@ import type { MonoTypeOperatorFunction, SchedulerLike } from '../types.js'; * output Observable, and this process repeats for the next source value. * Optionally takes a {@link SchedulerLike} for managing timers. * - * ## Example + * @example * * Emit clicks at a rate of at most one click per second * diff --git a/packages/rxjs/src/internal/operators/buffer.ts b/packages/rxjs/src/internal/operators/buffer.ts index 482ce89aca..e269652033 100644 --- a/packages/rxjs/src/internal/operators/buffer.ts +++ b/packages/rxjs/src/internal/operators/buffer.ts @@ -8,7 +8,7 @@ import { noop } from '../util/noop.js'; * Collects values from the past as an array, and emits * that array only when another Observable emits. * - * ![](buffer.png) + * ![](/images/marble-diagrams/buffer.png) * * Buffers the incoming Observable values until the given `closingNotifier` * `ObservableInput` (that internally gets converted to an Observable) @@ -16,7 +16,7 @@ import { noop } from '../util/noop.js'; * Observable and starts a new buffer internally, awaiting the next time * `closingNotifier` emits. * - * ## Example + * @example * * On every click, emit array of most recent interval events * diff --git a/packages/rxjs/src/internal/operators/bufferCount.ts b/packages/rxjs/src/internal/operators/bufferCount.ts index 53f5ba2c1e..14b690bdde 100644 --- a/packages/rxjs/src/internal/operators/bufferCount.ts +++ b/packages/rxjs/src/internal/operators/bufferCount.ts @@ -9,7 +9,7 @@ import { arrRemove } from '../util/arrRemove.js'; * Collects values from the past as an array, and emits * that array only when its size reaches `bufferSize`. * - * ![](bufferCount.png) + * ![](/images/marble-diagrams/bufferCount.png) * * Buffers a number of values from the source Observable by `bufferSize` then * emits the buffer and clears it, and starts a new buffer each @@ -17,7 +17,7 @@ import { arrRemove } from '../util/arrRemove.js'; * `null`, then new buffers are started immediately at the start of the source * and when each buffer closes and is emitted. * - * ## Examples + * @example * * Emit the last two click events as an array * diff --git a/packages/rxjs/src/internal/operators/bufferTime.ts b/packages/rxjs/src/internal/operators/bufferTime.ts index 2476aff693..b15208c87d 100644 --- a/packages/rxjs/src/internal/operators/bufferTime.ts +++ b/packages/rxjs/src/internal/operators/bufferTime.ts @@ -24,7 +24,7 @@ export function bufferTime( * Collects values from the past as an array, and emits * those arrays periodically in time. * - * ![](bufferTime.png) + * ![](/images/marble-diagrams/bufferTime.png) * * Buffers values from the source for a specific time duration `bufferTimeSpan`. * Unless the optional argument `bufferCreationInterval` is given, it emits and @@ -35,7 +35,7 @@ export function bufferTime( * `maxBufferSize` is specified, the buffer will be closed either after * `bufferTimeSpan` milliseconds or when it contains `maxBufferSize` elements. * - * ## Examples + * @example * * Every second, emit an array of the recent click events * diff --git a/packages/rxjs/src/internal/operators/bufferToggle.ts b/packages/rxjs/src/internal/operators/bufferToggle.ts index e11404fdce..cb7d483f62 100644 --- a/packages/rxjs/src/internal/operators/bufferToggle.ts +++ b/packages/rxjs/src/internal/operators/bufferToggle.ts @@ -11,13 +11,13 @@ import { arrRemove } from '../util/arrRemove.js'; * collecting only when `opening` emits, and calls the `closingSelector` * function to get an Observable that tells when to close the buffer. * - * ![](bufferToggle.png) + * ![](/images/marble-diagrams/bufferToggle.png) * * Buffers values from the source by opening the buffer via signals from an * Observable provided to `openings`, and closing and sending the buffers when * a Subscribable or Promise returned by the `closingSelector` function emits. * - * ## Example + * @example * * Every other second, emit the click events from the next 500ms * diff --git a/packages/rxjs/src/internal/operators/bufferWhen.ts b/packages/rxjs/src/internal/operators/bufferWhen.ts index f2b53b7f9a..df5d51ef65 100644 --- a/packages/rxjs/src/internal/operators/bufferWhen.ts +++ b/packages/rxjs/src/internal/operators/bufferWhen.ts @@ -1,4 +1,4 @@ -import type { Subscriber} from '@rxjs/observable'; +import type { Subscriber } from '@rxjs/observable'; import { operate, Observable, from } from '@rxjs/observable'; import type { ObservableInput, OperatorFunction } from '../types.js'; import { noop } from '../util/noop.js'; @@ -11,13 +11,13 @@ import { noop } from '../util/noop.js'; * starts collecting values, it calls a function that returns an Observable that * tells when to close the buffer and restart collecting. * - * ![](bufferWhen.svg) + * ![](/images/marble-diagrams/bufferWhen.svg) * * Opens a buffer immediately, then closes the buffer when the observable * returned by calling `closingSelector` function emits a value. When it closes * the buffer, it immediately opens a new buffer and repeats the process. * - * ## Example + * @example * * Emit an array of the last clicks every [1-5] random seconds * diff --git a/packages/rxjs/src/internal/operators/catchError.ts b/packages/rxjs/src/internal/operators/catchError.ts index a99b97e797..c150274dc0 100644 --- a/packages/rxjs/src/internal/operators/catchError.ts +++ b/packages/rxjs/src/internal/operators/catchError.ts @@ -1,4 +1,4 @@ -import type { Subscription} from '@rxjs/observable'; +import type { Subscription } from '@rxjs/observable'; import { Observable, operate, from } from '@rxjs/observable'; import type { ObservableInput, OperatorFunction, ObservedValueOf } from '../types.js'; @@ -15,13 +15,13 @@ export function catchError>( * The error may also be rethrown, or a new error can be thrown to emit an error from the result. * * - * ![](catch.png) + * ![](/images/marble-diagrams/catch.png) * * This operator handles errors, but forwards along all other events to the resulting observable. * If the source observable terminates with an error, it will map that error to a new observable, * subscribe to it, and forward all of its events to the resulting observable. * - * ## Examples + * @example * * Continue with a different Observable when there's an error * diff --git a/packages/rxjs/src/internal/operators/combineLatestAll.ts b/packages/rxjs/src/internal/operators/combineLatestAll.ts index d3ec6bb8a9..58462d19fc 100644 --- a/packages/rxjs/src/internal/operators/combineLatestAll.ts +++ b/packages/rxjs/src/internal/operators/combineLatestAll.ts @@ -19,7 +19,7 @@ export function combineLatestAll(project: (...values: Array) => R): Oper * arrived, and the result of the `project` function is what is emitted by the output Observable. * * If there is no `project` function, an array of all the most recent values is emitted by the output Observable. * - * ## Example + * @example * * Map two click events to a finite interval Observable, then apply `combineLatestAll` * diff --git a/packages/rxjs/src/internal/operators/combineLatestWith.ts b/packages/rxjs/src/internal/operators/combineLatestWith.ts index 56633bad12..646370f68e 100644 --- a/packages/rxjs/src/internal/operators/combineLatestWith.ts +++ b/packages/rxjs/src/internal/operators/combineLatestWith.ts @@ -13,7 +13,7 @@ import type { Cons, ObservableInputTuple, OperatorFunction } from '../types.js'; * * This is a useful operator for eagerly calculating values based off of changed inputs. * - * ## Example + * @example * * Simple concatenation of values from two inputs * diff --git a/packages/rxjs/src/internal/operators/concatAll.ts b/packages/rxjs/src/internal/operators/concatAll.ts index fcd8a8909d..70f3b441a5 100644 --- a/packages/rxjs/src/internal/operators/concatAll.ts +++ b/packages/rxjs/src/internal/operators/concatAll.ts @@ -8,7 +8,7 @@ import type { OperatorFunction, ObservableInput, ObservedValueOf } from '../type * Flattens an Observable-of-Observables by putting one * inner Observable after the other. * - * ![](concatAll.svg) + * ![](/images/marble-diagrams/concatAll.svg) * * Joins every Observable emitted by the source (a higher-order Observable), in * a serial fashion. It subscribes to each inner Observable only after the @@ -23,7 +23,7 @@ import type { OperatorFunction, ObservableInput, ObservedValueOf } from '../type * Note: `concatAll` is equivalent to `mergeAll` with concurrency parameter set * to `1`. * - * ## Example + * @example * * For each click event, tick every second from 0 to 3, with no concurrency * diff --git a/packages/rxjs/src/internal/operators/concatMap.ts b/packages/rxjs/src/internal/operators/concatMap.ts index 7763595610..52220f607e 100644 --- a/packages/rxjs/src/internal/operators/concatMap.ts +++ b/packages/rxjs/src/internal/operators/concatMap.ts @@ -9,7 +9,7 @@ import type { ObservableInput, OperatorFunction, ObservedValueOf } from '../type * Maps each value to an Observable, then flattens all of * these inner Observables using {@link concatAll}. * - * ![](concatMap.png) + * ![](/images/marble-diagrams/concatMap.png) * * Returns an Observable that emits items based on applying a function that you * supply to each item emitted by the source Observable, where that function @@ -24,7 +24,7 @@ import type { ObservableInput, OperatorFunction, ObservedValueOf } from '../type * Note: `concatMap` is equivalent to `mergeMap` with concurrency parameter set * to `1`. * - * ## Example + * @example * * For each click event, tick every second from 0 to 3, with no concurrency * diff --git a/packages/rxjs/src/internal/operators/concatMapTo.ts b/packages/rxjs/src/internal/operators/concatMapTo.ts index 2d47040cc9..1e54026fe1 100644 --- a/packages/rxjs/src/internal/operators/concatMapTo.ts +++ b/packages/rxjs/src/internal/operators/concatMapTo.ts @@ -8,7 +8,7 @@ import type { ObservableInput, OperatorFunction, ObservedValueOf } from '../type * It's like {@link concatMap}, but maps each value * always to the same inner Observable. * - * ![](concatMapTo.png) + * ![](/images/marble-diagrams/concatMapTo.png) * * Maps each source value to the given Observable `innerObservable` regardless * of the source value, and then flattens those resulting Observables into one @@ -24,7 +24,7 @@ import type { ObservableInput, OperatorFunction, ObservedValueOf } from '../type * Note: `concatMapTo` is equivalent to `mergeMapTo` with concurrency parameter * set to `1`. * - * ## Example + * @example * * For each click event, tick every second from 0 to 3, with no concurrency * diff --git a/packages/rxjs/src/internal/operators/concatWith.ts b/packages/rxjs/src/internal/operators/concatWith.ts index 314a723d8f..c068460617 100644 --- a/packages/rxjs/src/internal/operators/concatWith.ts +++ b/packages/rxjs/src/internal/operators/concatWith.ts @@ -9,7 +9,7 @@ import { concatAll } from '../operators/concatAll.js'; * * `concat(a$, b$, c$)` is the same as `a$.pipe(concatWith(b$, c$))`. * - * ## Example + * @example * * Listen for one mouse click, then listen for all mouse moves. * diff --git a/packages/rxjs/src/internal/operators/connect.ts b/packages/rxjs/src/internal/operators/connect.ts index 5453194592..af09c2a6b1 100644 --- a/packages/rxjs/src/internal/operators/connect.ts +++ b/packages/rxjs/src/internal/operators/connect.ts @@ -44,7 +44,7 @@ const DEFAULT_CONFIG: ConnectConfig = { * the `selector` function returns, the observable it returns will be subscribed to, _then_ the * multicast will be connected to the source. * - * ## Example + * @example * * Sharing a totally synchronous observable * diff --git a/packages/rxjs/src/internal/operators/count.ts b/packages/rxjs/src/internal/operators/count.ts index 7517bee823..9faf615116 100644 --- a/packages/rxjs/src/internal/operators/count.ts +++ b/packages/rxjs/src/internal/operators/count.ts @@ -8,7 +8,7 @@ import { reduce } from './reduce.js'; * Tells how many values were emitted, when the source * completes. * - * ![](count.png) + * ![](/images/marble-diagrams/count.png) * * `count` transforms an Observable that emits values into an Observable that * emits a single value that represents the number of values emitted by the @@ -19,7 +19,7 @@ import { reduce } from './reduce.js'; * as argument, in which case the output emission will represent the number of * source values that matched `true` with the `predicate`. * - * ## Examples + * @example * * Counts how many seconds have passed before the first click happened * diff --git a/packages/rxjs/src/internal/operators/debounce.ts b/packages/rxjs/src/internal/operators/debounce.ts index 7f5c4659a9..26843c52b3 100644 --- a/packages/rxjs/src/internal/operators/debounce.ts +++ b/packages/rxjs/src/internal/operators/debounce.ts @@ -1,4 +1,4 @@ -import type { Subscriber} from '@rxjs/observable'; +import type { Subscriber } from '@rxjs/observable'; import { operate, Observable, from } from '@rxjs/observable'; import type { MonoTypeOperatorFunction, ObservableInput } from '../types.js'; import { noop } from '../util/noop.js'; @@ -10,7 +10,7 @@ import { noop } from '../util/noop.js'; * It's like {@link debounceTime}, but the time span of * emission silence is determined by a second Observable. * - * ![](debounce.svg) + * ![](/images/marble-diagrams/debounce.svg) * * `debounce` delays notifications emitted by the source Observable, but drops previous * pending delayed emissions if a new notification arrives on the source Observable. @@ -30,7 +30,7 @@ import { noop } from '../util/noop.js'; * delay-like operator since output emissions do not necessarily occur at the * same time as they did on the source Observable. * - * ## Example + * @example * * Emit the most recent click after a burst of clicks * diff --git a/packages/rxjs/src/internal/operators/debounceTime.ts b/packages/rxjs/src/internal/operators/debounceTime.ts index a4b0551459..55fd07eefd 100644 --- a/packages/rxjs/src/internal/operators/debounceTime.ts +++ b/packages/rxjs/src/internal/operators/debounceTime.ts @@ -11,7 +11,7 @@ import { executeSchedule } from '../util/executeSchedule.js'; * It's like {@link delay}, but passes only the most * recent notification from each burst of emissions. * - * ![](debounceTime.png) + * ![](/images/marble-diagrams/debounceTime.png) * * `debounceTime` delays notifications emitted by the source Observable, but drops * previous pending delayed emissions if a new notification arrives on the source @@ -31,7 +31,7 @@ import { executeSchedule } from '../util/executeSchedule.js'; * they did on the source Observable. Optionally takes a {@link SchedulerLike} for * managing timers. * - * ## Example + * @example * * Emit the most recent click after a burst of clicks * diff --git a/packages/rxjs/src/internal/operators/defaultIfEmpty.ts b/packages/rxjs/src/internal/operators/defaultIfEmpty.ts index 1f5e2766e1..b36e0752a0 100644 --- a/packages/rxjs/src/internal/operators/defaultIfEmpty.ts +++ b/packages/rxjs/src/internal/operators/defaultIfEmpty.ts @@ -8,13 +8,13 @@ import { Observable, operate } from '@rxjs/observable'; * If the source Observable turns out to be empty, then * this operator will emit a default value. * - * ![](defaultIfEmpty.png) + * ![](/images/marble-diagrams/defaultIfEmpty.png) * * `defaultIfEmpty` emits the values emitted by the source Observable or a * specified default value if the source Observable is empty (completes without * having emitted any `next` value). * - * ## Example + * @example * * If no clicks happen in 5 seconds, then emit 'no clicks' * diff --git a/packages/rxjs/src/internal/operators/delay.ts b/packages/rxjs/src/internal/operators/delay.ts index b1608c2abd..7f179a1425 100644 --- a/packages/rxjs/src/internal/operators/delay.ts +++ b/packages/rxjs/src/internal/operators/delay.ts @@ -10,7 +10,7 @@ import { timer } from '../observable/timer.js'; * Time shifts each item by some specified amount of * milliseconds. * - * ![](delay.svg) + * ![](/images/marble-diagrams/delay.svg) * * If the delay argument is a Number, this operator time shifts the source * Observable by that amount of time expressed in milliseconds. The relative @@ -19,7 +19,7 @@ import { timer } from '../observable/timer.js'; * If the delay argument is a Date, this operator time shifts the start of the * Observable execution until the given date occurs. * - * ## Examples + * @example * * Delay each click by one second * diff --git a/packages/rxjs/src/internal/operators/delayWhen.ts b/packages/rxjs/src/internal/operators/delayWhen.ts index 9deefa08bd..18e18620ee 100644 --- a/packages/rxjs/src/internal/operators/delayWhen.ts +++ b/packages/rxjs/src/internal/operators/delayWhen.ts @@ -21,7 +21,7 @@ export function delayWhen(delayDurationSelector: (value: T, index: number) => * It's like {@link delay}, but the time span of the * delay duration is determined by a second Observable. * - * ![](delayWhen.png) + * ![](/images/marble-diagrams/delayWhen.png) * * `delayWhen` operator shifts each emitted value from the source Observable by * a time span determined by another Observable. When the source emits a value, @@ -32,10 +32,10 @@ export function delayWhen(delayDurationSelector: (value: T, index: number) => * Observable. * * The source value is emitted on the output Observable only when the "duration" - * Observable emits ({@link guide/glossary-and-semantics#next next}s) any value. + * Observable emits ({@link https://rxjs.dev/guide/glossary-and-semantics#next | next}s) any value. * Upon that, the "duration" Observable gets unsubscribed. * - * Before RxJS V7, the {@link guide/glossary-and-semantics#complete completion} + * Before RxJS V7, the {@link https://rxjs.dev/guide/glossary-and-semantics#complete | completion} * of the "duration" Observable would have been triggering the emission of the * source value to the output Observable, but with RxJS V7, this is not the case * anymore. @@ -54,7 +54,7 @@ export function delayWhen(delayDurationSelector: (value: T, index: number) => * `delayWhen` will subscribe to the source Observable as soon as the output * Observable is subscribed. * - * ## Example + * @example * * Delay each click by a random amount of time, between 0 and 5 seconds * diff --git a/packages/rxjs/src/internal/operators/dematerialize.ts b/packages/rxjs/src/internal/operators/dematerialize.ts index 255e623744..1e7a6b5d74 100644 --- a/packages/rxjs/src/internal/operators/dematerialize.ts +++ b/packages/rxjs/src/internal/operators/dematerialize.ts @@ -9,7 +9,7 @@ import { Observable, operate } from '@rxjs/observable'; * Unwraps {@link ObservableNotification} objects as actual `next`, * `error` and `complete` emissions. The opposite of {@link materialize}. * - * ![](dematerialize.png) + * ![](/images/marble-diagrams/dematerialize.png) * * `dematerialize` is assumed to operate an Observable that only emits * {@link ObservableNotification} objects as `next` emissions, and does not emit any @@ -19,7 +19,7 @@ import { Observable, operate } from '@rxjs/observable'; * * Use this operator in conjunction with {@link materialize}. * - * ## Example + * @example * * Convert an Observable of Notifications to an actual Observable * diff --git a/packages/rxjs/src/internal/operators/distinct.ts b/packages/rxjs/src/internal/operators/distinct.ts index aef4c5161f..d2c4f4d08d 100644 --- a/packages/rxjs/src/internal/operators/distinct.ts +++ b/packages/rxjs/src/internal/operators/distinct.ts @@ -16,7 +16,7 @@ import { noop } from '../util/noop.js'; * use might result in memory leaks. To help alleviate this in some scenarios, an optional `flushes` parameter is also provided so * that the internal `Set` can be "flushed", basically clearing it of values. * - * ## Examples + * @example * * A simple example with numbers * diff --git a/packages/rxjs/src/internal/operators/distinctUntilChanged.ts b/packages/rxjs/src/internal/operators/distinctUntilChanged.ts index 7cebddec78..3b216e4814 100644 --- a/packages/rxjs/src/internal/operators/distinctUntilChanged.ts +++ b/packages/rxjs/src/internal/operators/distinctUntilChanged.ts @@ -31,7 +31,7 @@ export function distinctUntilChanged( * 4. If the keys are determined to be unequal by this check, the value (not the key), is emitted * and the selected key from that value is saved for future comparisons against other keys. * - * ## Examples + * @example * * A very basic example with no `{@link distinctUntilChanged#comparator comparator}`. Note that `1` is emitted more than once, * because it's distinct in comparison to the _previously emitted_ value, diff --git a/packages/rxjs/src/internal/operators/distinctUntilKeyChanged.ts b/packages/rxjs/src/internal/operators/distinctUntilKeyChanged.ts index fc0f39571e..2bfd826641 100644 --- a/packages/rxjs/src/internal/operators/distinctUntilKeyChanged.ts +++ b/packages/rxjs/src/internal/operators/distinctUntilKeyChanged.ts @@ -14,7 +14,7 @@ export function distinctUntilKeyChanged(key: K, compare: ( * * If a comparator function is not provided, an equality check is used by default. * - * ## Examples + * @example * * An example comparing the name of persons * diff --git a/packages/rxjs/src/internal/operators/elementAt.ts b/packages/rxjs/src/internal/operators/elementAt.ts index 5e37ef05d8..de1e357c1a 100644 --- a/packages/rxjs/src/internal/operators/elementAt.ts +++ b/packages/rxjs/src/internal/operators/elementAt.ts @@ -9,7 +9,7 @@ import { take } from './take.js'; * * Emits only the i-th value, then completes. * - * ![](elementAt.png) + * ![](/images/marble-diagrams/elementAt.png) * * `elementAt` returns an Observable that emits the item at the specified * `index` in the source Observable, or a default value if that `index` is out @@ -17,7 +17,7 @@ import { take } from './take.js'; * not given and the `index` is out of range, the output Observable will emit an * `ArgumentOutOfRangeError` error. * - * ## Example + * @example * * Emit only the third click event * diff --git a/packages/rxjs/src/internal/operators/endWith.ts b/packages/rxjs/src/internal/operators/endWith.ts index f9679d581d..892e52b6b4 100644 --- a/packages/rxjs/src/internal/operators/endWith.ts +++ b/packages/rxjs/src/internal/operators/endWith.ts @@ -9,9 +9,9 @@ import type { OperatorFunction, ValueFromArray } from '../types.js'; * This is useful for knowing when an observable ends. Particularly when paired with an * operator like {@link takeUntil} * - * ![](endWith.png) + * ![](/images/marble-diagrams/endWith.png) * - * ## Example + * @example * * Emit values to know when an interval starts and stops. The interval will * stop when a user clicks anywhere on the document. diff --git a/packages/rxjs/src/internal/operators/every.ts b/packages/rxjs/src/internal/operators/every.ts index bc7c1d87b2..997445d0a1 100644 --- a/packages/rxjs/src/internal/operators/every.ts +++ b/packages/rxjs/src/internal/operators/every.ts @@ -10,9 +10,9 @@ export function every(predicate: (value: T, index: number) => boolean): Opera * If all values pass predicate before the source completes, emits true before completion, * otherwise emit false, then complete. * - * ![](every.png) + * ![](/images/marble-diagrams/every.png) * - * ## Example + * @example * * A simple example emitting true if all elements are less than 5, false otherwise * diff --git a/packages/rxjs/src/internal/operators/exhaustAll.ts b/packages/rxjs/src/internal/operators/exhaustAll.ts index 222ff986fe..bd867bf2b3 100644 --- a/packages/rxjs/src/internal/operators/exhaustAll.ts +++ b/packages/rxjs/src/internal/operators/exhaustAll.ts @@ -9,7 +9,7 @@ import { identity } from '../util/identity.js'; * Flattens an Observable-of-Observables by dropping the * next inner Observables while the current inner is still executing. * - * ![](exhaustAll.svg) + * ![](/images/marble-diagrams/exhaustAll.svg) * * `exhaustAll` subscribes to an Observable that emits Observables, also known as a * higher-order Observable. Each time it observes one of these emitted inner @@ -19,7 +19,7 @@ import { identity } from '../util/identity.js'; * not yet completed. Once that one completes, it will accept and flatten the * next inner Observable and repeat this process. * - * ## Example + * @example * * Run a finite timer for each click, only if there is no currently active timer * diff --git a/packages/rxjs/src/internal/operators/exhaustMap.ts b/packages/rxjs/src/internal/operators/exhaustMap.ts index 733121f4d4..e92b8559b7 100644 --- a/packages/rxjs/src/internal/operators/exhaustMap.ts +++ b/packages/rxjs/src/internal/operators/exhaustMap.ts @@ -1,4 +1,4 @@ -import type { Subscriber} from '@rxjs/observable'; +import type { Subscriber } from '@rxjs/observable'; import { operate, from, Observable } from '@rxjs/observable'; import type { ObservableInput, OperatorFunction, ObservedValueOf } from '../types.js'; @@ -9,7 +9,7 @@ import type { ObservableInput, OperatorFunction, ObservedValueOf } from '../type * Maps each value to an Observable, then flattens all of * these inner Observables using {@link exhaustAll}. * - * ![](exhaustMap.png) + * ![](/images/marble-diagrams/exhaustMap.png) * * Returns an Observable that emits items based on applying a function that you * supply to each item emitted by the source Observable, where that function @@ -20,7 +20,7 @@ import type { ObservableInput, OperatorFunction, ObservedValueOf } from '../type * that one completes, it will accept and flatten the next projected Observable * and repeat this process. * - * ## Example + * @example * * Run a finite timer for each click, only if there is no currently active timer * diff --git a/packages/rxjs/src/internal/operators/expand.ts b/packages/rxjs/src/internal/operators/expand.ts index 929e6597a0..bceb63b429 100644 --- a/packages/rxjs/src/internal/operators/expand.ts +++ b/packages/rxjs/src/internal/operators/expand.ts @@ -15,7 +15,7 @@ export function expand>( * projection function to every source value as well as every output value. * It's recursive. * - * ![](expand.png) + * ![](/images/marble-diagrams/expand.png) * * Returns an Observable that emits items based on applying a function that you * supply to each item emitted by the source Observable, where that function @@ -27,7 +27,7 @@ export function expand>( * given to the `project` function to produce new output values. This is how * *expand* behaves recursively. * - * ## Example + * @example * * Start emitting the powers of two on every click, at most 10 of them * @@ -50,8 +50,6 @@ export function expand>( * or the output Observable, returns an Observable. * @param concurrent Maximum number of input Observables being subscribed to * concurrently. - * @param scheduler The {@link SchedulerLike} to use for subscribing to - * each projected inner Observable. * @return A function that returns an Observable that emits the source values * and also result of applying the projection function to each value emitted on * the output Observable and merging the results of the Observables obtained diff --git a/packages/rxjs/src/internal/operators/filter.ts b/packages/rxjs/src/internal/operators/filter.ts index a0c7d3388d..620d1046da 100644 --- a/packages/rxjs/src/internal/operators/filter.ts +++ b/packages/rxjs/src/internal/operators/filter.ts @@ -17,13 +17,13 @@ export function filter(predicate: (value: T, index: number) => boolean): Mono * [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter), * it only emits a value from the source if it passes a criterion function. * - * ![](filter.png) + * ![](/images/marble-diagrams/filter.png) * * Similar to the well-known `Array.prototype.filter` method, this operator * takes values from the source Observable, passes them through a `predicate` * function and only emits those values that yielded `true`. * - * ## Example + * @example * * Emit only click events whose target was a DIV element * diff --git a/packages/rxjs/src/internal/operators/finalize.ts b/packages/rxjs/src/internal/operators/finalize.ts index 51b1905147..586487ac3f 100644 --- a/packages/rxjs/src/internal/operators/finalize.ts +++ b/packages/rxjs/src/internal/operators/finalize.ts @@ -6,7 +6,7 @@ import { Observable } from '@rxjs/observable'; * the source terminates on complete or error. * The specified function will also be called when the subscriber explicitly unsubscribes. * - * ## Examples + * @example * * Execute callback function when the observable completes * diff --git a/packages/rxjs/src/internal/operators/find.ts b/packages/rxjs/src/internal/operators/find.ts index 53728d3fc6..5aea01800a 100644 --- a/packages/rxjs/src/internal/operators/find.ts +++ b/packages/rxjs/src/internal/operators/find.ts @@ -1,4 +1,4 @@ -import type { Subscriber} from '@rxjs/observable'; +import type { Subscriber } from '@rxjs/observable'; import { Observable, operate } from '@rxjs/observable'; import type { OperatorFunction, TruthyTypesOf } from '../types.js'; @@ -14,7 +14,7 @@ export function find(predicate: (value: T, index: number, source: Observable< * Finds the first value that passes some test and emits * that. * - * ![](find.png) + * ![](/images/marble-diagrams/find.png) * * `find` searches for the first item in the source Observable that matches the * specified condition embodied by the `predicate`, and returns the first @@ -22,7 +22,7 @@ export function find(predicate: (value: T, index: number, source: Observable< * in `find`, and does not emit an error if a valid value is not found * (emits `undefined` instead). * - * ## Example + * @example * * Find and emit the first click that happens on a DIV element * diff --git a/packages/rxjs/src/internal/operators/findIndex.ts b/packages/rxjs/src/internal/operators/findIndex.ts index 4b5eead40d..6dbc4115cb 100644 --- a/packages/rxjs/src/internal/operators/findIndex.ts +++ b/packages/rxjs/src/internal/operators/findIndex.ts @@ -12,7 +12,7 @@ export function findIndex(predicate: (value: T, index: number, source: Observ * It's like {@link find}, but emits the index of the * found value, not the value itself. * - * ![](findIndex.png) + * ![](/images/marble-diagrams/findIndex.png) * * `findIndex` searches for the first item in the source Observable that matches * the specified condition embodied by the `predicate`, and returns the @@ -20,7 +20,7 @@ export function findIndex(predicate: (value: T, index: number, source: Observ * {@link first}, the `predicate` is required in `findIndex`, and does not emit * an error if a valid value is not found. * - * ## Example + * @example * * Emit the index of first click that happens on a DIV element * diff --git a/packages/rxjs/src/internal/operators/first.ts b/packages/rxjs/src/internal/operators/first.ts index 743f77c220..9f7d8319bf 100644 --- a/packages/rxjs/src/internal/operators/first.ts +++ b/packages/rxjs/src/internal/operators/first.ts @@ -27,14 +27,14 @@ export function first( * Emits only the first value. Or emits only the first * value that passes some test. * - * ![](first.png) + * ![](/images/marble-diagrams/first.png) * * If called with no arguments, `first` emits the first value of the source * Observable, then completes. If called with a `predicate` function, `first` * emits the first value of the source that matches the specified condition. Emits an error * notification if `defaultValue` was not provided and a matching element is not found. * - * ## Examples + * @example * * Emit only the first click that happens on the DOM * diff --git a/packages/rxjs/src/internal/operators/groupBy.ts b/packages/rxjs/src/internal/operators/groupBy.ts index 725fa05aa0..9cceae8418 100644 --- a/packages/rxjs/src/internal/operators/groupBy.ts +++ b/packages/rxjs/src/internal/operators/groupBy.ts @@ -50,7 +50,7 @@ export function groupBy( * and emits these grouped items as `GroupedObservables`, one * {@link GroupedObservable} per group. * - * ![](groupBy.png) + * ![](/images/marble-diagrams/groupBy.png) * * When the Observable emits an item, a key is computed for this item with the key function. * @@ -63,7 +63,7 @@ export function groupBy( * The elements emitted by {@link GroupedObservable}s are by default the items emitted by the Observable, or elements * returned by the element function. * - * ## Examples + * @example * * Group objects by `id` and return as array * diff --git a/packages/rxjs/src/internal/operators/ignoreElements.ts b/packages/rxjs/src/internal/operators/ignoreElements.ts index 9ba8e01fdd..eb106bf730 100644 --- a/packages/rxjs/src/internal/operators/ignoreElements.ts +++ b/packages/rxjs/src/internal/operators/ignoreElements.ts @@ -5,7 +5,7 @@ import { noop } from '../util/noop.js'; /** * Ignores all items emitted by the source Observable and only passes calls of `complete` or `error`. * - * ![](ignoreElements.png) + * ![](/images/marble-diagrams/ignoreElements.png) * * The `ignoreElements` operator suppresses all items emitted by the source Observable, * but allows its termination notification (either `error` or `complete`) to pass through unchanged. @@ -14,7 +14,7 @@ import { noop } from '../util/noop.js'; * when it completes or when it terminates with an error, you can apply the `ignoreElements` operator * to the Observable, which will ensure that it will never call its observers’ `next` handlers. * - * ## Example + * @example * * Ignore all `next` emissions from the source * diff --git a/packages/rxjs/src/internal/operators/isEmpty.ts b/packages/rxjs/src/internal/operators/isEmpty.ts index 9a54c4e465..368f238fbf 100644 --- a/packages/rxjs/src/internal/operators/isEmpty.ts +++ b/packages/rxjs/src/internal/operators/isEmpty.ts @@ -7,7 +7,7 @@ import { Observable, operate } from '@rxjs/observable'; * * Tells whether any values are emitted by an Observable. * - * ![](isEmpty.png) + * ![](/images/marble-diagrams/isEmpty.png) * * `isEmpty` transforms an Observable that emits values into an Observable that * emits a single boolean value representing whether or not any values were @@ -19,7 +19,7 @@ import { Observable, operate } from '@rxjs/observable'; * A similar effect could be achieved with {@link count}, but `isEmpty` can emit * a `false` value sooner. * - * ## Examples + * @example * * Emit `false` for a non-empty Observable * diff --git a/packages/rxjs/src/internal/operators/last.ts b/packages/rxjs/src/internal/operators/last.ts index f0e1686d89..a15428a405 100644 --- a/packages/rxjs/src/internal/operators/last.ts +++ b/packages/rxjs/src/internal/operators/last.ts @@ -20,13 +20,13 @@ export function last( * the last item from the source Observable, the resulting Observable will emit the last item * from the source Observable that satisfies the predicate. * - * ![](last.png) + * ![](/images/marble-diagrams/last.png) * * It will emit an error notification if the source completes without notification or one that matches * the predicate. It returns the last value or if a predicate is provided last value that matches the * predicate. It returns the given default value if no notification is emitted or matches the predicate. * - * ## Examples + * @example * * Last alphabet from the sequence * diff --git a/packages/rxjs/src/internal/operators/map.ts b/packages/rxjs/src/internal/operators/map.ts index 35cb1417f9..061cd01412 100644 --- a/packages/rxjs/src/internal/operators/map.ts +++ b/packages/rxjs/src/internal/operators/map.ts @@ -9,13 +9,13 @@ import { Observable, operate } from '@rxjs/observable'; * it passes each source value through a transformation function to get * corresponding output values. * - * ![](map.png) + * ![](/images/marble-diagrams/map.png) * * Similar to the well known `Array.prototype.map` function, this operator * applies a projection to each value and emits that projection in the output * Observable. * - * ## Example + * @example * * Map every click to the `clientX` position of that click * diff --git a/packages/rxjs/src/internal/operators/mapTo.ts b/packages/rxjs/src/internal/operators/mapTo.ts index d25679e6bc..94a118ec78 100644 --- a/packages/rxjs/src/internal/operators/mapTo.ts +++ b/packages/rxjs/src/internal/operators/mapTo.ts @@ -17,13 +17,13 @@ export function mapTo(value: R): OperatorFunction; * Like {@link map}, but it maps every source value to * the same output value every time. * - * ![](mapTo.png) + * ![](/images/marble-diagrams/mapTo.png) * * Takes a constant `value` as argument, and emits that whenever the source * Observable emits a value. In other words, ignores the actual source value, * and simply uses the emission moment to know when to emit the given `value`. * - * ## Example + * @example * * Map every click to the string `'Hi'` * diff --git a/packages/rxjs/src/internal/operators/materialize.ts b/packages/rxjs/src/internal/operators/materialize.ts index 68b11afdbc..e5c8c980ac 100644 --- a/packages/rxjs/src/internal/operators/materialize.ts +++ b/packages/rxjs/src/internal/operators/materialize.ts @@ -10,7 +10,7 @@ import { Observable, operate, COMPLETE_NOTIFICATION, errorNotification, nextNoti * {@link ObservableNotification} objects, emitted as `next` on the output Observable. * * - * ![](materialize.png) + * ![](/images/marble-diagrams/materialize.png) * * `materialize` returns an Observable that emits a `next` notification for each * `next`, `error`, or `complete` emission of the source Observable. When the @@ -23,7 +23,7 @@ import { Observable, operate, COMPLETE_NOTIFICATION, errorNotification, nextNoti * be consumed as `next` emissions. Use it in conjunction with * {@link dematerialize}. * - * ## Example + * @example * * Convert a faulty Observable to an Observable of Notifications * diff --git a/packages/rxjs/src/internal/operators/max.ts b/packages/rxjs/src/internal/operators/max.ts index 8a706c982e..d784d8332e 100644 --- a/packages/rxjs/src/internal/operators/max.ts +++ b/packages/rxjs/src/internal/operators/max.ts @@ -7,9 +7,9 @@ import { isFunction } from '@rxjs/observable'; * can be compared with a provided function), and when source Observable completes * it emits a single item: the item with the largest value. * - * ![](max.png) + * ![](/images/marble-diagrams/max.png) * - * ## Examples + * @example * * Get the maximal value of a series of numbers * diff --git a/packages/rxjs/src/internal/operators/mergeAll.ts b/packages/rxjs/src/internal/operators/mergeAll.ts index 2e29d33344..044c366562 100644 --- a/packages/rxjs/src/internal/operators/mergeAll.ts +++ b/packages/rxjs/src/internal/operators/mergeAll.ts @@ -8,7 +8,7 @@ import type { OperatorFunction, ObservableInput, ObservedValueOf } from '../type * * Flattens an Observable-of-Observables. * - * ![](mergeAll.png) + * ![](/images/marble-diagrams/mergeAll.png) * * `mergeAll` subscribes to an Observable that emits Observables, also known as * a higher-order Observable. Each time it observes one of these emitted inner @@ -17,7 +17,7 @@ import type { OperatorFunction, ObservableInput, ObservedValueOf } from '../type * completes once all inner Observables have completed. Any error delivered by * a inner Observable will be immediately emitted on the output Observable. * - * ## Examples + * @example * * Spawn a new interval Observable for each click event, and blend their outputs as one Observable * diff --git a/packages/rxjs/src/internal/operators/mergeMap.ts b/packages/rxjs/src/internal/operators/mergeMap.ts index e536504906..6c3bc138c9 100644 --- a/packages/rxjs/src/internal/operators/mergeMap.ts +++ b/packages/rxjs/src/internal/operators/mergeMap.ts @@ -9,14 +9,14 @@ import { mergeInternals } from './mergeInternals.js'; * Maps each value to an Observable, then flattens all of * these inner Observables using {@link mergeAll}. * - * ![](mergeMap.png) + * ![](/images/marble-diagrams/mergeMap.png) * * Returns an Observable that emits items based on applying a function that you * supply to each item emitted by the source Observable, where that function * returns an Observable, and then merging those resulting Observables and * emitting the results of this merger. * - * ## Example + * @example * * Map and flatten each letter to an Observable ticking every 1 second * diff --git a/packages/rxjs/src/internal/operators/mergeMapTo.ts b/packages/rxjs/src/internal/operators/mergeMapTo.ts index 41c509e817..fd0de3a778 100644 --- a/packages/rxjs/src/internal/operators/mergeMapTo.ts +++ b/packages/rxjs/src/internal/operators/mergeMapTo.ts @@ -8,13 +8,13 @@ import { mergeMap } from './mergeMap.js'; * It's like {@link mergeMap}, but maps each value always * to the same inner Observable. * - * ![](mergeMapTo.png) + * ![](/images/marble-diagrams/mergeMapTo.png) * * Maps each source value to the given Observable `innerObservable` regardless * of the source value, and then merges those resulting Observables into one * single Observable, which is the output Observable. * - * ## Example + * @example * * For each click event, start an interval Observable ticking every 1 second * diff --git a/packages/rxjs/src/internal/operators/mergeScan.ts b/packages/rxjs/src/internal/operators/mergeScan.ts index c4ef34494d..18a098a75a 100644 --- a/packages/rxjs/src/internal/operators/mergeScan.ts +++ b/packages/rxjs/src/internal/operators/mergeScan.ts @@ -34,7 +34,7 @@ import { mergeInternals } from './mergeInternals.js'; * to Infinity. It represents the maximum number of inner Observable subscriptions * at a time. * - * ## Example + * @example * * Count the number of click events * diff --git a/packages/rxjs/src/internal/operators/mergeWith.ts b/packages/rxjs/src/internal/operators/mergeWith.ts index 0388d5e3a5..edd6c0907a 100644 --- a/packages/rxjs/src/internal/operators/mergeWith.ts +++ b/packages/rxjs/src/internal/operators/mergeWith.ts @@ -13,7 +13,7 @@ import type { ObservableInputTuple, OperatorFunction } from '../types.js'; * * When any source errors, the resulting observable will error. * - * ## Example + * @example * * Joining all outputs from multiple user input event streams * diff --git a/packages/rxjs/src/internal/operators/min.ts b/packages/rxjs/src/internal/operators/min.ts index 01a45594b2..eafa780c70 100644 --- a/packages/rxjs/src/internal/operators/min.ts +++ b/packages/rxjs/src/internal/operators/min.ts @@ -7,9 +7,9 @@ import { isFunction } from '@rxjs/observable'; * can be compared with a provided function), and when source Observable completes * it emits a single item: the item with the smallest value. * - * ![](min.png) + * ![](/images/marble-diagrams/min.png) * - * ## Examples + * @example * * Get the minimal value of a series of numbers * diff --git a/packages/rxjs/src/internal/operators/observeOn.ts b/packages/rxjs/src/internal/operators/observeOn.ts index f7bb9a30ed..e959891e82 100644 --- a/packages/rxjs/src/internal/operators/observeOn.ts +++ b/packages/rxjs/src/internal/operators/observeOn.ts @@ -27,7 +27,7 @@ import { Observable, operate } from '@rxjs/observable'; * for any kind of delaying of values in the stream, while using `observeOn` to specify which scheduler should be used * for notification emissions in general. * - * ## Example + * @example * * Ensure values in subscribe are called just before browser repaint * diff --git a/packages/rxjs/src/internal/operators/onErrorResumeNextWith.ts b/packages/rxjs/src/internal/operators/onErrorResumeNextWith.ts index 425af52aae..11d21fd919 100644 --- a/packages/rxjs/src/internal/operators/onErrorResumeNextWith.ts +++ b/packages/rxjs/src/internal/operators/onErrorResumeNextWith.ts @@ -15,7 +15,7 @@ export function onErrorResumeNextWith( * * Execute series of Observables, subscribes to next one on error or complete. * - * ![](onErrorResumeNext.png) + * ![](/images/marble-diagrams/onErrorResumeNext.png) * * `onErrorResumeNext` is an operator that accepts a series of Observables, provided either directly as * arguments or as an array. If no single Observable is provided, returned Observable will simply behave the same @@ -39,7 +39,7 @@ export function onErrorResumeNextWith( * specific actions based on what error was emitted by an Observable, you should try out {@link catchError} instead. * * - * ## Example + * @example * * Subscribe to the next Observable after map fails * diff --git a/packages/rxjs/src/internal/operators/pairwise.ts b/packages/rxjs/src/internal/operators/pairwise.ts index b7c7ddc2ab..146236459d 100644 --- a/packages/rxjs/src/internal/operators/pairwise.ts +++ b/packages/rxjs/src/internal/operators/pairwise.ts @@ -8,7 +8,7 @@ import { Observable, operate } from '@rxjs/observable'; * Puts the current value and previous value together as * an array, and emits that. * - * ![](pairwise.png) + * ![](/images/marble-diagrams/pairwise.png) * * The Nth emission from the source Observable will cause the output Observable * to emit an array [(N-1)th, Nth] of the previous and the current value, as a @@ -16,7 +16,7 @@ import { Observable, operate } from '@rxjs/observable'; * emissions from the source Observable, but not on the first emission, because * there is no previous value in that case. * - * ## Example + * @example * * On every click (starting from the second), emit the relative distance to the previous click * diff --git a/packages/rxjs/src/internal/operators/partition.ts b/packages/rxjs/src/internal/operators/partition.ts index 379c5f39cc..a4699f5f79 100644 --- a/packages/rxjs/src/internal/operators/partition.ts +++ b/packages/rxjs/src/internal/operators/partition.ts @@ -11,7 +11,7 @@ import type { UnaryFunction } from '../types.js'; * one like the output of {@link filter}, and the other with values that did not * pass the condition. * - * ![](partition.png) + * ![](/images/marble-diagrams/partition.png) * * `partition` outputs an array with two Observables that partition the values * from the source Observable through the given `predicate` function. The first @@ -20,7 +20,7 @@ import type { UnaryFunction } from '../types.js'; * predicate returns false. The first behaves like {@link filter} and the second * behaves like {@link filter} with the predicate negated. * - * ## Example + * @example * * Partition click events into those on DIV elements and those elsewhere * diff --git a/packages/rxjs/src/internal/operators/raceWith.ts b/packages/rxjs/src/internal/operators/raceWith.ts index 3414017fa6..9cc98b9f1d 100644 --- a/packages/rxjs/src/internal/operators/raceWith.ts +++ b/packages/rxjs/src/internal/operators/raceWith.ts @@ -8,7 +8,7 @@ import { identity } from '../util/identity.js'; * error or complete notification from the combination of the Observable to which * the operator is applied and supplied Observables. * - * ## Example + * @example * * ```ts * import { interval, map, raceWith } from 'rxjs'; @@ -35,7 +35,7 @@ export function raceWith( return !otherSources.length ? identity : (source) => - new Observable((subscriber) => { - raceInit([source, ...otherSources])(subscriber); - }); + new Observable((subscriber) => { + raceInit([source, ...otherSources])(subscriber); + }); } diff --git a/packages/rxjs/src/internal/operators/reduce.ts b/packages/rxjs/src/internal/operators/reduce.ts index 2c871d6d15..0a3889988c 100644 --- a/packages/rxjs/src/internal/operators/reduce.ts +++ b/packages/rxjs/src/internal/operators/reduce.ts @@ -14,7 +14,7 @@ export function reduce(accumulator: (acc: A | S, value: V, index: n * using an accumulator function that knows how to join a new source value into * the accumulation from the past. * - * ![](reduce.png) + * ![](/images/marble-diagrams/reduce.png) * * Like * [Array.prototype.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce), @@ -29,7 +29,7 @@ export function reduce(accumulator: (acc: A | S, value: V, index: n * that value will be used as the initial value for the accumulator. If no seed * value is specified, the first item of the source is used as the seed. * - * ## Example + * @example * * Count the number of click events that happened in 5 seconds * diff --git a/packages/rxjs/src/internal/operators/repeat.ts b/packages/rxjs/src/internal/operators/repeat.ts index 838710f348..8948004be8 100644 --- a/packages/rxjs/src/internal/operators/repeat.ts +++ b/packages/rxjs/src/internal/operators/repeat.ts @@ -1,4 +1,4 @@ -import type { Subscription} from '@rxjs/observable'; +import type { Subscription } from '@rxjs/observable'; import { Observable, operate, from } from '@rxjs/observable'; import { EMPTY } from '../observable/empty.js'; import type { MonoTypeOperatorFunction, ObservableInput } from '../types.js'; @@ -24,7 +24,7 @@ export interface RepeatConfig { * * Repeats all values emitted on the source. It's like {@link retry}, but for non error cases. * - * ![](repeat.png) + * ![](/images/marble-diagrams/repeat.png) * * Repeat will output values from a source until the source completes, then it will resubscribe to the * source a specified number of times, with a specified delay. Repeat can be particularly useful in @@ -42,7 +42,7 @@ export interface RepeatConfig { * - `repeat({ count: 2, delay: 400 })` will repeat twice, with a delay of 400ms between repetitions. * - `repeat({ delay: (count) => timer(count * 1000) })` will repeat forever, but will have a delay that grows by one second for each repetition. * - * ## Example + * @example * * Repeat a message stream * @@ -126,52 +126,52 @@ export function repeat(countOrConfig?: number | RepeatConfig): MonoTypeOperat return count <= 0 ? () => EMPTY : (source) => - new Observable((destination) => { - let soFar = 0; - let sourceSub: Subscription | null; + new Observable((destination) => { + let soFar = 0; + let sourceSub: Subscription | null; - const resubscribe = () => { - sourceSub?.unsubscribe(); - sourceSub = null; - if (delay != null) { - const notifier = typeof delay === 'number' ? timer(delay) : from(delay(soFar)); - const notifierSubscriber = operate({ - destination, - next: () => { - notifierSubscriber.unsubscribe(); - subscribeToSource(); - }, - }); - notifier.subscribe(notifierSubscriber); - } else { - subscribeToSource(); - } - }; + const resubscribe = () => { + sourceSub?.unsubscribe(); + sourceSub = null; + if (delay != null) { + const notifier = typeof delay === 'number' ? timer(delay) : from(delay(soFar)); + const notifierSubscriber = operate({ + destination, + next: () => { + notifierSubscriber.unsubscribe(); + subscribeToSource(); + }, + }); + notifier.subscribe(notifierSubscriber); + } else { + subscribeToSource(); + } + }; - const subscribeToSource = () => { - let syncUnsub = false; - sourceSub = source.subscribe( - operate({ - destination, - complete: () => { - if (++soFar < count) { - if (sourceSub) { - resubscribe(); - } else { - syncUnsub = true; - } + const subscribeToSource = () => { + let syncUnsub = false; + sourceSub = source.subscribe( + operate({ + destination, + complete: () => { + if (++soFar < count) { + if (sourceSub) { + resubscribe(); } else { - destination.complete(); + syncUnsub = true; } - }, - }) - ); + } else { + destination.complete(); + } + }, + }) + ); - if (syncUnsub) { - resubscribe(); - } - }; + if (syncUnsub) { + resubscribe(); + } + }; - subscribeToSource(); - }); + subscribeToSource(); + }); } diff --git a/packages/rxjs/src/internal/operators/repeatWhen.ts b/packages/rxjs/src/internal/operators/repeatWhen.ts index d355bd030f..3dbedac2a3 100644 --- a/packages/rxjs/src/internal/operators/repeatWhen.ts +++ b/packages/rxjs/src/internal/operators/repeatWhen.ts @@ -1,4 +1,4 @@ -import type { Subscription} from '@rxjs/observable'; +import type { Subscription } from '@rxjs/observable'; import { Observable, from, operate } from '@rxjs/observable'; import { Subject } from '../Subject.js'; import type { MonoTypeOperatorFunction, ObservableInput } from '../types.js'; @@ -9,9 +9,9 @@ import type { MonoTypeOperatorFunction, ObservableInput } from '../types.js'; * calls `complete` or `error`, then this method will call `complete` or `error` on the child subscription. Otherwise * this method will resubscribe to the source Observable. * - * ![](repeatWhen.png) + * ![](/images/marble-diagrams/repeatWhen.png) * - * ## Example + * @example * * Repeat a message stream on click * diff --git a/packages/rxjs/src/internal/operators/retry.ts b/packages/rxjs/src/internal/operators/retry.ts index 0826db32bd..be587b14e9 100644 --- a/packages/rxjs/src/internal/operators/retry.ts +++ b/packages/rxjs/src/internal/operators/retry.ts @@ -1,5 +1,5 @@ import type { MonoTypeOperatorFunction, ObservableInput } from '../types.js'; -import type { Subscription} from '@rxjs/observable'; +import type { Subscription } from '@rxjs/observable'; import { Observable, operate, from } from '@rxjs/observable'; import { identity } from '../util/identity.js'; import { timer } from '../observable/timer.js'; @@ -38,7 +38,7 @@ export function retry(config: RetryConfig): MonoTypeOperatorFunction; * If the source Observable calls `error`, this method will resubscribe to the source Observable for a maximum of * `count` resubscriptions rather than propagating the `error` call. * - * ![](retry.png) + * ![](/images/marble-diagrams/retry.png) * * The number of retries is determined by the `count` parameter. It can be set either by passing a number to * `retry` function or by setting `count` property when `retry` is configured using {@link RetryConfig}. If @@ -49,7 +49,7 @@ export function retry(config: RetryConfig): MonoTypeOperatorFunction; * succeeds the second time and emits: `[1, 2, 3, 4, 5, complete]` then the complete stream of emissions and * notifications would be: `[1, 2, 1, 2, 3, 4, 5, complete]`. * - * ## Example + * @example * * ```ts * import { interval, mergeMap, throwError, of, retry } from 'rxjs'; @@ -93,73 +93,73 @@ export function retry(configOrCount: number | RetryConfig = Infinity): MonoTy return count <= 0 ? identity : (source) => - new Observable((destination) => { - let soFar = 0; - let innerSub: Subscription | null; - const subscribeForRetry = () => { - let syncUnsub = false; - innerSub = source.subscribe( - operate({ - destination, - next: (value) => { - // If we're resetting on success - if (resetOnSuccess) { - soFar = 0; - } - destination.next(value); - }, - error: (err) => { - if (soFar++ < count) { - // We are still under our retry count - const resub = () => { - if (innerSub) { - innerSub.unsubscribe(); - innerSub = null; - subscribeForRetry(); - } else { - syncUnsub = true; - } - }; - - if (delay != null) { - // The user specified a retry delay. - // They gave us a number, use a timer, otherwise, it's a function, - // and we're going to call it to get a notifier. - const notifier = typeof delay === 'number' ? timer(delay) : from(delay(err, soFar)); - const notifierSubscriber = operate({ - destination, - next: () => { - // After we get the first notification, we - // unsubscribe from the notifier, because we don't want anymore - // and we resubscribe to the source. - notifierSubscriber.unsubscribe(); - resub(); - }, - complete: () => { - // The notifier completed without emitting. - // The author is telling us they want to complete. - destination.complete(); - }, - }); - notifier.subscribe(notifierSubscriber); + new Observable((destination) => { + let soFar = 0; + let innerSub: Subscription | null; + const subscribeForRetry = () => { + let syncUnsub = false; + innerSub = source.subscribe( + operate({ + destination, + next: (value) => { + // If we're resetting on success + if (resetOnSuccess) { + soFar = 0; + } + destination.next(value); + }, + error: (err) => { + if (soFar++ < count) { + // We are still under our retry count + const resub = () => { + if (innerSub) { + innerSub.unsubscribe(); + innerSub = null; + subscribeForRetry(); } else { - // There was no notifier given. Just resub immediately. - resub(); + syncUnsub = true; } + }; + + if (delay != null) { + // The user specified a retry delay. + // They gave us a number, use a timer, otherwise, it's a function, + // and we're going to call it to get a notifier. + const notifier = typeof delay === 'number' ? timer(delay) : from(delay(err, soFar)); + const notifierSubscriber = operate({ + destination, + next: () => { + // After we get the first notification, we + // unsubscribe from the notifier, because we don't want anymore + // and we resubscribe to the source. + notifierSubscriber.unsubscribe(); + resub(); + }, + complete: () => { + // The notifier completed without emitting. + // The author is telling us they want to complete. + destination.complete(); + }, + }); + notifier.subscribe(notifierSubscriber); } else { - // We're past our maximum number of retries. - // Just send along the error. - destination.error(err); + // There was no notifier given. Just resub immediately. + resub(); } - }, - }) - ); - if (syncUnsub) { - innerSub.unsubscribe(); - innerSub = null; - subscribeForRetry(); - } - }; - subscribeForRetry(); - }); + } else { + // We're past our maximum number of retries. + // Just send along the error. + destination.error(err); + } + }, + }) + ); + if (syncUnsub) { + innerSub.unsubscribe(); + innerSub = null; + subscribeForRetry(); + } + }; + subscribeForRetry(); + }); } diff --git a/packages/rxjs/src/internal/operators/retryWhen.ts b/packages/rxjs/src/internal/operators/retryWhen.ts index a365d7bbf6..60d7f5b13b 100644 --- a/packages/rxjs/src/internal/operators/retryWhen.ts +++ b/packages/rxjs/src/internal/operators/retryWhen.ts @@ -1,4 +1,4 @@ -import type { Subscription} from '@rxjs/observable'; +import type { Subscription } from '@rxjs/observable'; import { Observable, from, operate } from '@rxjs/observable'; import { Subject } from '../Subject.js'; import type { MonoTypeOperatorFunction, ObservableInput } from '../types.js'; @@ -9,11 +9,11 @@ import type { MonoTypeOperatorFunction, ObservableInput } from '../types.js'; * If that Observable calls `complete` or `error` then this method will call `complete` or `error` on the child * subscription. Otherwise this method will resubscribe to the source Observable. * - * ![](retryWhen.png) + * ![](/images/marble-diagrams/retryWhen.png) * * Retry an observable sequence on error based on custom criteria. * - * ## Example + * @example * * ```ts * import { interval, map, retryWhen, tap, delayWhen, timer } from 'rxjs'; diff --git a/packages/rxjs/src/internal/operators/sample.ts b/packages/rxjs/src/internal/operators/sample.ts index 1ab51251fa..49c3612a5e 100644 --- a/packages/rxjs/src/internal/operators/sample.ts +++ b/packages/rxjs/src/internal/operators/sample.ts @@ -9,7 +9,7 @@ import { noop } from '../util/noop.js'; * It's like {@link sampleTime}, but samples whenever * the `notifier` `ObservableInput` emits something. * - * ![](sample.png) + * ![](/images/marble-diagrams/sample.png) * * Whenever the `notifier` `ObservableInput` emits a value, `sample` * looks at the source Observable and emits whichever value it has most recently @@ -17,7 +17,7 @@ import { noop } from '../util/noop.js'; * anything since the previous sampling. The `notifier` is subscribed to as soon * as the output Observable is subscribed. * - * ## Example + * @example * * On every click, sample the most recent `seconds` timer * diff --git a/packages/rxjs/src/internal/operators/sampleTime.ts b/packages/rxjs/src/internal/operators/sampleTime.ts index 5e4a14ad2e..7c3c1fd4c5 100644 --- a/packages/rxjs/src/internal/operators/sampleTime.ts +++ b/packages/rxjs/src/internal/operators/sampleTime.ts @@ -10,7 +10,7 @@ import { interval } from '../observable/interval.js'; * Samples the source Observable at periodic time * intervals, emitting what it samples. * - * ![](sampleTime.png) + * ![](/images/marble-diagrams/sampleTime.png) * * `sampleTime` periodically looks at the source Observable and emits whichever * value it has most recently emitted since the previous sampling, unless the @@ -19,7 +19,7 @@ import { interval } from '../observable/interval.js'; * defined by the optional `scheduler` argument). The sampling starts as soon as * the output Observable is subscribed. * - * ## Example + * @example * * Every second, emit the most recent click at most once * diff --git a/packages/rxjs/src/internal/operators/scan.ts b/packages/rxjs/src/internal/operators/scan.ts index d372ff68b0..1e249867f2 100644 --- a/packages/rxjs/src/internal/operators/scan.ts +++ b/packages/rxjs/src/internal/operators/scan.ts @@ -16,7 +16,7 @@ export function scan(accumulator: (acc: A | S, value: V, index: number) * It's like {@link reduce}, but emits the current * accumulation state after each update * - * ![](scan.png) + * ![](/images/marble-diagrams/scan.png) * * This operator maintains an internal state and emits it after processing each value as follows: * @@ -28,7 +28,7 @@ export function scan(accumulator: (acc: A | S, value: V, index: number) * 3. Emit `state`. * 4. Next value arrives, let `value = nextValue`, go to 2. * - * ## Examples + * @example * * An average of previous numbers. This example shows how * not providing a `seed` can prime the stream with the diff --git a/packages/rxjs/src/internal/operators/sequenceEqual.ts b/packages/rxjs/src/internal/operators/sequenceEqual.ts index 808a8bd185..86acad487f 100644 --- a/packages/rxjs/src/internal/operators/sequenceEqual.ts +++ b/packages/rxjs/src/internal/operators/sequenceEqual.ts @@ -8,7 +8,7 @@ import { Observable, operate, from } from '@rxjs/observable'; * * Checks to see of all values emitted by both observables are equal, in order. * - * ![](sequenceEqual.png) + * ![](/images/marble-diagrams/sequenceEqual.png) * * `sequenceEqual` subscribes to source observable and `compareTo` `ObservableInput` (that internally * gets converted to an observable) and buffers incoming values from each observable. Whenever either @@ -18,7 +18,7 @@ import { Observable, operate, from } from '@rxjs/observable'; * observable emits before completing, the returned observable will emit `false` and complete. If one observable never * completes or emits after the other completes, the returned observable will never complete. * - * ## Example + * @example * * Figure out if the Konami code matches * diff --git a/packages/rxjs/src/internal/operators/share.ts b/packages/rxjs/src/internal/operators/share.ts index 2c49916d7b..426ea6eb6e 100644 --- a/packages/rxjs/src/internal/operators/share.ts +++ b/packages/rxjs/src/internal/operators/share.ts @@ -60,9 +60,9 @@ export function share(options: ShareConfig): MonoTypeOperatorFunction; * closed. Only new subscribers after a reset on error or complete happened will cause a fresh subscription to the * source. To achieve transparent retries or restarts pipe the source through appropriate operators before sharing. * - * ![](share.png) + * ![](/images/marble-diagrams/share.png) * - * ## Example + * @example * * Generate new multicast Observable from the `source` Observable value * @@ -100,7 +100,7 @@ export function share(options: ShareConfig): MonoTypeOperatorFunction; * // subscription 2: 25 * ``` * - * ## Example with notifier factory: Delayed reset + * @example with notifier factory: Delayed reset * * ```ts * import { interval, take, share, timer } from 'rxjs'; diff --git a/packages/rxjs/src/internal/operators/shareReplay.ts b/packages/rxjs/src/internal/operators/shareReplay.ts index a9d39cc30e..ce499594f5 100644 --- a/packages/rxjs/src/internal/operators/shareReplay.ts +++ b/packages/rxjs/src/internal/operators/shareReplay.ts @@ -42,7 +42,7 @@ export function shareReplay(bufferSize?: number, windowTime?: number, schedul * the inner `ReplaySubject` will be unsubscribed. All new subscribers will receive value emissions from a * new `ReplaySubject` which in turn will cause a new subscription to the source observable. * - * ## Examples + * @example * * Example with a third subscriber coming late to the party * diff --git a/packages/rxjs/src/internal/operators/single.ts b/packages/rxjs/src/internal/operators/single.ts index f831b473fb..ec594a358c 100644 --- a/packages/rxjs/src/internal/operators/single.ts +++ b/packages/rxjs/src/internal/operators/single.ts @@ -24,7 +24,7 @@ export function single(predicate?: (value: T, index: number, source: Observab * In the event that no values match the predicate, if one is provided, * it will emit a {@link NotFoundError} to the Observer's `error` callback. * - * ## Example + * @example * * Expect only `name` beginning with `'B'` * diff --git a/packages/rxjs/src/internal/operators/skip.ts b/packages/rxjs/src/internal/operators/skip.ts index b7dd9d5d65..83e7934092 100644 --- a/packages/rxjs/src/internal/operators/skip.ts +++ b/packages/rxjs/src/internal/operators/skip.ts @@ -4,12 +4,12 @@ import { filter } from './filter.js'; /** * Returns an Observable that skips the first `count` items emitted by the source Observable. * - * ![](skip.png) + * ![](/images/marble-diagrams/skip.png) * * Skips the values until the sent notifications are equal or less than provided skip count. It raises * an error if skip count is equal or more than the actual number of emits and source raises an error. * - * ## Example + * @example * * Skip the values before the emission * diff --git a/packages/rxjs/src/internal/operators/skipLast.ts b/packages/rxjs/src/internal/operators/skipLast.ts index 0ff3ba472a..e9b76a14db 100644 --- a/packages/rxjs/src/internal/operators/skipLast.ts +++ b/packages/rxjs/src/internal/operators/skipLast.ts @@ -5,7 +5,7 @@ import { Observable, operate } from '@rxjs/observable'; /** * Skip a specified number of values before the completion of an observable. * - * ![](skipLast.png) + * ![](/images/marble-diagrams/skipLast.png) * * Returns an observable that will emit values as soon as it can, given a number of * skipped values. For example, if you `skipLast(3)` on a source, when the source @@ -19,7 +19,7 @@ import { Observable, operate } from '@rxjs/observable'; * After subscribing, unsubscribing will not result in the emission of the buffered * skipped values. * - * ## Example + * @example * * Skip the last 2 values of an observable with many values * @@ -47,52 +47,52 @@ import { Observable, operate } from '@rxjs/observable'; export function skipLast(skipCount: number): MonoTypeOperatorFunction { return skipCount <= 0 ? // For skipCounts less than or equal to zero, we are just mirroring the source. - identity + identity : (source) => - new Observable((destination) => { - // A ring buffer to hold the values while we wait to see - // if we can emit it or it's part of the "skipped" last values. - // Note that it is the _same size_ as the skip count. - let ring: T[] = new Array(skipCount); - // The number of values seen so far. This is used to get - // the index of the current value when it arrives. - let seen = 0; - source.subscribe( - operate({ - destination, - next: (value) => { - // Get the index of the value we have right now - // relative to all other values we've seen, then - // increment `seen`. This ensures we've moved to - // the next slot in our ring buffer. - const valueIndex = seen++; - if (valueIndex < skipCount) { - // If we haven't seen enough values to fill our buffer yet, - // Then we aren't to a number of seen values where we can - // emit anything, so let's just start by filling the ring buffer. - ring[valueIndex] = value; - } else { - // We are traversing over the ring array in such - // a way that when we get to the end, we loop back - // and go to the start. - const index = valueIndex % skipCount; - // Pull the oldest value out so we can emit it, - // and stuff the new value in it's place. - const oldValue = ring[index]; - ring[index] = value; - // Emit the old value. It is important that this happens - // after we swap the value in the buffer, if it happens - // before we swap the value in the buffer, then a synchronous - // source can get the buffer out of whack. - destination.next(oldValue); - } - }, - }) - ); + new Observable((destination) => { + // A ring buffer to hold the values while we wait to see + // if we can emit it or it's part of the "skipped" last values. + // Note that it is the _same size_ as the skip count. + let ring: T[] = new Array(skipCount); + // The number of values seen so far. This is used to get + // the index of the current value when it arrives. + let seen = 0; + source.subscribe( + operate({ + destination, + next: (value) => { + // Get the index of the value we have right now + // relative to all other values we've seen, then + // increment `seen`. This ensures we've moved to + // the next slot in our ring buffer. + const valueIndex = seen++; + if (valueIndex < skipCount) { + // If we haven't seen enough values to fill our buffer yet, + // Then we aren't to a number of seen values where we can + // emit anything, so let's just start by filling the ring buffer. + ring[valueIndex] = value; + } else { + // We are traversing over the ring array in such + // a way that when we get to the end, we loop back + // and go to the start. + const index = valueIndex % skipCount; + // Pull the oldest value out so we can emit it, + // and stuff the new value in it's place. + const oldValue = ring[index]; + ring[index] = value; + // Emit the old value. It is important that this happens + // after we swap the value in the buffer, if it happens + // before we swap the value in the buffer, then a synchronous + // source can get the buffer out of whack. + destination.next(oldValue); + } + }, + }) + ); - return () => { - // Release our values in memory - ring = null!; - }; - }); + return () => { + // Release our values in memory + ring = null!; + }; + }); } diff --git a/packages/rxjs/src/internal/operators/skipUntil.ts b/packages/rxjs/src/internal/operators/skipUntil.ts index 39505d7f29..18c3beb019 100644 --- a/packages/rxjs/src/internal/operators/skipUntil.ts +++ b/packages/rxjs/src/internal/operators/skipUntil.ts @@ -9,7 +9,7 @@ import { noop } from '../util/noop.js'; * emits the first value. This can be particularly useful in combination with user interactions, responses of HTTP * requests or waiting for specific times to pass by. * - * ![](skipUntil.png) + * ![](/images/marble-diagrams/skipUntil.png) * * Internally, the `skipUntil` operator subscribes to the passed in `notifier` `ObservableInput` (which gets converted * to an Observable) in order to recognize the emission of its first value. When `notifier` emits next, the operator @@ -17,7 +17,7 @@ import { noop } from '../util/noop.js'; * will never let the *source* observable emit any values if the `notifier` completes or throws an error without * emitting a value before. * - * ## Example + * @example * * In the following example, all emitted values of the interval observable are skipped until the user clicks anywhere * within the page diff --git a/packages/rxjs/src/internal/operators/skipWhile.ts b/packages/rxjs/src/internal/operators/skipWhile.ts index d4fd6912cb..034f1942ba 100644 --- a/packages/rxjs/src/internal/operators/skipWhile.ts +++ b/packages/rxjs/src/internal/operators/skipWhile.ts @@ -9,12 +9,12 @@ export function skipWhile(predicate: (value: T, index: number) => boolean): M * Returns an Observable that skips all items emitted by the source Observable as long as a specified condition holds * true, but emits all further source items as soon as the condition becomes false. * - * ![](skipWhile.png) + * ![](/images/marble-diagrams/skipWhile.png) * * Skips all the notifications with a truthy predicate. It will not skip the notifications when the predicate is falsy. * It can also be skipped using index. Once the predicate is true, it will not be called again. * - * ## Example + * @example * * Skip some super heroes * diff --git a/packages/rxjs/src/internal/operators/startWith.ts b/packages/rxjs/src/internal/operators/startWith.ts index 261f7d647d..824db63aa5 100644 --- a/packages/rxjs/src/internal/operators/startWith.ts +++ b/packages/rxjs/src/internal/operators/startWith.ts @@ -15,9 +15,9 @@ export function startWith(...values: A): * First emits its arguments in order, and then any * emissions from the source. * - * ![](startWith.png) + * ![](/images/marble-diagrams/startWith.png) * - * ## Examples + * @example * * Emit a value when a timer starts. * diff --git a/packages/rxjs/src/internal/operators/subscribeOn.ts b/packages/rxjs/src/internal/operators/subscribeOn.ts index ca42845549..aa87297a70 100644 --- a/packages/rxjs/src/internal/operators/subscribeOn.ts +++ b/packages/rxjs/src/internal/operators/subscribeOn.ts @@ -8,9 +8,9 @@ import { Observable } from '@rxjs/observable'; * * Schedulers control the speed and order of emissions to observers from an Observable stream. * - * ![](subscribeOn.png) + * ![](/images/marble-diagrams/subscribeOn.png) * - * ## Example + * @example * * Given the following code: * diff --git a/packages/rxjs/src/internal/operators/switchAll.ts b/packages/rxjs/src/internal/operators/switchAll.ts index 0a1693bede..abf413455a 100644 --- a/packages/rxjs/src/internal/operators/switchAll.ts +++ b/packages/rxjs/src/internal/operators/switchAll.ts @@ -8,7 +8,7 @@ import { identity } from '../util/identity.js'; * * Flattens an Observable-of-Observables. * - * ![](switchAll.png) + * ![](/images/marble-diagrams/switchAll.png) * * `switchAll` subscribes to a source that is an observable of observables, also known as a * "higher-order observable" (or `Observable>`). It subscribes to the most recently @@ -18,7 +18,7 @@ import { identity } from '../util/identity.js'; * source observable completes, *and* any currently subscribed to inner observable also has completed, * if there are any. * - * ## Examples + * @example * * Spawn a new interval observable for each click event, but for every new * click, cancel the previous interval and subscribe to the new one diff --git a/packages/rxjs/src/internal/operators/switchMap.ts b/packages/rxjs/src/internal/operators/switchMap.ts index e836d4423a..93382fcc61 100644 --- a/packages/rxjs/src/internal/operators/switchMap.ts +++ b/packages/rxjs/src/internal/operators/switchMap.ts @@ -1,4 +1,4 @@ -import type { Subscriber} from '@rxjs/observable'; +import type { Subscriber } from '@rxjs/observable'; import { Observable, from, operate } from '@rxjs/observable'; import type { ObservableInput, OperatorFunction, ObservedValueOf } from '../types.js'; @@ -9,7 +9,7 @@ import type { ObservableInput, OperatorFunction, ObservedValueOf } from '../type * Maps each value to an Observable, then flattens all of * these inner Observables using {@link switchAll}. * - * ![](switchMap.png) + * ![](/images/marble-diagrams/switchMap.png) * * Returns an Observable that emits items based on applying a function that you * supply to each item emitted by the source Observable, where that function @@ -20,7 +20,7 @@ import type { ObservableInput, OperatorFunction, ObservedValueOf } from '../type * emitting items from the new one. It continues to behave like this for * subsequent inner Observables. * - * ## Example + * @example * * Generate new Observable according to source Observable values * diff --git a/packages/rxjs/src/internal/operators/switchMapTo.ts b/packages/rxjs/src/internal/operators/switchMapTo.ts index 2b734f3900..2e6eccab24 100644 --- a/packages/rxjs/src/internal/operators/switchMapTo.ts +++ b/packages/rxjs/src/internal/operators/switchMapTo.ts @@ -8,7 +8,7 @@ import type { ObservableInput, OperatorFunction, ObservedValueOf } from '../type * It's like {@link switchMap}, but maps each value * always to the same inner Observable. * - * ![](switchMapTo.png) + * ![](/images/marble-diagrams/switchMapTo.png) * * Maps each source value to the given Observable `innerObservable` regardless * of the source value, and then flattens those resulting Observables into one @@ -16,7 +16,7 @@ import type { ObservableInput, OperatorFunction, ObservedValueOf } from '../type * emits values only from the most recently emitted instance of * `innerObservable`. * - * ## Example + * @example * * Restart an interval Observable on every click event * diff --git a/packages/rxjs/src/internal/operators/take.ts b/packages/rxjs/src/internal/operators/take.ts index 531d52f8aa..378bdf5b20 100644 --- a/packages/rxjs/src/internal/operators/take.ts +++ b/packages/rxjs/src/internal/operators/take.ts @@ -8,14 +8,14 @@ import { Observable, operate } from '@rxjs/observable'; * Takes the first `count` values from the source, then * completes. * - * ![](take.png) + * ![](/images/marble-diagrams/take.png) * * `take` returns an Observable that emits only the first `count` values emitted * by the source Observable. If the source emits fewer than `count` values then * all of its values are emitted. After that, it completes, regardless if the * source completes. * - * ## Example + * @example * * Take the first 5 seconds of an infinite 1-second interval Observable * @@ -47,22 +47,22 @@ import { Observable, operate } from '@rxjs/observable'; export function take(count: number): MonoTypeOperatorFunction { return count <= 0 ? // If we are taking no values, that's empty. - () => EMPTY + () => EMPTY : (source) => - new Observable((destination) => { - let seen = 0; - const operatorSubscriber = operate({ - destination, - next: (value) => { - if (++seen < count) { - destination.next(value); - } else { - operatorSubscriber.unsubscribe(); - destination.next(value); - destination.complete(); - } - }, - }); - source.subscribe(operatorSubscriber); + new Observable((destination) => { + let seen = 0; + const operatorSubscriber = operate({ + destination, + next: (value) => { + if (++seen < count) { + destination.next(value); + } else { + operatorSubscriber.unsubscribe(); + destination.next(value); + destination.complete(); + } + }, }); + source.subscribe(operatorSubscriber); + }); } diff --git a/packages/rxjs/src/internal/operators/takeLast.ts b/packages/rxjs/src/internal/operators/takeLast.ts index 75f7cf656e..5adff694a1 100644 --- a/packages/rxjs/src/internal/operators/takeLast.ts +++ b/packages/rxjs/src/internal/operators/takeLast.ts @@ -6,7 +6,7 @@ import { Observable, operate } from '@rxjs/observable'; * Waits for the source to complete, then emits the last N values from the source, * as specified by the `count` argument. * - * ![](takeLast.png) + * ![](/images/marble-diagrams/takeLast.png) * * `takeLast` results in an observable that will hold values up to `count` values in memory, * until the source completes. It then pushes all values in memory to the consumer, in the @@ -19,7 +19,7 @@ import { Observable, operate } from '@rxjs/observable'; * **Warning**: Using `takeLast` with an observable that never completes will result * in an observable that never emits a value. * - * ## Example + * @example * * Take the last 3 values of an Observable with many values * @@ -45,39 +45,39 @@ export function takeLast(count: number): MonoTypeOperatorFunction { return count <= 0 ? () => EMPTY : (source) => - new Observable((destination) => { - // This is a ring buffer that will hold our values - let ring = new Array(count); - // This counter is how we track where we are at in the ring buffer. - let counter = 0; - source.subscribe( - operate({ - destination, - next: (value) => { - ring[counter++ % count] = value; - }, - complete: () => { - // We need to loop through our ring buffer. - // If we haven't filled the buffer yet, we can start at zero. - const start = count <= counter ? counter : 0; - // Only need to emit however many values we've seen, - // up to the expected count - const total = Math.min(count, counter); - for (let n = 0; n < total; n++) { - // The tricky bit here is we're incrementing `n`, and moving - // through our ring buffer, starting at the `start` index we - // found above. The `% count` will "wrap" us around to read - // the remaining values, if necessary. - destination.next(ring[(start + n) % count]); - } - // All done. This will also trigger clean up. - destination.complete(); - }, - finalize: () => { - // During finalization release the values in our buffer. - ring = null!; - }, - }) - ); - }); + new Observable((destination) => { + // This is a ring buffer that will hold our values + let ring = new Array(count); + // This counter is how we track where we are at in the ring buffer. + let counter = 0; + source.subscribe( + operate({ + destination, + next: (value) => { + ring[counter++ % count] = value; + }, + complete: () => { + // We need to loop through our ring buffer. + // If we haven't filled the buffer yet, we can start at zero. + const start = count <= counter ? counter : 0; + // Only need to emit however many values we've seen, + // up to the expected count + const total = Math.min(count, counter); + for (let n = 0; n < total; n++) { + // The tricky bit here is we're incrementing `n`, and moving + // through our ring buffer, starting at the `start` index we + // found above. The `% count` will "wrap" us around to read + // the remaining values, if necessary. + destination.next(ring[(start + n) % count]); + } + // All done. This will also trigger clean up. + destination.complete(); + }, + finalize: () => { + // During finalization release the values in our buffer. + ring = null!; + }, + }) + ); + }); } diff --git a/packages/rxjs/src/internal/operators/takeUntil.ts b/packages/rxjs/src/internal/operators/takeUntil.ts index 4afca106b3..73bc444d06 100644 --- a/packages/rxjs/src/internal/operators/takeUntil.ts +++ b/packages/rxjs/src/internal/operators/takeUntil.ts @@ -9,7 +9,7 @@ import { noop } from '../util/noop.js'; * Lets values pass until a second Observable, * `notifier`, emits a value. Then, it completes. * - * ![](takeUntil.png) + * ![](/images/marble-diagrams/takeUntil.png) * * `takeUntil` subscribes and begins mirroring the source Observable. It also * monitors a second Observable, `notifier` that you provide. If the `notifier` @@ -17,7 +17,7 @@ import { noop } from '../util/noop.js'; * and completes. If the `notifier` doesn't emit any value and completes * then `takeUntil` will pass all values. * - * ## Example + * @example * * Tick every second until the first click happens * diff --git a/packages/rxjs/src/internal/operators/takeWhile.ts b/packages/rxjs/src/internal/operators/takeWhile.ts index e4ba42b29e..4f91430472 100644 --- a/packages/rxjs/src/internal/operators/takeWhile.ts +++ b/packages/rxjs/src/internal/operators/takeWhile.ts @@ -16,7 +16,7 @@ export function takeWhile(predicate: (value: T, index: number) => boolean, in * Takes values from the source only while they pass the * condition given. When the first value does not satisfy, it completes. * - * ![](takeWhile.png) + * ![](/images/marble-diagrams/takeWhile.png) * * `takeWhile` subscribes and begins mirroring the source Observable. Each value * emitted on the source is given to the `predicate` function which returns a @@ -25,7 +25,7 @@ export function takeWhile(predicate: (value: T, index: number) => boolean, in * returns false, at which point `takeWhile` stops mirroring the source * Observable and completes the output Observable. * - * ## Example + * @example * * Emit click events only while the clientX property is greater than 200 * diff --git a/packages/rxjs/src/internal/operators/tap.ts b/packages/rxjs/src/internal/operators/tap.ts index dfe43c5306..0f4d2b7035 100644 --- a/packages/rxjs/src/internal/operators/tap.ts +++ b/packages/rxjs/src/internal/operators/tap.ts @@ -7,11 +7,11 @@ import { identity } from '../util/identity.js'; * * It provides a useful set of callbacks a user can register to do side-effects in * cases other than what the usual {@link Observer} callbacks are - * ({@link guide/glossary-and-semantics#next next}, - * {@link guide/glossary-and-semantics#error error} and/or - * {@link guide/glossary-and-semantics#complete complete}). + * ({@link https://rxjs.dev/guide/glossary-and-semantics#next | next}, + * {@link https://rxjs.dev/guide/glossary-and-semantics#error | error} and/or + * {@link https://rxjs.dev/guide/glossary-and-semantics#complete | complete}). * - * ## Example + * @example * * ```ts * import { fromEvent, switchMap, tap, interval, take } from 'rxjs'; @@ -55,13 +55,13 @@ export interface TapObserver extends Observer { subscribe: () => void; /** * The callback that `tap` operator invokes when an explicit - * {@link guide/glossary-and-semantics#unsubscription unsubscribe} happens. It won't get invoked on + * {@link https://rxjs.dev/guide/glossary-and-semantics#unsubscription | unsubscribe} happens. It won't get invoked on * `error` or `complete` events. */ unsubscribe: () => void; /** * The callback that `tap` operator invokes when any kind of - * {@link guide/glossary-and-semantics#finalization finalization} happens - either when + * {@link https://rxjs.dev/guide/glossary-and-semantics#finalization | finalization} happens - either when * the source Observable `error`s or `complete`s or when it gets explicitly unsubscribed * by the user. There is no difference in using this callback or the {@link finalize} * operator, but if you're already using `tap` operator, you can use this callback @@ -75,7 +75,7 @@ export interface TapObserver extends Observer { * * Used when you want to affect outside state with a notification without altering the notification * - * ![](tap.png) + * ![](/images/marble-diagrams/tap.png) * * Tap is designed to allow the developer a designated place to perform side effects. While you _could_ perform side-effects * inside of a `map` or a `mergeMap`, that would make their mapping functions impure, which isn't always a big deal, but will @@ -94,7 +94,7 @@ export interface TapObserver extends Observer { * in your observable `pipe`, log out the notifications as they are emitted by the source returned by the previous * operation. * - * ## Examples + * @example * * Check a random number before it is handled. Below is an observable that will use a random number between 0 and 1, * and emit `'big'` or `'small'` depending on the size of that number. But we wanted to log what the original number @@ -159,37 +159,37 @@ export function tap(observerOrNext?: Partial> | ((value: T) => return tapObserver ? (source) => - new Observable((destination) => { - tapObserver.subscribe?.(); - let isUnsub = true; - source.subscribe( - operate({ - destination, - next: (value) => { - tapObserver.next?.(value); - destination.next(value); - }, - error: (err) => { - isUnsub = false; - tapObserver.error?.(err); - destination.error(err); - }, - complete: () => { - isUnsub = false; - tapObserver.complete?.(); - destination.complete(); - }, - finalize: () => { - if (isUnsub) { - tapObserver.unsubscribe?.(); - } - tapObserver.finalize?.(); - }, - }) - ); - }) + new Observable((destination) => { + tapObserver.subscribe?.(); + let isUnsub = true; + source.subscribe( + operate({ + destination, + next: (value) => { + tapObserver.next?.(value); + destination.next(value); + }, + error: (err) => { + isUnsub = false; + tapObserver.error?.(err); + destination.error(err); + }, + complete: () => { + isUnsub = false; + tapObserver.complete?.(); + destination.complete(); + }, + finalize: () => { + if (isUnsub) { + tapObserver.unsubscribe?.(); + } + tapObserver.finalize?.(); + }, + }) + ); + }) : // Tap was called with no valid tap observer or handler - // (e.g. `tap(null)` or `tap()`) - // so we're going to just mirror the source. - identity; + // (e.g. `tap(null)` or `tap()`) + // so we're going to just mirror the source. + identity; } diff --git a/packages/rxjs/src/internal/operators/throttle.ts b/packages/rxjs/src/internal/operators/throttle.ts index bdcec83c9b..53548007cc 100644 --- a/packages/rxjs/src/internal/operators/throttle.ts +++ b/packages/rxjs/src/internal/operators/throttle.ts @@ -40,7 +40,7 @@ export interface ThrottleConfig { * It's like {@link throttleTime}, but the silencing * duration is determined by a second Observable. * - * ![](throttle.svg) + * ![](/images/marble-diagrams/throttle.svg) * * `throttle` emits the source Observable values on the output Observable * when its internal timer is disabled, and ignores source values when the timer @@ -51,7 +51,7 @@ export interface ThrottleConfig { * value, the timer is disabled, and this process repeats for the * next source value. * - * ## Example + * @example * * Emit clicks at a rate of at most one click per second * diff --git a/packages/rxjs/src/internal/operators/throttleTime.ts b/packages/rxjs/src/internal/operators/throttleTime.ts index d22d1d6180..2ef379a44d 100644 --- a/packages/rxjs/src/internal/operators/throttleTime.ts +++ b/packages/rxjs/src/internal/operators/throttleTime.ts @@ -11,7 +11,7 @@ import { timer } from '../observable/timer.js'; * Lets a value pass, then ignores source values for the * next `duration` milliseconds. * - * ![](throttleTime.png) + * ![](/images/marble-diagrams/throttleTime.png) * * `throttleTime` emits the source Observable values on the output Observable * when its internal timer is disabled, and ignores source values when the timer @@ -22,7 +22,7 @@ import { timer } from '../observable/timer.js'; * and this process repeats for the next source value. Optionally takes a * {@link SchedulerLike} for managing timers. * - * ## Examples + * @example * * ### Limit click rate * diff --git a/packages/rxjs/src/internal/operators/throwIfEmpty.ts b/packages/rxjs/src/internal/operators/throwIfEmpty.ts index 231175f0ba..9c6269761e 100644 --- a/packages/rxjs/src/internal/operators/throwIfEmpty.ts +++ b/packages/rxjs/src/internal/operators/throwIfEmpty.ts @@ -7,9 +7,9 @@ import { Observable, operate } from '@rxjs/observable'; * an error. The error will be created at that time by the optional * `errorFactory` argument, otherwise, the error will be {@link EmptyError}. * - * ![](throwIfEmpty.png) + * ![](/images/marble-diagrams/throwIfEmpty.png) * - * ## Example + * @example * * Throw an error if the document wasn't clicked within 1 second * diff --git a/packages/rxjs/src/internal/operators/timeInterval.ts b/packages/rxjs/src/internal/operators/timeInterval.ts index 831175919b..90e366a276 100644 --- a/packages/rxjs/src/internal/operators/timeInterval.ts +++ b/packages/rxjs/src/internal/operators/timeInterval.ts @@ -13,9 +13,9 @@ import { Observable, operate } from '@rxjs/observable'; * Convert an Observable that emits items into one that * emits indications of the amount of time elapsed between those emissions. * - * ![](timeInterval.png) + * ![](/images/marble-diagrams/timeInterval.png) * - * ## Example + * @example * * Emit interval between current value with the last value * @@ -61,10 +61,9 @@ export function timeInterval(scheduler: SchedulerLike = asyncScheduler): Oper // TODO(benlesh): make this an interface, export the interface, but not the implemented class, // there's no reason users should be manually creating this type. - +/** + * @deprecated Internal implementation detail, do not construct directly. Will be made an interface in v8. + */ export class TimeInterval { - /** - * @deprecated Internal implementation detail, do not construct directly. Will be made an interface in v8. - */ - constructor(public value: T, public interval: number) {} + constructor(public value: T, public interval: number) { } } diff --git a/packages/rxjs/src/internal/operators/timeout.ts b/packages/rxjs/src/internal/operators/timeout.ts index 85b6d10b0e..9bcfd11470 100644 --- a/packages/rxjs/src/internal/operators/timeout.ts +++ b/packages/rxjs/src/internal/operators/timeout.ts @@ -1,7 +1,7 @@ import { asyncScheduler } from '../scheduler/async.js'; import type { MonoTypeOperatorFunction, SchedulerLike, OperatorFunction, ObservableInput, ObservedValueOf } from '../types.js'; import { isValidDate } from '../util/isDate.js'; -import type { Subscription} from '@rxjs/observable'; +import type { Subscription } from '@rxjs/observable'; import { Observable, from, operate } from '@rxjs/observable'; import { executeSchedule } from '../util/executeSchedule.js'; @@ -94,7 +94,7 @@ export class TimeoutError extends Error { * `first` is _not_ provided, the value from `each` will be used to check timeout conditions for the arrival of the first * value and all subsequent values. If `first` _is_ provided, `each` will only be use to check all values after the first. * - * ## Examples + * @example * * Emit a custom error if there is too much time between values * @@ -174,7 +174,7 @@ export function timeout, M = unknown>( * In this case, you would check the error for `instanceof TimeoutError` to validate that the error was indeed from `timeout`, and * not from some other source. If it's not from `timeout`, you should probably rethrow it if you're in a `catchError`. * - * ## Examples + * @example * * Emit a {@link TimeoutError} if the first value, and _only_ the first value, does not arrive within 5 seconds * @@ -241,7 +241,7 @@ export function timeout(config: Omit, ' * * Errors if the first value doesn't show up before the given date and time * - * ![](timeout.png) + * ![](/images/marble-diagrams/timeout.png) * * @param first The date to at which the resulting observable will timeout if the source observable * does not emit at least one value. @@ -255,7 +255,7 @@ export function timeout(first: Date, scheduler?: SchedulerLike): MonoTypeOper * * Errors if it waits too long between any value * - * ![](timeout.png) + * ![](/images/marble-diagrams/timeout.png) * * @param each The time allowed between each pushed value from the source before the resulting observable * will timeout. @@ -269,7 +269,7 @@ export function timeout(each: number, scheduler?: SchedulerLike): MonoTypeOpe * * Timeouts on Observable that doesn't emit values fast enough. * - * ![](timeout.png) + * ![](/images/marble-diagrams/timeout.png) * * @see {@link timeoutWith} * diff --git a/packages/rxjs/src/internal/operators/timeoutWith.ts b/packages/rxjs/src/internal/operators/timeoutWith.ts index 0c62f5ae43..862449fc79 100644 --- a/packages/rxjs/src/internal/operators/timeoutWith.ts +++ b/packages/rxjs/src/internal/operators/timeoutWith.ts @@ -31,7 +31,7 @@ export function timeoutWith(waitFor: number, switchTo: ObservableInput, * Can be used to set a timeout only for the first value, however it's recommended to use the {@link timeout} operator with * the `first` configuration to get the same effect. * - * ## Examples + * @example * * Fallback to a faster observable * diff --git a/packages/rxjs/src/internal/operators/timestamp.ts b/packages/rxjs/src/internal/operators/timestamp.ts index 2b99499914..584368fa51 100644 --- a/packages/rxjs/src/internal/operators/timestamp.ts +++ b/packages/rxjs/src/internal/operators/timestamp.ts @@ -11,9 +11,9 @@ import { map } from './map.js'; * default, it uses the `asyncScheduler` which simply returns `Date.now()` (milliseconds since 1970/01/01 * 00:00:00:000) and therefore is of type `number`. * - * ![](timestamp.png) + * ![](/images/marble-diagrams/timestamp.png) * - * ## Example + * @example * * In this example there is a timestamp attached to the document's click events * diff --git a/packages/rxjs/src/internal/operators/toArray.ts b/packages/rxjs/src/internal/operators/toArray.ts index 9d9ba327df..9a5e753d25 100644 --- a/packages/rxjs/src/internal/operators/toArray.ts +++ b/packages/rxjs/src/internal/operators/toArray.ts @@ -9,13 +9,13 @@ const arrReducer = (arr: any[], value: any) => (arr.push(value), arr); * * Get all values inside an array when the source completes * - * ![](toArray.png) + * ![](/images/marble-diagrams/toArray.png) * * `toArray` will wait until the source Observable completes before emitting * the array containing all emissions. When the source Observable errors no * array will be emitted. * - * ## Example + * @example * * ```ts * import { interval, take, toArray } from 'rxjs'; diff --git a/packages/rxjs/src/internal/operators/window.ts b/packages/rxjs/src/internal/operators/window.ts index 7adb013f3d..17691a3a80 100644 --- a/packages/rxjs/src/internal/operators/window.ts +++ b/packages/rxjs/src/internal/operators/window.ts @@ -10,7 +10,7 @@ import { noop } from '../util/noop.js'; * It's like {@link buffer}, but emits a nested Observable * instead of an array. * - * ![](window.png) + * ![](/images/marble-diagrams/window.png) * * Returns an Observable that emits windows of items it collects from the source * Observable. The output Observable emits connected, non-overlapping @@ -19,7 +19,7 @@ import { noop } from '../util/noop.js'; * `ObservableInput` accepts. It internally gets converted to an Observable. * Because each window is an Observable, the output is a higher-order Observable. * - * ## Example + * @example * * In every window of 1 second each, emit at most 2 click events * diff --git a/packages/rxjs/src/internal/operators/windowCount.ts b/packages/rxjs/src/internal/operators/windowCount.ts index 497b78e007..9c2fc36ed5 100644 --- a/packages/rxjs/src/internal/operators/windowCount.ts +++ b/packages/rxjs/src/internal/operators/windowCount.ts @@ -9,7 +9,7 @@ import type { OperatorFunction } from '../types.js'; * It's like {@link bufferCount}, but emits a nested * Observable instead of an array. * - * ![](windowCount.png) + * ![](/images/marble-diagrams/windowCount.png) * * Returns an Observable that emits windows of items it collects from the source * Observable. The output Observable emits windows every `startWindowEvery` @@ -20,7 +20,7 @@ import type { OperatorFunction } from '../types.js'; * started immediately at the start of the source and when each window completes * with size `windowSize`. * - * ## Examples + * @example * * Ignore every 3rd click event, starting from the first one * diff --git a/packages/rxjs/src/internal/operators/windowTime.ts b/packages/rxjs/src/internal/operators/windowTime.ts index 6258945156..ab1ae26398 100644 --- a/packages/rxjs/src/internal/operators/windowTime.ts +++ b/packages/rxjs/src/internal/operators/windowTime.ts @@ -26,7 +26,7 @@ export function windowTime( * It's like {@link bufferTime}, but emits a nested * Observable instead of an array. * - * ![](windowTime.png) + * ![](/images/marble-diagrams/windowTime.png) * * Returns an Observable that emits windows of items it collects from the source * Observable. The output Observable starts a new window periodically, as @@ -41,7 +41,7 @@ export function windowTime( * after emitting last value and next one still will open as specified by * `windowTimeSpan` and `windowCreationInterval` arguments. * - * ## Examples + * @example * * In every window of 1 second each, emit at most 2 click events * diff --git a/packages/rxjs/src/internal/operators/windowToggle.ts b/packages/rxjs/src/internal/operators/windowToggle.ts index a1ae20bc0f..dafbb02b44 100644 --- a/packages/rxjs/src/internal/operators/windowToggle.ts +++ b/packages/rxjs/src/internal/operators/windowToggle.ts @@ -12,7 +12,7 @@ import { arrRemove } from '../util/arrRemove.js'; * It's like {@link bufferToggle}, but emits a nested * Observable instead of an array. * - * ![](windowToggle.png) + * ![](/images/marble-diagrams/windowToggle.png) * * Returns an Observable that emits windows of items it collects from the source * Observable. The output Observable emits windows that contain those items @@ -20,7 +20,7 @@ import { arrRemove } from '../util/arrRemove.js'; * Observable emits an item and when the Observable returned by * `closingSelector` emits an item. * - * ## Example + * @example * * Every other second, emit the click events from the next 500ms * diff --git a/packages/rxjs/src/internal/operators/windowWhen.ts b/packages/rxjs/src/internal/operators/windowWhen.ts index 89d5ce1296..49bc935002 100644 --- a/packages/rxjs/src/internal/operators/windowWhen.ts +++ b/packages/rxjs/src/internal/operators/windowWhen.ts @@ -1,4 +1,4 @@ -import type { Subscriber} from '@rxjs/observable'; +import type { Subscriber } from '@rxjs/observable'; import { operate, Observable, from } from '@rxjs/observable'; import { Subject } from '../Subject.js'; import type { ObservableInput, OperatorFunction } from '../types.js'; @@ -12,7 +12,7 @@ import { noop } from '../util/noop.js'; * It's like {@link bufferWhen}, but emits a nested * Observable instead of an array. * - * ![](windowWhen.svg) + * ![](/images/marble-diagrams/windowWhen.svg) * * Returns an Observable that emits Observable windows of items it collects from * the source Observable. The output Observable emits connected, non-overlapping @@ -22,7 +22,7 @@ import { noop } from '../util/noop.js'; * `closingSelector` emits `next`, the previous window completes and a new window * is emitted to the output subscriber. * - * ## Example + * @example * * Emit only the first two clicks events in every window of [1-5] random seconds * diff --git a/packages/rxjs/src/internal/operators/withLatestFrom.ts b/packages/rxjs/src/internal/operators/withLatestFrom.ts index b50274d79a..34136f852d 100644 --- a/packages/rxjs/src/internal/operators/withLatestFrom.ts +++ b/packages/rxjs/src/internal/operators/withLatestFrom.ts @@ -19,7 +19,7 @@ export function withLatestFrom( * computes a formula using that value plus the latest values from other input * Observables, then emits the output of that formula. * - * ![](withLatestFrom.png) + * ![](/images/marble-diagrams/withLatestFrom.png) * * `withLatestFrom` combines each value from the source Observable (the * instance) with the latest values from the other input Observables only when @@ -27,7 +27,7 @@ export function withLatestFrom( * the value to be emitted on the output Observable. All input Observables must * emit at least one value before the output Observable will emit a value. * - * ## Example + * @example * * On every click event, emit an array with the latest timer event plus the click event * diff --git a/packages/rxjs/src/internal/scheduler/animationFrame.ts b/packages/rxjs/src/internal/scheduler/animationFrame.ts index 7b1d6172af..7e95705370 100644 --- a/packages/rxjs/src/internal/scheduler/animationFrame.ts +++ b/packages/rxjs/src/internal/scheduler/animationFrame.ts @@ -14,7 +14,7 @@ import { AnimationFrameScheduler } from './AnimationFrameScheduler.js'; * It makes sure scheduled task will happen just before next browser content repaint, * thus performing animations as efficiently as possible. * - * ## Example + * @example * Schedule div height animation * ```ts * // html:
diff --git a/packages/rxjs/src/internal/scheduler/asap.ts b/packages/rxjs/src/internal/scheduler/asap.ts index 09b3c32438..48180b3d3f 100644 --- a/packages/rxjs/src/internal/scheduler/asap.ts +++ b/packages/rxjs/src/internal/scheduler/asap.ts @@ -21,7 +21,7 @@ import { AsapScheduler } from './AsapScheduler.js'; * that task will execute first. That being said, if you need to schedule task asynchronously, but * as soon as possible, `asapScheduler` scheduler is your best bet. * - * ## Example + * @example * Compare async and asap scheduler< * ```ts * import { asapScheduler, asyncScheduler } from 'rxjs'; diff --git a/packages/rxjs/src/internal/scheduler/async.ts b/packages/rxjs/src/internal/scheduler/async.ts index d683d65f52..bbea8f09fd 100644 --- a/packages/rxjs/src/internal/scheduler/async.ts +++ b/packages/rxjs/src/internal/scheduler/async.ts @@ -15,7 +15,7 @@ import { AsyncScheduler } from './AsyncScheduler.js'; * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`), * better choice will be the {@link asapScheduler} scheduler. * - * ## Examples + * @example * Use async scheduler to delay task * ```ts * import { asyncScheduler } from 'rxjs'; diff --git a/packages/rxjs/src/internal/scheduler/queue.ts b/packages/rxjs/src/internal/scheduler/queue.ts index f1bcb3376a..1cd0bd197a 100644 --- a/packages/rxjs/src/internal/scheduler/queue.ts +++ b/packages/rxjs/src/internal/scheduler/queue.ts @@ -17,7 +17,7 @@ import { QueueScheduler } from './QueueScheduler.js'; * This means that when you execute task with `queueScheduler` scheduler, you are sure it will end * before any other task scheduled with that scheduler will start. * - * ## Examples + * @example * Schedule recursively first, then do something * ```ts * import { queueScheduler } from 'rxjs'; diff --git a/packages/rxjs/src/internal/testing/TestScheduler.ts b/packages/rxjs/src/internal/testing/TestScheduler.ts index 092bd15cb0..1c98cdcf32 100644 --- a/packages/rxjs/src/internal/testing/TestScheduler.ts +++ b/packages/rxjs/src/internal/testing/TestScheduler.ts @@ -341,12 +341,12 @@ export class TestScheduler extends VirtualTimeScheduler { typeof values !== 'object' ? (x: any) => x : (x: any) => { - // Support Observable-of-Observables - if (materializeInnerObservables && values[x] instanceof ColdObservable) { - return values[x].messages; - } - return values[x]; - }; + // Support Observable-of-Observables + if (materializeInnerObservables && values[x] instanceof ColdObservable) { + return values[x].messages; + } + return values[x]; + }; let groupStart = -1; for (let i = 0; i < len; i++) { @@ -645,7 +645,7 @@ export class TestScheduler extends VirtualTimeScheduler { * is, in 'run mode' there is no need to explicitly pass a `TestScheduler` * instance to observable creators or operators. * - * @see {@link /guide/testing/marble-testing} + * @see [Marble testing](/guide/testing/marble-testing) */ run(callback: (helpers: RunHelpers) => T): T { const prevFrameTimeFactor = TestScheduler.frameTimeFactor; diff --git a/packages/rxjs/src/internal/types.ts b/packages/rxjs/src/internal/types.ts index bbb680342b..218c6d94ec 100644 --- a/packages/rxjs/src/internal/types.ts +++ b/packages/rxjs/src/internal/types.ts @@ -26,7 +26,7 @@ export interface UnaryFunction { (source: T): R; } -export interface OperatorFunction extends UnaryFunction, Observable> {} +export interface OperatorFunction extends UnaryFunction, Observable> { } export type FactoryOrValue = T | (() => T); @@ -36,7 +36,7 @@ export type FactoryOrValue = T | (() => T); * Used to describe {@link OperatorFunction} with the only one type: `OperatorFunction`. * */ -export interface MonoTypeOperatorFunction extends OperatorFunction {} +export interface MonoTypeOperatorFunction extends OperatorFunction { } /** * A value and the time at which it was emitted. @@ -174,9 +174,9 @@ export type PartialObserver = NextObserver | ErrorObserver | Completion /** * An object interface that defines a set of callback functions a user can use to get * notified of any set of {@link Observable} - * {@link guide/glossary-and-semantics#notification notification} events. + * {@link https://rxjs.dev/guide/glossary-and-semantics#notification | notification} events. * - * For more info, please refer to {@link guide/observer this guide}. + * For more info, please refer to {@link https://rxjs.dev/guide/observer this | guide}. */ export interface Observer { /** @@ -184,7 +184,7 @@ export interface Observer { * the producer "has" the `value`. It won't be called if `error` or `complete` callback * functions have been called, nor after the consumer has unsubscribed. * - * For more info, please refer to {@link guide/glossary-and-semantics#next this guide}. + * For more info, please refer to {@link https://rxjs.dev/guide/glossary-and-semantics#next this | guide}. */ next: (value: T) => void; /** @@ -194,7 +194,7 @@ export interface Observer { * `complete` callback function have been called previously, nor it can't be called if * the consumer has unsubscribed. * - * For more info, please refer to {@link guide/glossary-and-semantics#error this guide}. + * For more info, please refer to {@link https://rxjs.dev/guide/glossary-and-semantics#error this | guide}. */ error: (err: any) => void; /** @@ -204,12 +204,12 @@ export interface Observer { * if the `error` callback function have been called previously, nor it can't be called * if the consumer has unsubscribed. * - * For more info, please refer to {@link guide/glossary-and-semantics#complete this guide}. + * For more info, please refer to {@link https://rxjs.dev/guide/glossary-and-semantics#complete this | guide}. */ complete: () => void; } -export interface SubjectLike extends Observer, Subscribable {} +export interface SubjectLike extends Observer, Subscribable { } /* SCHEDULER INTERFACES */ @@ -300,10 +300,10 @@ export type ValueFromArray
= A extends Array = T extends { kind: 'N' | 'E' | 'C' } ? T extends NextNotification - ? T extends { value: infer V } - ? V - : undefined - : never + ? T extends { value: infer V } + ? V + : undefined + : never : never; /** diff --git a/packages/rxjs/src/internal/util/NotFoundError.ts b/packages/rxjs/src/internal/util/NotFoundError.ts index dfcec39584..ebd1f2daca 100644 --- a/packages/rxjs/src/internal/util/NotFoundError.ts +++ b/packages/rxjs/src/internal/util/NotFoundError.ts @@ -2,7 +2,7 @@ * An error thrown when a value or values are missing from an * observable sequence. * - * @see {@link operators/single} + * @see {@link single} */ export class NotFoundError extends Error { /** diff --git a/packages/rxjs/src/internal/util/SequenceError.ts b/packages/rxjs/src/internal/util/SequenceError.ts index 2bfe0228dc..f188b6bca6 100644 --- a/packages/rxjs/src/internal/util/SequenceError.ts +++ b/packages/rxjs/src/internal/util/SequenceError.ts @@ -2,7 +2,7 @@ * An error thrown when something is wrong with the sequence of * values arriving on the observable. * - * @see {@link operators/single} + * @see {@link single} */ export class SequenceError extends Error { /** diff --git a/packages/rxjs/src/internal/util/identity.ts b/packages/rxjs/src/internal/util/identity.ts index 0b07958e7e..c7467ad253 100644 --- a/packages/rxjs/src/internal/util/identity.ts +++ b/packages/rxjs/src/internal/util/identity.ts @@ -2,7 +2,7 @@ * This function takes one parameter and just returns it. Simply put, * this is like `(x: T): T => x`. * - * ## Examples + * @example * * This is useful in some cases when using things like `mergeMap` * diff --git a/packages/rxjs/src/operators/index.ts b/packages/rxjs/src/operators/index.ts index fbbf558f4b..513ed64b38 100644 --- a/packages/rxjs/src/operators/index.ts +++ b/packages/rxjs/src/operators/index.ts @@ -1,3 +1,12 @@ +/** + * :::info + * This module is available as a nested import; however all of its methods are re-exports and all documentation can be found within the [rxjs#functions](/api/rxjs#functions) section. + * ::: + * + * @packageDocumentation + * @module operators + */ + /* Operator exports */ export { audit } from '../internal/operators/audit.js'; export { auditTime } from '../internal/operators/auditTime.js'; diff --git a/packages/rxjs/src/testing/index.ts b/packages/rxjs/src/testing/index.ts index c4b3462ab6..294534fc78 100644 --- a/packages/rxjs/src/testing/index.ts +++ b/packages/rxjs/src/testing/index.ts @@ -1,2 +1,5 @@ +/** + * @module testing + */ export type { RunHelpers } from '../internal/testing/TestScheduler.js'; export { TestScheduler } from '../internal/testing/TestScheduler.js'; diff --git a/packages/rxjs/src/webSocket/index.ts b/packages/rxjs/src/webSocket/index.ts index 7dcb5c86f8..d394ef14fe 100644 --- a/packages/rxjs/src/webSocket/index.ts +++ b/packages/rxjs/src/webSocket/index.ts @@ -1,3 +1,6 @@ +/** + * @module webSocket + */ export { webSocket as webSocket } from '../internal/observable/dom/webSocket.js'; export type { WebSocketSubjectConfig } from '../internal/observable/dom/WebSocketSubject.js'; export { WebSocketSubject } from '../internal/observable/dom/WebSocketSubject.js'; diff --git a/yarn.lock b/yarn.lock index 32e4e642ec..f8f2efdf8e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,6 +7,164 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== +"@algolia/abtesting@1.12.2": + version "1.12.2" + resolved "https://registry.yarnpkg.com/@algolia/abtesting/-/abtesting-1.12.2.tgz#1cba5e3c654d02c6d435822a0a0070a5c435daa6" + integrity sha512-oWknd6wpfNrmRcH0vzed3UPX0i17o4kYLM5OMITyMVM2xLgaRbIafoxL0e8mcrNNb0iORCJA0evnNDKRYth5WQ== + dependencies: + "@algolia/client-common" "5.46.2" + "@algolia/requester-browser-xhr" "5.46.2" + "@algolia/requester-fetch" "5.46.2" + "@algolia/requester-node-http" "5.46.2" + +"@algolia/autocomplete-core@1.17.7": + version "1.17.7" + resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.17.7.tgz#2c410baa94a47c5c5f56ed712bb4a00ebe24088b" + integrity sha512-BjiPOW6ks90UKl7TwMv7oNQMnzU+t/wk9mgIDi6b1tXpUek7MW0lbNOUHpvam9pe3lVCf4xPFT+lK7s+e+fs7Q== + dependencies: + "@algolia/autocomplete-plugin-algolia-insights" "1.17.7" + "@algolia/autocomplete-shared" "1.17.7" + +"@algolia/autocomplete-plugin-algolia-insights@1.17.7": + version "1.17.7" + resolved "https://registry.yarnpkg.com/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.17.7.tgz#7d2b105f84e7dd8f0370aa4c4ab3b704e6760d82" + integrity sha512-Jca5Ude6yUOuyzjnz57og7Et3aXjbwCSDf/8onLHSQgw1qW3ALl9mrMWaXb5FmPVkV3EtkD2F/+NkT6VHyPu9A== + dependencies: + "@algolia/autocomplete-shared" "1.17.7" + +"@algolia/autocomplete-preset-algolia@1.17.7": + version "1.17.7" + resolved "https://registry.yarnpkg.com/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.17.7.tgz#c9badc0d73d62db5bf565d839d94ec0034680ae9" + integrity sha512-ggOQ950+nwbWROq2MOCIL71RE0DdQZsceqrg32UqnhDz8FlO9rL8ONHNsI2R1MH0tkgVIDKI/D0sMiUchsFdWA== + dependencies: + "@algolia/autocomplete-shared" "1.17.7" + +"@algolia/autocomplete-shared@1.17.7": + version "1.17.7" + resolved "https://registry.yarnpkg.com/@algolia/autocomplete-shared/-/autocomplete-shared-1.17.7.tgz#105e84ad9d1a31d3fb86ba20dc890eefe1a313a0" + integrity sha512-o/1Vurr42U/qskRSuhBH+VKxMvkkUVTLU6WZQr+L5lGZZLYWyhdzWjW0iGXY7EkwRTjBqvN2EsR81yCTGV/kmg== + +"@algolia/client-abtesting@5.46.2": + version "5.46.2" + resolved "https://registry.yarnpkg.com/@algolia/client-abtesting/-/client-abtesting-5.46.2.tgz#264a72f0e9d2fe0d0dc5c3d2d16bbb9cfe2ce9e8" + integrity sha512-oRSUHbylGIuxrlzdPA8FPJuwrLLRavOhAmFGgdAvMcX47XsyM+IOGa9tc7/K5SPvBqn4nhppOCEz7BrzOPWc4A== + dependencies: + "@algolia/client-common" "5.46.2" + "@algolia/requester-browser-xhr" "5.46.2" + "@algolia/requester-fetch" "5.46.2" + "@algolia/requester-node-http" "5.46.2" + +"@algolia/client-analytics@5.46.2": + version "5.46.2" + resolved "https://registry.yarnpkg.com/@algolia/client-analytics/-/client-analytics-5.46.2.tgz#3f00a237508aa0c46c9c02dea9c855e0a78e241f" + integrity sha512-EPBN2Oruw0maWOF4OgGPfioTvd+gmiNwx0HmD9IgmlS+l75DatcBkKOPNJN+0z3wBQWUO5oq602ATxIfmTQ8bA== + dependencies: + "@algolia/client-common" "5.46.2" + "@algolia/requester-browser-xhr" "5.46.2" + "@algolia/requester-fetch" "5.46.2" + "@algolia/requester-node-http" "5.46.2" + +"@algolia/client-common@5.46.2": + version "5.46.2" + resolved "https://registry.yarnpkg.com/@algolia/client-common/-/client-common-5.46.2.tgz#7f282fd8f721b0d96958445df2170f4c7dce6aac" + integrity sha512-Hj8gswSJNKZ0oyd0wWissqyasm+wTz1oIsv5ZmLarzOZAp3vFEda8bpDQ8PUhO+DfkbiLyVnAxsPe4cGzWtqkg== + +"@algolia/client-insights@5.46.2": + version "5.46.2" + resolved "https://registry.yarnpkg.com/@algolia/client-insights/-/client-insights-5.46.2.tgz#194b7b529ee8a4ffd5d70037745082996c3b9aa0" + integrity sha512-6dBZko2jt8FmQcHCbmNLB0kCV079Mx/DJcySTL3wirgDBUH7xhY1pOuUTLMiGkqM5D8moVZTvTdRKZUJRkrwBA== + dependencies: + "@algolia/client-common" "5.46.2" + "@algolia/requester-browser-xhr" "5.46.2" + "@algolia/requester-fetch" "5.46.2" + "@algolia/requester-node-http" "5.46.2" + +"@algolia/client-personalization@5.46.2": + version "5.46.2" + resolved "https://registry.yarnpkg.com/@algolia/client-personalization/-/client-personalization-5.46.2.tgz#d604da7f0a3df1b3e2a9fe338d368e48fb781f8e" + integrity sha512-1waE2Uqh/PHNeDXGn/PM/WrmYOBiUGSVxAWqiJIj73jqPqvfzZgzdakHscIVaDl6Cp+j5dwjsZ5LCgaUr6DtmA== + dependencies: + "@algolia/client-common" "5.46.2" + "@algolia/requester-browser-xhr" "5.46.2" + "@algolia/requester-fetch" "5.46.2" + "@algolia/requester-node-http" "5.46.2" + +"@algolia/client-query-suggestions@5.46.2": + version "5.46.2" + resolved "https://registry.yarnpkg.com/@algolia/client-query-suggestions/-/client-query-suggestions-5.46.2.tgz#f13bc5897bfbdc19509d430a26e9bbe2402e00c9" + integrity sha512-EgOzTZkyDcNL6DV0V/24+oBJ+hKo0wNgyrOX/mePBM9bc9huHxIY2352sXmoZ648JXXY2x//V1kropF/Spx83w== + dependencies: + "@algolia/client-common" "5.46.2" + "@algolia/requester-browser-xhr" "5.46.2" + "@algolia/requester-fetch" "5.46.2" + "@algolia/requester-node-http" "5.46.2" + +"@algolia/client-search@5.46.2": + version "5.46.2" + resolved "https://registry.yarnpkg.com/@algolia/client-search/-/client-search-5.46.2.tgz#771367916aaa3fb7a19d5944f8375504b0568ba6" + integrity sha512-ZsOJqu4HOG5BlvIFnMU0YKjQ9ZI6r3C31dg2jk5kMWPSdhJpYL9xa5hEe7aieE+707dXeMI4ej3diy6mXdZpgA== + dependencies: + "@algolia/client-common" "5.46.2" + "@algolia/requester-browser-xhr" "5.46.2" + "@algolia/requester-fetch" "5.46.2" + "@algolia/requester-node-http" "5.46.2" + +"@algolia/ingestion@1.46.2": + version "1.46.2" + resolved "https://registry.yarnpkg.com/@algolia/ingestion/-/ingestion-1.46.2.tgz#2a5d8a592d9f864dfb438722506382af56f8554f" + integrity sha512-1Uw2OslTWiOFDtt83y0bGiErJYy5MizadV0nHnOoHFWMoDqWW0kQoMFI65pXqRSkVvit5zjXSLik2xMiyQJDWQ== + dependencies: + "@algolia/client-common" "5.46.2" + "@algolia/requester-browser-xhr" "5.46.2" + "@algolia/requester-fetch" "5.46.2" + "@algolia/requester-node-http" "5.46.2" + +"@algolia/monitoring@1.46.2": + version "1.46.2" + resolved "https://registry.yarnpkg.com/@algolia/monitoring/-/monitoring-1.46.2.tgz#bd199368a49cb799cf12cfe76c49de6dd3021148" + integrity sha512-xk9f+DPtNcddWN6E7n1hyNNsATBCHIqAvVGG2EAGHJc4AFYL18uM/kMTiOKXE/LKDPyy1JhIerrh9oYb7RBrgw== + dependencies: + "@algolia/client-common" "5.46.2" + "@algolia/requester-browser-xhr" "5.46.2" + "@algolia/requester-fetch" "5.46.2" + "@algolia/requester-node-http" "5.46.2" + +"@algolia/recommend@5.46.2": + version "5.46.2" + resolved "https://registry.yarnpkg.com/@algolia/recommend/-/recommend-5.46.2.tgz#e74bade1254046ed9be8ccd37f2a116ab9799508" + integrity sha512-NApbTPj9LxGzNw4dYnZmj2BoXiAc8NmbbH6qBNzQgXklGklt/xldTvu+FACN6ltFsTzoNU6j2mWNlHQTKGC5+Q== + dependencies: + "@algolia/client-common" "5.46.2" + "@algolia/requester-browser-xhr" "5.46.2" + "@algolia/requester-fetch" "5.46.2" + "@algolia/requester-node-http" "5.46.2" + +"@algolia/requester-browser-xhr@5.46.2": + version "5.46.2" + resolved "https://registry.yarnpkg.com/@algolia/requester-browser-xhr/-/requester-browser-xhr-5.46.2.tgz#7662480143405e815e1eed99136b4b2acd838ee7" + integrity sha512-ekotpCwpSp033DIIrsTpYlGUCF6momkgupRV/FA3m62SreTSZUKjgK6VTNyG7TtYfq9YFm/pnh65bATP/ZWJEg== + dependencies: + "@algolia/client-common" "5.46.2" + +"@algolia/requester-fetch@5.46.2": + version "5.46.2" + resolved "https://registry.yarnpkg.com/@algolia/requester-fetch/-/requester-fetch-5.46.2.tgz#dee07f0131b75f30d083bafd6fb878afe7402eb9" + integrity sha512-gKE+ZFi/6y7saTr34wS0SqYFDcjHW4Wminv8PDZEi0/mE99+hSrbKgJWxo2ztb5eqGirQTgIh1AMVacGGWM1iw== + dependencies: + "@algolia/client-common" "5.46.2" + +"@algolia/requester-node-http@5.46.2": + version "5.46.2" + resolved "https://registry.yarnpkg.com/@algolia/requester-node-http/-/requester-node-http-5.46.2.tgz#7869d67cb2926bbdbfbfed2b4757e547c2e227eb" + integrity sha512-ciPihkletp7ttweJ8Zt+GukSVLp2ANJHU+9ttiSxsJZThXc4Y2yJ8HGVWesW5jN1zrsZsezN71KrMx/iZsOYpg== + dependencies: + "@algolia/client-common" "5.46.2" + +"@alloc/quick-lru@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@alloc/quick-lru/-/quick-lru-5.2.0.tgz#7bf68b20c0a350f936915fcae06f58e32007ce30" + integrity sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw== + "@ampproject/remapping@1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-1.0.2.tgz#a7ebbadb71517dd63298420868f27d98fe230a0a" @@ -327,6 +485,14 @@ dependencies: tslib "^2.3.0" +"@antfu/install-pkg@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@antfu/install-pkg/-/install-pkg-1.1.0.tgz#78fa036be1a6081b5a77a5cf59f50c7752b6ba26" + integrity sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ== + dependencies: + package-manager-detector "^1.3.0" + tinyexec "^1.0.1" + "@apidevtools/json-schema-ref-parser@^9.0.3": version "9.1.2" resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.1.2.tgz#8ff5386b365d4c9faa7c8b566ff16a46a577d9b8" @@ -654,11 +820,21 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== +"@babel/helper-string-parser@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687" + integrity sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA== + "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== +"@babel/helper-validator-identifier@^7.28.5": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz#010b6938fab7cb7df74aa2bbc06aa503b8fe5fb4" + integrity sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q== + "@babel/helper-validator-option@^7.14.5", "@babel/helper-validator-option@^7.22.15", "@babel/helper-validator-option@^7.23.5": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" @@ -710,6 +886,13 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.9.tgz#7b903b6149b0f8fa7ad564af646c4c38a77fc44b" integrity sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA== +"@babel/parser@^7.28.5": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.5.tgz#0b0225ee90362f030efd644e8034c99468893b08" + integrity sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ== + dependencies: + "@babel/types" "^7.28.5" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.2", "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.23.3.tgz#5cd1c87ba9380d0afb78469292c954fee5d2411a" @@ -1815,6 +1998,21 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" +"@babel/types@^7.28.5": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.5.tgz#10fc405f60897c35f07e85493c932c7b5ca0592b" + integrity sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA== + dependencies: + "@babel/helper-string-parser" "^7.27.1" + "@babel/helper-validator-identifier" "^7.28.5" + +"@capsizecss/unpack@^3.0.0": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@capsizecss/unpack/-/unpack-3.0.1.tgz#d40cd7fded06110a3d6198dd1e7a9bbcded52880" + integrity sha512-8XqW8xGn++Eqqbz3e9wKuK7mxryeRjs4LOHLxbh2lwKeSbuNR4NFifDZT4KzvjU6HMOPbiNTsWpniK5EJfTWkg== + dependencies: + fontkit "^2.0.2" + "@colors/colors@1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" @@ -1858,6 +2056,51 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz#d5e0706cf8c6acd8c6032f8d54070af261bbbb2f" integrity sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA== +"@docsearch/css@3.8.2": + version "3.8.2" + resolved "https://registry.yarnpkg.com/@docsearch/css/-/css-3.8.2.tgz#7973ceb6892c30f154ba254cd05c562257a44977" + integrity sha512-y05ayQFyUmCXze79+56v/4HpycYF3uFqB78pLPrSV5ZKAlDuIAAJNhaRi8tTdRNXh05yxX/TyNnzD6LwSM89vQ== + +"@docsearch/js@3.8.2": + version "3.8.2" + resolved "https://registry.yarnpkg.com/@docsearch/js/-/js-3.8.2.tgz#bdcfc9837700eb38453b88e211ab5cc5a3813cc6" + integrity sha512-Q5wY66qHn0SwA7Taa0aDbHiJvaFJLOJyHmooQ7y8hlwwQLQ/5WwCcoX0g7ii04Qi2DJlHsd0XXzJ8Ypw9+9YmQ== + dependencies: + "@docsearch/react" "3.8.2" + preact "^10.0.0" + +"@docsearch/react@3.8.2": + version "3.8.2" + resolved "https://registry.yarnpkg.com/@docsearch/react/-/react-3.8.2.tgz#7b11d39b61c976c0aa9fbde66e6b73b30f3acd42" + integrity sha512-xCRrJQlTt8N9GU0DG4ptwHRkfnSnD/YpdeaXe02iKfqs97TkZJv60yE+1eq/tjPcVnTW8dP5qLP7itifFVV5eg== + dependencies: + "@algolia/autocomplete-core" "1.17.7" + "@algolia/autocomplete-preset-algolia" "1.17.7" + "@docsearch/css" "3.8.2" + algoliasearch "^5.14.2" + +"@emnapi/core@^1.7.1": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@emnapi/core/-/core-1.7.1.tgz#3a79a02dbc84f45884a1806ebb98e5746bdfaac4" + integrity sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg== + dependencies: + "@emnapi/wasi-threads" "1.1.0" + tslib "^2.4.0" + +"@emnapi/runtime@^1.7.1": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.7.1.tgz#a73784e23f5d57287369c808197288b52276b791" + integrity sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA== + dependencies: + tslib "^2.4.0" + +"@emnapi/wasi-threads@1.1.0", "@emnapi/wasi-threads@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz#60b2102fddc9ccb78607e4a3cf8403ea69be41bf" + integrity sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ== + dependencies: + tslib "^2.4.0" + "@es-joy/jsdoccomment@~0.41.0": version "0.41.0" resolved "https://registry.yarnpkg.com/@es-joy/jsdoccomment/-/jsdoccomment-0.41.0.tgz#4a2f7db42209c0425c71a1476ef1bdb6dcd836f6" @@ -1872,116 +2115,491 @@ resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.19.11.tgz#2acd20be6d4f0458bc8c784103495ff24f13b1d3" integrity sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g== +"@esbuild/aix-ppc64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz#c7184a326533fcdf1b8ee0733e21c713b975575f" + integrity sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ== + +"@esbuild/aix-ppc64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz#80fcbe36130e58b7670511e888b8e88a259ed76c" + integrity sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA== + +"@esbuild/aix-ppc64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz#521cbd968dcf362094034947f76fa1b18d2d403c" + integrity sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw== + "@esbuild/android-arm64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.11.tgz#b45d000017385c9051a4f03e17078abb935be220" integrity sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q== +"@esbuild/android-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz#09d9b4357780da9ea3a7dfb833a1f1ff439b4052" + integrity sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A== + +"@esbuild/android-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz#8aa4965f8d0a7982dc21734bf6601323a66da752" + integrity sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg== + +"@esbuild/android-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz#61ea550962d8aa12a9b33194394e007657a6df57" + integrity sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA== + "@esbuild/android-arm@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.11.tgz#f46f55414e1c3614ac682b29977792131238164c" integrity sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw== +"@esbuild/android-arm@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.21.5.tgz#9b04384fb771926dfa6d7ad04324ecb2ab9b2e28" + integrity sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg== + +"@esbuild/android-arm@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.25.12.tgz#300712101f7f50f1d2627a162e6e09b109b6767a" + integrity sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg== + +"@esbuild/android-arm@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.27.2.tgz#554887821e009dd6d853f972fde6c5143f1de142" + integrity sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA== + "@esbuild/android-x64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.11.tgz#bfc01e91740b82011ef503c48f548950824922b2" integrity sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg== +"@esbuild/android-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.21.5.tgz#29918ec2db754cedcb6c1b04de8cd6547af6461e" + integrity sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA== + +"@esbuild/android-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.25.12.tgz#87dfb27161202bdc958ef48bb61b09c758faee16" + integrity sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg== + +"@esbuild/android-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.27.2.tgz#a7ce9d0721825fc578f9292a76d9e53334480ba2" + integrity sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A== + "@esbuild/darwin-arm64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.11.tgz#533fb7f5a08c37121d82c66198263dcc1bed29bf" integrity sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ== +"@esbuild/darwin-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz#e495b539660e51690f3928af50a76fb0a6ccff2a" + integrity sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ== + +"@esbuild/darwin-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz#79197898ec1ff745d21c071e1c7cc3c802f0c1fd" + integrity sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg== + +"@esbuild/darwin-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.27.2.tgz#2cb7659bd5d109803c593cfc414450d5430c8256" + integrity sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg== + "@esbuild/darwin-x64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.11.tgz#62f3819eff7e4ddc656b7c6815a31cf9a1e7d98e" integrity sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g== +"@esbuild/darwin-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz#c13838fa57372839abdddc91d71542ceea2e1e22" + integrity sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw== + +"@esbuild/darwin-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz#146400a8562133f45c4d2eadcf37ddd09718079e" + integrity sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA== + +"@esbuild/darwin-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz#e741fa6b1abb0cd0364126ba34ca17fd5e7bf509" + integrity sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA== + "@esbuild/freebsd-arm64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.11.tgz#d478b4195aa3ca44160272dab85ef8baf4175b4a" integrity sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA== +"@esbuild/freebsd-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz#646b989aa20bf89fd071dd5dbfad69a3542e550e" + integrity sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g== + +"@esbuild/freebsd-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz#1c5f9ba7206e158fd2b24c59fa2d2c8bb47ca0fe" + integrity sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg== + +"@esbuild/freebsd-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz#2b64e7116865ca172d4ce034114c21f3c93e397c" + integrity sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g== + "@esbuild/freebsd-x64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.11.tgz#7bdcc1917409178257ca6a1a27fe06e797ec18a2" integrity sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw== +"@esbuild/freebsd-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz#aa615cfc80af954d3458906e38ca22c18cf5c261" + integrity sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ== + +"@esbuild/freebsd-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz#ea631f4a36beaac4b9279fa0fcc6ca29eaeeb2b3" + integrity sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ== + +"@esbuild/freebsd-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz#e5252551e66f499e4934efb611812f3820e990bb" + integrity sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA== + "@esbuild/linux-arm64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.11.tgz#58ad4ff11685fcc735d7ff4ca759ab18fcfe4545" integrity sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg== +"@esbuild/linux-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz#70ac6fa14f5cb7e1f7f887bcffb680ad09922b5b" + integrity sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q== + +"@esbuild/linux-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz#e1066bce58394f1b1141deec8557a5f0a22f5977" + integrity sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ== + +"@esbuild/linux-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz#dc4acf235531cd6984f5d6c3b13dbfb7ddb303cb" + integrity sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw== + "@esbuild/linux-arm@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.11.tgz#ce82246d873b5534d34de1e5c1b33026f35e60e3" integrity sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q== +"@esbuild/linux-arm@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz#fc6fd11a8aca56c1f6f3894f2bea0479f8f626b9" + integrity sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA== + +"@esbuild/linux-arm@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz#452cd66b20932d08bdc53a8b61c0e30baf4348b9" + integrity sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw== + +"@esbuild/linux-arm@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz#56a900e39240d7d5d1d273bc053daa295c92e322" + integrity sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw== + "@esbuild/linux-ia32@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.11.tgz#cbae1f313209affc74b80f4390c4c35c6ab83fa4" integrity sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA== +"@esbuild/linux-ia32@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz#3271f53b3f93e3d093d518d1649d6d68d346ede2" + integrity sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg== + +"@esbuild/linux-ia32@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz#b24f8acc45bcf54192c7f2f3be1b53e6551eafe0" + integrity sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA== + +"@esbuild/linux-ia32@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz#d4a36d473360f6870efcd19d52bbfff59a2ed1cc" + integrity sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w== + "@esbuild/linux-loong64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.11.tgz#5f32aead1c3ec8f4cccdb7ed08b166224d4e9121" integrity sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg== +"@esbuild/linux-loong64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz#ed62e04238c57026aea831c5a130b73c0f9f26df" + integrity sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg== + +"@esbuild/linux-loong64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz#f9cfffa7fc8322571fbc4c8b3268caf15bd81ad0" + integrity sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng== + +"@esbuild/linux-loong64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz#fcf0ab8c3eaaf45891d0195d4961cb18b579716a" + integrity sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg== + "@esbuild/linux-mips64el@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.11.tgz#38eecf1cbb8c36a616261de858b3c10d03419af9" integrity sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg== +"@esbuild/linux-mips64el@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz#e79b8eb48bf3b106fadec1ac8240fb97b4e64cbe" + integrity sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg== + +"@esbuild/linux-mips64el@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz#575a14bd74644ffab891adc7d7e60d275296f2cd" + integrity sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw== + +"@esbuild/linux-mips64el@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz#598b67d34048bb7ee1901cb12e2a0a434c381c10" + integrity sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw== + "@esbuild/linux-ppc64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.11.tgz#9c5725a94e6ec15b93195e5a6afb821628afd912" integrity sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA== +"@esbuild/linux-ppc64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz#5f2203860a143b9919d383ef7573521fb154c3e4" + integrity sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w== + +"@esbuild/linux-ppc64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz#75b99c70a95fbd5f7739d7692befe60601591869" + integrity sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA== + +"@esbuild/linux-ppc64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz#3846c5df6b2016dab9bc95dde26c40f11e43b4c0" + integrity sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ== + "@esbuild/linux-riscv64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.11.tgz#2dc4486d474a2a62bbe5870522a9a600e2acb916" integrity sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ== +"@esbuild/linux-riscv64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz#07bcafd99322d5af62f618cb9e6a9b7f4bb825dc" + integrity sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA== + +"@esbuild/linux-riscv64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz#2e3259440321a44e79ddf7535c325057da875cd6" + integrity sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w== + +"@esbuild/linux-riscv64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz#173d4475b37c8d2c3e1707e068c174bb3f53d07d" + integrity sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA== + "@esbuild/linux-s390x@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.11.tgz#4ad8567df48f7dd4c71ec5b1753b6f37561a65a8" integrity sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q== +"@esbuild/linux-s390x@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz#b7ccf686751d6a3e44b8627ababc8be3ef62d8de" + integrity sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A== + +"@esbuild/linux-s390x@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz#17676cabbfe5928da5b2a0d6df5d58cd08db2663" + integrity sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg== + +"@esbuild/linux-s390x@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz#f7a4790105edcab8a5a31df26fbfac1aa3dacfab" + integrity sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w== + "@esbuild/linux-x64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.11.tgz#b7390c4d5184f203ebe7ddaedf073df82a658766" integrity sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA== +"@esbuild/linux-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz#6d8f0c768e070e64309af8004bb94e68ab2bb3b0" + integrity sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ== + +"@esbuild/linux-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz#0583775685ca82066d04c3507f09524d3cd7a306" + integrity sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw== + +"@esbuild/linux-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz#2ecc1284b1904aeb41e54c9ddc7fcd349b18f650" + integrity sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA== + +"@esbuild/netbsd-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz#f04c4049cb2e252fe96b16fed90f70746b13f4a4" + integrity sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg== + +"@esbuild/netbsd-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz#e2863c2cd1501845995cb11adf26f7fe4be527b0" + integrity sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw== + "@esbuild/netbsd-x64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.11.tgz#d633c09492a1721377f3bccedb2d821b911e813d" integrity sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ== +"@esbuild/netbsd-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz#bbe430f60d378ecb88decb219c602667387a6047" + integrity sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg== + +"@esbuild/netbsd-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz#77da0d0a0d826d7c921eea3d40292548b258a076" + integrity sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ== + +"@esbuild/netbsd-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz#93f7609e2885d1c0b5a1417885fba8d1fcc41272" + integrity sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA== + +"@esbuild/openbsd-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz#6296f5867aedef28a81b22ab2009c786a952dccd" + integrity sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A== + +"@esbuild/openbsd-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz#a1985604a203cdc325fd47542e106fafd698f02e" + integrity sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA== + "@esbuild/openbsd-x64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.11.tgz#17388c76e2f01125bf831a68c03a7ffccb65d1a2" integrity sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw== +"@esbuild/openbsd-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz#99d1cf2937279560d2104821f5ccce220cb2af70" + integrity sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow== + +"@esbuild/openbsd-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz#f8d23303360e27b16cf065b23bbff43c14142679" + integrity sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw== + +"@esbuild/openbsd-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz#8209e46c42f1ffbe6e4ef77a32e1f47d404ad42a" + integrity sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg== + +"@esbuild/openharmony-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz#49e0b768744a3924be0d7fd97dd6ce9b2923d88d" + integrity sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg== + +"@esbuild/openharmony-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz#8fade4441893d9cc44cbd7dcf3776f508ab6fb2f" + integrity sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag== + "@esbuild/sunos-x64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.11.tgz#e320636f00bb9f4fdf3a80e548cb743370d41767" integrity sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ== +"@esbuild/sunos-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz#08741512c10d529566baba837b4fe052c8f3487b" + integrity sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg== + +"@esbuild/sunos-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz#a6ed7d6778d67e528c81fb165b23f4911b9b13d6" + integrity sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w== + +"@esbuild/sunos-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz#980d4b9703a16f0f07016632424fc6d9a789dfc2" + integrity sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg== + "@esbuild/win32-arm64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.11.tgz#c778b45a496e90b6fc373e2a2bb072f1441fe0ee" integrity sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ== +"@esbuild/win32-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz#675b7385398411240735016144ab2e99a60fc75d" + integrity sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A== + +"@esbuild/win32-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz#9ac14c378e1b653af17d08e7d3ce34caef587323" + integrity sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg== + +"@esbuild/win32-arm64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz#1c09a3633c949ead3d808ba37276883e71f6111a" + integrity sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg== + "@esbuild/win32-ia32@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.11.tgz#481a65fee2e5cce74ec44823e6b09ecedcc5194c" integrity sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg== +"@esbuild/win32-ia32@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz#1bfc3ce98aa6ca9a0969e4d2af72144c59c1193b" + integrity sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA== + +"@esbuild/win32-ia32@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz#918942dcbbb35cc14fca39afb91b5e6a3d127267" + integrity sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ== + +"@esbuild/win32-ia32@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz#1b1e3a63ad4bef82200fef4e369e0fff7009eee5" + integrity sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ== + "@esbuild/win32-x64@0.19.11": version "0.19.11" resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.11.tgz#a5d300008960bb39677c46bf16f53ec70d8dee04" integrity sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw== +"@esbuild/win32-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz#acad351d582d157bb145535db2a6ff53dd514b5c" + integrity sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw== + +"@esbuild/win32-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz#9bdad8176be7811ad148d1f8772359041f46c6c5" + integrity sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA== + +"@esbuild/win32-x64@0.27.2": + version "0.27.2" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz#9e585ab6086bef994c6e8a5b3a0481219ada862b" + integrity sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ== + "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" @@ -2014,11 +2632,51 @@ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.56.0.tgz#ef20350fec605a7f7035a01764731b2de0f3782b" integrity sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A== +"@floating-ui/core@^1.7.3": + version "1.7.3" + resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.7.3.tgz#462d722f001e23e46d86fd2bd0d21b7693ccb8b7" + integrity sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w== + dependencies: + "@floating-ui/utils" "^0.2.10" + +"@floating-ui/dom@^1.0.0", "@floating-ui/dom@^1.6.13", "@floating-ui/dom@^1.7.4": + version "1.7.4" + resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.7.4.tgz#ee667549998745c9c3e3e84683b909c31d6c9a77" + integrity sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA== + dependencies: + "@floating-ui/core" "^1.7.3" + "@floating-ui/utils" "^0.2.10" + +"@floating-ui/utils@^0.2.10": + version "0.2.10" + resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.10.tgz#a2a1e3812d14525f725d011a73eceb41fef5bc1c" + integrity sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ== + +"@floating-ui/vue@^1.1.6": + version "1.1.9" + resolved "https://registry.yarnpkg.com/@floating-ui/vue/-/vue-1.1.9.tgz#508c386bd3d595247f1dda8dbca00b76fe8fcaf9" + integrity sha512-BfNqNW6KA83Nexspgb9DZuz578R7HT8MZw1CfK9I6Ah4QReNWEJsXWHN+SdmOVLNGmTPDi+fDT535Df5PzMLbQ== + dependencies: + "@floating-ui/dom" "^1.7.4" + "@floating-ui/utils" "^0.2.10" + vue-demi ">=0.13.0" + "@gar/promisify@^1.0.1", "@gar/promisify@^1.1.3": version "1.1.3" resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== +"@gerrit0/mini-shiki@^3.17.0": + version "3.20.0" + resolved "https://registry.yarnpkg.com/@gerrit0/mini-shiki/-/mini-shiki-3.20.0.tgz#a9154b8faeb7c2268e6c54af4cec86a9fb722297" + integrity sha512-Wa57i+bMpK6PGJZ1f2myxo3iO+K/kZikcyvH8NIqNNZhQUbDav7V9LQmWOXhf946mz5c1NZ19WMsGYiDKTryzQ== + dependencies: + "@shikijs/engine-oniguruma" "^3.20.0" + "@shikijs/langs" "^3.20.0" + "@shikijs/themes" "^3.20.0" + "@shikijs/types" "^3.20.0" + "@shikijs/vscode-textmate" "^10.0.2" + "@google-cloud/paginator@^3.0.6": version "3.0.7" resolved "https://registry.yarnpkg.com/@google-cloud/paginator/-/paginator-3.0.7.tgz#fb6f8e24ec841f99defaebf62c75c2e744dd419b" @@ -2111,6 +2769,55 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz#e5211452df060fa8522b55c7b3c0c4d1981cb044" integrity sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw== +"@iconify-json/simple-icons@^1.2.21": + version "1.2.64" + resolved "https://registry.yarnpkg.com/@iconify-json/simple-icons/-/simple-icons-1.2.64.tgz#f618c8b48fb4540162a9bf97fd46da1d0aaf9958" + integrity sha512-SMmm//tjZBvHnT0EAzZLnBTL6bukSkncM0pwkOXjr0FsAeCqjQtqoxBR0Mp+PazIJjXJKHm1Ju0YgnCIPOodJg== + dependencies: + "@iconify/types" "*" + +"@iconify/collections@^1.0.628": + version "1.0.633" + resolved "https://registry.yarnpkg.com/@iconify/collections/-/collections-1.0.633.tgz#5684539d71f185ec8b1d908e6197253bef7b5cc5" + integrity sha512-4ZSkmNE27ACM0td+oAXid5hNql6niaPA3TlKgyNB+BnlGhT5fYWPk8AKSF5KYaInDswSGUyF1aulhhw+LfJF7A== + dependencies: + "@iconify/types" "*" + +"@iconify/types@*", "@iconify/types@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@iconify/types/-/types-2.0.0.tgz#ab0e9ea681d6c8a1214f30cd741fe3a20cc57f57" + integrity sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg== + +"@iconify/utils@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@iconify/utils/-/utils-3.1.0.tgz#fb41882915f97fee6f91a2fbb8263e8772ca0438" + integrity sha512-Zlzem1ZXhI1iHeeERabLNzBHdOa4VhQbqAcOQaMKuTuyZCpwKbC2R4Dd0Zo3g9EAc+Y4fiarO8HIHRAth7+skw== + dependencies: + "@antfu/install-pkg" "^1.1.0" + "@iconify/types" "^2.0.0" + mlly "^1.8.0" + +"@iconify/vue@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@iconify/vue/-/vue-5.0.0.tgz#c47e4b3a225a64bbf28dce924934f23e54b061a4" + integrity sha512-C+KuEWIF5nSBrobFJhT//JS87OZ++QDORB6f2q2Wm6fl2mueSTpFBeBsveK0KW9hWiZ4mNiPjsh6Zs4jjdROSg== + dependencies: + "@iconify/types" "^2.0.0" + +"@internationalized/date@^3.10.1", "@internationalized/date@^3.5.0": + version "3.10.1" + resolved "https://registry.yarnpkg.com/@internationalized/date/-/date-3.10.1.tgz#ca63817feadeffe97f710289b00af229cd8af15c" + integrity sha512-oJrXtQiAXLvT9clCf1K4kxp3eKsQhIaZqxEyowkBcsvZDdZkbWrVmnGknxs5flTD0VGsxrxKgBCZty1EzoiMzA== + dependencies: + "@swc/helpers" "^0.5.0" + +"@internationalized/number@^3.5.0", "@internationalized/number@^3.6.5": + version "3.6.5" + resolved "https://registry.yarnpkg.com/@internationalized/number/-/number-3.6.5.tgz#1103f2832ca8d9dd3e4eecf95733d497791dbbbe" + integrity sha512-6hY4Kl4HPBvtfS62asS/R22JzNNy8vi/Ssev7x6EobfCp+9QIB2hKvI2EtbdJ0VSQacxVNtqhE/NmF/NZ0gm6g== + dependencies: + "@swc/helpers" "^0.5.0" + "@isaacs/cliui@^8.0.2": version "8.0.2" resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" @@ -2155,6 +2862,22 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.13" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz#6342a19f44347518c93e43b1ac69deb3c4656a1f" + integrity sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA== + dependencies: + "@jridgewell/sourcemap-codec" "^1.5.0" + "@jridgewell/trace-mapping" "^0.3.24" + +"@jridgewell/remapping@^2.3.4", "@jridgewell/remapping@^2.3.5": + version "2.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/remapping/-/remapping-2.3.5.tgz#375c476d1972947851ba1e15ae8f123047445aa1" + integrity sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ== + dependencies: + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.24" + "@jridgewell/resolve-uri@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-1.0.0.tgz#3fdf5798f0b49e90155896f6291df186eac06c83" @@ -2183,6 +2906,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/sourcemap-codec@^1.5.0", "@jridgewell/sourcemap-codec@^1.5.5": + version "1.5.5" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba" + integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og== + "@jridgewell/trace-mapping@0.3.9": version "0.3.9" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" @@ -2199,6 +2927,14 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@^0.3.24": + version "0.3.31" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz#db15d6781c931f3a251a3dac39501c98a6082fd0" + integrity sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@jsdevtools/ono@^7.1.3": version "7.1.3" resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" @@ -2221,6 +2957,15 @@ call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" +"@napi-rs/wasm-runtime@^1.1.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.1.tgz#c3705ab549d176b8dc5172723d6156c3dc426af2" + integrity sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A== + dependencies: + "@emnapi/core" "^1.7.1" + "@emnapi/runtime" "^1.7.1" + "@tybys/wasm-util" "^0.10.1" + "@ngtools/webpack@13.1.4": version "13.1.4" resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-13.1.4.tgz#359c9078af281413cf9cabd0af06b3fca4ddbf7e" @@ -2470,6 +3215,199 @@ dependencies: "@nx/workspace" "17.3.2" +"@nuxt/devtools-kit@^3.0.1", "@nuxt/devtools-kit@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@nuxt/devtools-kit/-/devtools-kit-3.1.1.tgz#963ffdc64aff163506d17c68192fb2ec631d9289" + integrity sha512-sjiKFeDCOy1SyqezSgyV4rYNfQewC64k/GhOsuJgRF+wR2qr6KTVhO6u2B+csKs74KrMrnJprQBgud7ejvOXAQ== + dependencies: + "@nuxt/kit" "^4.2.1" + execa "^8.0.1" + +"@nuxt/fonts@^0.12.1": + version "0.12.1" + resolved "https://registry.yarnpkg.com/@nuxt/fonts/-/fonts-0.12.1.tgz#0d05a73abbde5447e53bcdcfbe041308c34bb1b3" + integrity sha512-ALajI/HE+uqqL/PWkWwaSUm1IdpyGPbP3mYGy2U1l26/o4lUZBxjFaduMxaZ85jS5yQeJfCu2eEHANYFjAoujQ== + dependencies: + "@nuxt/devtools-kit" "^3.0.1" + "@nuxt/kit" "^4.2.1" + consola "^3.4.2" + css-tree "^3.1.0" + defu "^6.1.4" + esbuild "^0.25.12" + fontaine "^0.7.0" + fontless "^0.1.0" + h3 "^1.15.4" + jiti "^2.6.1" + magic-regexp "^0.10.0" + magic-string "^0.30.21" + node-fetch-native "^1.6.7" + ohash "^2.0.11" + pathe "^2.0.3" + sirv "^3.0.2" + tinyglobby "^0.2.15" + ufo "^1.6.1" + unifont "^0.6.0" + unplugin "^2.3.10" + unstorage "^1.17.2" + +"@nuxt/icon@^2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@nuxt/icon/-/icon-2.1.1.tgz#e194459a41e4e7417cca452f636ae38c7e8a5537" + integrity sha512-KX991xA64ttUQYXnLFafOw8EYxmmGRtnd2z1P9PjMOeSxxLXxUL1v9fKH2njqtPkamiOI0fvthxfJpJ4uH71sw== + dependencies: + "@iconify/collections" "^1.0.628" + "@iconify/types" "^2.0.0" + "@iconify/utils" "^3.1.0" + "@iconify/vue" "^5.0.0" + "@nuxt/devtools-kit" "^3.1.1" + "@nuxt/kit" "^4.2.2" + consola "^3.4.2" + local-pkg "^1.1.2" + mlly "^1.8.0" + ohash "^2.0.11" + pathe "^2.0.3" + picomatch "^4.0.3" + std-env "^3.10.0" + tinyglobby "^0.2.15" + +"@nuxt/kit@^3.13.2": + version "3.20.2" + resolved "https://registry.yarnpkg.com/@nuxt/kit/-/kit-3.20.2.tgz#6af1b227f15ee9518337b1306829872d17a6e341" + integrity sha512-laqfmMcWWNV1FsVmm1+RQUoGY8NIJvCRl0z0K8ikqPukoEry0LXMqlQ+xaf8xJRvoH2/78OhZmsEEsUBTXipcw== + dependencies: + c12 "^3.3.2" + consola "^3.4.2" + defu "^6.1.4" + destr "^2.0.5" + errx "^0.1.0" + exsolve "^1.0.8" + ignore "^7.0.5" + jiti "^2.6.1" + klona "^2.0.6" + knitwork "^1.3.0" + mlly "^1.8.0" + ohash "^2.0.11" + pathe "^2.0.3" + pkg-types "^2.3.0" + rc9 "^2.1.2" + scule "^1.3.0" + semver "^7.7.3" + tinyglobby "^0.2.15" + ufo "^1.6.1" + unctx "^2.4.1" + untyped "^2.0.0" + +"@nuxt/kit@^4.2.1", "@nuxt/kit@^4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@nuxt/kit/-/kit-4.2.2.tgz#f3f900a59e8c8f71313e31366c9319806ac9c9e7" + integrity sha512-ZAgYBrPz/yhVgDznBNdQj2vhmOp31haJbO0I0iah/P9atw+OHH7NJLUZ3PK+LOz/0fblKTN1XJVSi8YQ1TQ0KA== + dependencies: + c12 "^3.3.2" + consola "^3.4.2" + defu "^6.1.4" + destr "^2.0.5" + errx "^0.1.0" + exsolve "^1.0.8" + ignore "^7.0.5" + jiti "^2.6.1" + klona "^2.0.6" + mlly "^1.8.0" + ohash "^2.0.11" + pathe "^2.0.3" + pkg-types "^2.3.0" + rc9 "^2.1.2" + scule "^1.3.0" + semver "^7.7.3" + tinyglobby "^0.2.15" + ufo "^1.6.1" + unctx "^2.4.1" + untyped "^2.0.0" + +"@nuxt/schema@^4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@nuxt/schema/-/schema-4.2.2.tgz#d7567e6e8991a68aff9b16b4680f4d608e9ab2a0" + integrity sha512-lW/1MNpO01r5eR/VoeanQio8Lg4QpDklMOHa4mBHhhPNlBO1qiRtVYzjcnNdun3hujGauRaO9khGjv93Z5TZZA== + dependencies: + "@vue/shared" "^3.5.25" + defu "^6.1.4" + pathe "^2.0.3" + pkg-types "^2.3.0" + std-env "^3.10.0" + +"@nuxt/ui@^4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@nuxt/ui/-/ui-4.3.0.tgz#33d41784ec269dfd62aed2eb008d88fe274a3998" + integrity sha512-zhOIba3roiqNwV/hXXkKBlv9RA01/Gd2Okydpgps2zM4KGx6RM+ED5JGUOSd41bmTeBRO7v7Lg4w3Vyj9hQPiA== + dependencies: + "@iconify/vue" "^5.0.0" + "@internationalized/date" "^3.10.1" + "@internationalized/number" "^3.6.5" + "@nuxt/fonts" "^0.12.1" + "@nuxt/icon" "^2.1.1" + "@nuxt/kit" "^4.2.2" + "@nuxt/schema" "^4.2.2" + "@nuxtjs/color-mode" "^3.5.2" + "@standard-schema/spec" "^1.1.0" + "@tailwindcss/postcss" "^4.1.18" + "@tailwindcss/vite" "^4.1.18" + "@tanstack/vue-table" "^8.21.3" + "@tanstack/vue-virtual" "^3.13.13" + "@tiptap/core" "3.13.0" + "@tiptap/extension-bubble-menu" "3.13.0" + "@tiptap/extension-drag-handle-vue-3" "3.13.0" + "@tiptap/extension-floating-menu" "3.13.0" + "@tiptap/extension-horizontal-rule" "3.13.0" + "@tiptap/extension-image" "3.13.0" + "@tiptap/extension-mention" "3.13.0" + "@tiptap/extension-placeholder" "3.13.0" + "@tiptap/markdown" "3.13.0" + "@tiptap/pm" "3.13.0" + "@tiptap/starter-kit" "3.13.0" + "@tiptap/suggestion" "3.13.0" + "@tiptap/vue-3" "3.13.0" + "@unhead/vue" "^2.0.19" + "@vueuse/core" "^14.1.0" + "@vueuse/integrations" "^14.1.0" + colortranslator "^5.0.0" + consola "^3.4.2" + defu "^6.1.4" + embla-carousel-auto-height "^8.6.0" + embla-carousel-auto-scroll "^8.6.0" + embla-carousel-autoplay "^8.6.0" + embla-carousel-class-names "^8.6.0" + embla-carousel-fade "^8.6.0" + embla-carousel-vue "^8.6.0" + embla-carousel-wheel-gestures "^8.1.0" + fuse.js "^7.1.0" + hookable "^5.5.3" + knitwork "^1.3.0" + magic-string "^0.30.21" + mlly "^1.8.0" + motion-v "^1.7.3" + ohash "^2.0.11" + pathe "^2.0.3" + reka-ui "2.6.1" + scule "^1.3.0" + tailwind-merge "^3.4.0" + tailwind-variants "^3.2.2" + tailwindcss "^4.1.18" + tinyglobby "^0.2.15" + unplugin "^2.3.11" + unplugin-auto-import "^20.3.0" + unplugin-vue-components "^30.0.0" + vaul-vue "0.4.1" + vue-component-type-helpers "^3.1.5" + +"@nuxtjs/color-mode@^3.5.2": + version "3.5.2" + resolved "https://registry.yarnpkg.com/@nuxtjs/color-mode/-/color-mode-3.5.2.tgz#4f2cbdd44009068b746e3bb0964b761b90969b73" + integrity sha512-cC6RfgZh3guHBMLLjrBB2Uti5eUoGM9KyauOaYS9ETmxNWBMTvpgjvSiSJp1OFljIXPIqVTJ3xtJpSNZiO3ZaA== + dependencies: + "@nuxt/kit" "^3.13.2" + pathe "^1.1.2" + pkg-types "^1.2.1" + semver "^7.6.3" + "@nx/devkit@17.3.2": version "17.3.2" resolved "https://registry.yarnpkg.com/@nx/devkit/-/devkit-17.3.2.tgz#c10b3e5f9bc642881c24aa2e3878ca4290994a80" @@ -2609,6 +3547,71 @@ resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.18.1.tgz#8e47caf57a84b1dcc1722b2025693348cdf443b4" integrity sha512-+NLGHr6VZwcgE/2lw8zDIufOCGnzsA5CbQIMleXZTrgkBd0TanCX+MiDYJ1TOS4KL/Tqk0nFRxawnaYr6pkZkA== +"@parcel/watcher-android-arm64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.1.tgz#507f836d7e2042f798c7d07ad19c3546f9848ac1" + integrity sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA== + +"@parcel/watcher-darwin-arm64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.1.tgz#3d26dce38de6590ef79c47ec2c55793c06ad4f67" + integrity sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw== + +"@parcel/watcher-darwin-x64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.1.tgz#99f3af3869069ccf774e4ddfccf7e64fd2311ef8" + integrity sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg== + +"@parcel/watcher-freebsd-x64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.1.tgz#14d6857741a9f51dfe51d5b08b7c8afdbc73ad9b" + integrity sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ== + +"@parcel/watcher-linux-arm-glibc@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.1.tgz#43c3246d6892381db473bb4f663229ad20b609a1" + integrity sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA== + +"@parcel/watcher-linux-arm-musl@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.1.tgz#663750f7090bb6278d2210de643eb8a3f780d08e" + integrity sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q== + +"@parcel/watcher-linux-arm64-glibc@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.1.tgz#ba60e1f56977f7e47cd7e31ad65d15fdcbd07e30" + integrity sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w== + +"@parcel/watcher-linux-arm64-musl@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.1.tgz#f7fbcdff2f04c526f96eac01f97419a6a99855d2" + integrity sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg== + +"@parcel/watcher-linux-x64-glibc@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz#4d2ea0f633eb1917d83d483392ce6181b6a92e4e" + integrity sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A== + +"@parcel/watcher-linux-x64-musl@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz#277b346b05db54f55657301dd77bdf99d63606ee" + integrity sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg== + +"@parcel/watcher-win32-arm64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.1.tgz#7e9e02a26784d47503de1d10e8eab6cceb524243" + integrity sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw== + +"@parcel/watcher-win32-ia32@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.1.tgz#2d0f94fa59a873cdc584bf7f6b1dc628ddf976e6" + integrity sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ== + +"@parcel/watcher-win32-x64@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.1.tgz#ae52693259664ba6f2228fa61d7ee44b64ea0947" + integrity sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA== + "@parcel/watcher@2.0.4": version "2.0.4" resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.0.4.tgz#f300fef4cc38008ff4b8c29d92588eced3ce014b" @@ -2617,6 +3620,30 @@ node-addon-api "^3.2.1" node-gyp-build "^4.3.0" +"@parcel/watcher@^2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.5.1.tgz#342507a9cfaaf172479a882309def1e991fb1200" + integrity sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg== + dependencies: + detect-libc "^1.0.3" + is-glob "^4.0.3" + micromatch "^4.0.5" + node-addon-api "^7.0.0" + optionalDependencies: + "@parcel/watcher-android-arm64" "2.5.1" + "@parcel/watcher-darwin-arm64" "2.5.1" + "@parcel/watcher-darwin-x64" "2.5.1" + "@parcel/watcher-freebsd-x64" "2.5.1" + "@parcel/watcher-linux-arm-glibc" "2.5.1" + "@parcel/watcher-linux-arm-musl" "2.5.1" + "@parcel/watcher-linux-arm64-glibc" "2.5.1" + "@parcel/watcher-linux-arm64-musl" "2.5.1" + "@parcel/watcher-linux-x64-glibc" "2.5.1" + "@parcel/watcher-linux-x64-musl" "2.5.1" + "@parcel/watcher-win32-arm64" "2.5.1" + "@parcel/watcher-win32-ia32" "2.5.1" + "@parcel/watcher-win32-x64" "2.5.1" + "@phenomnomnominal/tsquery@~5.0.1": version "5.0.1" resolved "https://registry.yarnpkg.com/@phenomnomnominal/tsquery/-/tsquery-5.0.1.tgz#a2a5abc89f92c01562a32806655817516653a388" @@ -2629,6 +3656,11 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@polka/url@^1.0.0-next.24": + version "1.0.0-next.29" + resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.29.tgz#5a40109a1ab5f84d6fd8fc928b19f367cbe7e7b1" + integrity sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww== + "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" @@ -2682,66 +3714,181 @@ resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== +"@remirror/core-constants@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@remirror/core-constants/-/core-constants-3.0.0.tgz#96fdb89d25c62e7b6a5d08caf0ce5114370e3b8f" + integrity sha512-42aWfPrimMfDKDi4YegyS7x+/0tlzaqwPQCULLanv3DMIlu96KTJR0fM5isWX2UViOqlGnX6YFgqWepcX+XMNg== + +"@rollup/rollup-android-arm-eabi@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.54.0.tgz#f3ff5dbde305c4fa994d49aeb0a5db5305eff03b" + integrity sha512-OywsdRHrFvCdvsewAInDKCNyR3laPA2mc9bRYJ6LBp5IyvF3fvXbbNR0bSzHlZVFtn6E0xw2oZlyjg4rKCVcng== + "@rollup/rollup-android-arm-eabi@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.5.tgz#b752b6c88a14ccfcbdf3f48c577ccc3a7f0e66b9" integrity sha512-idWaG8xeSRCfRq9KpRysDHJ/rEHBEXcHuJ82XY0yYFIWnLMjZv9vF/7DOq8djQ2n3Lk6+3qfSH8AqlmHlmi1MA== +"@rollup/rollup-android-arm64@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.54.0.tgz#c97d6ee47846a7ab1cd38e968adce25444a90a19" + integrity sha512-Skx39Uv+u7H224Af+bDgNinitlmHyQX1K/atIA32JP3JQw6hVODX5tkbi2zof/E69M1qH2UoN3Xdxgs90mmNYw== + "@rollup/rollup-android-arm64@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.5.tgz#33757c3a448b9ef77b6f6292d8b0ec45c87e9c1a" integrity sha512-f14d7uhAMtsCGjAYwZGv6TwuS3IFaM4ZnGMUn3aCBgkcHAYErhV1Ad97WzBvS2o0aaDv4mVz+syiN0ElMyfBPg== +"@rollup/rollup-darwin-arm64@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.54.0.tgz#a13fc2d82e01eaf8ac823634a3f5f76fd9d0f938" + integrity sha512-k43D4qta/+6Fq+nCDhhv9yP2HdeKeP56QrUUTW7E6PhZP1US6NDqpJj4MY0jBHlJivVJD5P8NxrjuobZBJTCRw== + "@rollup/rollup-darwin-arm64@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.5.tgz#5234ba62665a3f443143bc8bcea9df2cc58f55fb" integrity sha512-ndoXeLx455FffL68OIUrVr89Xu1WLzAG4n65R8roDlCoYiQcGGg6MALvs2Ap9zs7AHg8mpHtMpwC8jBBjZrT/w== +"@rollup/rollup-darwin-x64@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.54.0.tgz#db4fa8b2b76d86f7e9b68ce4661fafe9767adf9b" + integrity sha512-cOo7biqwkpawslEfox5Vs8/qj83M/aZCSSNIWpVzfU2CYHa2G3P1UN5WF01RdTHSgCkri7XOlTdtk17BezlV3A== + "@rollup/rollup-darwin-x64@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.5.tgz#981256c054d3247b83313724938d606798a919d1" integrity sha512-UmElV1OY2m/1KEEqTlIjieKfVwRg0Zwg4PLgNf0s3glAHXBN99KLpw5A5lrSYCa1Kp63czTpVll2MAqbZYIHoA== +"@rollup/rollup-freebsd-arm64@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.54.0.tgz#b2c6039de4b75efd3f29417fcb1a795c75a4e3ee" + integrity sha512-miSvuFkmvFbgJ1BevMa4CPCFt5MPGw094knM64W9I0giUIMMmRYcGW/JWZDriaw/k1kOBtsWh1z6nIFV1vPNtA== + +"@rollup/rollup-freebsd-x64@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.54.0.tgz#9ae2a216c94f87912a596a3b3a2ec5199a689ba5" + integrity sha512-KGXIs55+b/ZfZsq9aR026tmr/+7tq6VG6MsnrvF4H8VhwflTIuYh+LFUlIsRdQSgrgmtM3fVATzEAj4hBQlaqQ== + +"@rollup/rollup-linux-arm-gnueabihf@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.54.0.tgz#69d5de7f781132f138514f2b900c523e38e2461f" + integrity sha512-EHMUcDwhtdRGlXZsGSIuXSYwD5kOT9NVnx9sqzYiwAc91wfYOE1g1djOEDseZJKKqtHAHGwnGPQu3kytmfaXLQ== + "@rollup/rollup-linux-arm-gnueabihf@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.5.tgz#120678a5a2b3a283a548dbb4d337f9187a793560" integrity sha512-Q0LcU61v92tQB6ae+udZvOyZ0wfpGojtAKrrpAaIqmJ7+psq4cMIhT/9lfV6UQIpeItnq/2QDROhNLo00lOD1g== +"@rollup/rollup-linux-arm-musleabihf@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.54.0.tgz#b6431e5699747f285306ffe8c1194d7af74f801f" + integrity sha512-+pBrqEjaakN2ySv5RVrj/qLytYhPKEUwk+e3SFU5jTLHIcAtqh2rLrd/OkbNuHJpsBgxsD8ccJt5ga/SeG0JmA== + +"@rollup/rollup-linux-arm64-gnu@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.54.0.tgz#a32931baec8a0fa7b3288afb72d400ae735112c2" + integrity sha512-NSqc7rE9wuUaRBsBp5ckQ5CVz5aIRKCwsoa6WMF7G01sX3/qHUw/z4pv+D+ahL1EIKy6Enpcnz1RY8pf7bjwng== + "@rollup/rollup-linux-arm64-gnu@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.5.tgz#c99d857e2372ece544b6f60b85058ad259f64114" integrity sha512-dkRscpM+RrR2Ee3eOQmRWFjmV/payHEOrjyq1VZegRUa5OrZJ2MAxBNs05bZuY0YCtpqETDy1Ix4i/hRqX98cA== +"@rollup/rollup-linux-arm64-musl@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.54.0.tgz#0ad72572b01eb946c0b1a7a6f17ab3be6689a963" + integrity sha512-gr5vDbg3Bakga5kbdpqx81m2n9IX8M6gIMlQQIXiLTNeQW6CucvuInJ91EuCJ/JYvc+rcLLsDFcfAD1K7fMofg== + "@rollup/rollup-linux-arm64-musl@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.5.tgz#3064060f568a5718c2a06858cd6e6d24f2ff8632" integrity sha512-QaKFVOzzST2xzY4MAmiDmURagWLFh+zZtttuEnuNn19AiZ0T3fhPyjPPGwLNdiDT82ZE91hnfJsUiDwF9DClIQ== +"@rollup/rollup-linux-loong64-gnu@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.54.0.tgz#05681f000310906512279944b5bef38c0cd4d326" + integrity sha512-gsrtB1NA3ZYj2vq0Rzkylo9ylCtW/PhpLEivlgWe0bpgtX5+9j9EZa0wtZiCjgu6zmSeZWyI/e2YRX1URozpIw== + +"@rollup/rollup-linux-ppc64-gnu@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.54.0.tgz#9847a8c9dd76d687c3bdbe38d7f5f32c6b2743c8" + integrity sha512-y3qNOfTBStmFNq+t4s7Tmc9hW2ENtPg8FeUD/VShI7rKxNW7O4fFeaYbMsd3tpFlIg1Q8IapFgy7Q9i2BqeBvA== + +"@rollup/rollup-linux-riscv64-gnu@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.54.0.tgz#173f20c278ac770ae3e969663a27d172a4545e87" + integrity sha512-89sepv7h2lIVPsFma8iwmccN7Yjjtgz0Rj/Ou6fEqg3HDhpCa+Et+YSufy27i6b0Wav69Qv4WBNl3Rs6pwhebQ== + "@rollup/rollup-linux-riscv64-gnu@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.5.tgz#987d30b5d2b992fff07d055015991a57ff55fbad" integrity sha512-HeGqmRJuyVg6/X6MpE2ur7GbymBPS8Np0S/vQFHDmocfORT+Zt76qu+69NUoxXzGqVP1pzaY6QIi0FJWLC3OPA== +"@rollup/rollup-linux-riscv64-musl@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.54.0.tgz#db70c2377ae1ef61ef8673354d107ecb3fa7ffed" + integrity sha512-ZcU77ieh0M2Q8Ur7D5X7KvK+UxbXeDHwiOt/CPSBTI1fBmeDMivW0dPkdqkT4rOgDjrDDBUed9x4EgraIKoR2A== + +"@rollup/rollup-linux-s390x-gnu@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.54.0.tgz#b2c461778add1c2ee70ec07d1788611548647962" + integrity sha512-2AdWy5RdDF5+4YfG/YesGDDtbyJlC9LHmL6rZw6FurBJ5n4vFGupsOBGfwMRjBYH7qRQowT8D/U4LoSvVwOhSQ== + +"@rollup/rollup-linux-x64-gnu@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.54.0.tgz#ab140b356569601f57ab8727bd7306463841894f" + integrity sha512-WGt5J8Ij/rvyqpFexxk3ffKqqbLf9AqrTBbWDk7ApGUzaIs6V+s2s84kAxklFwmMF/vBNGrVdYgbblCOFFezMQ== + "@rollup/rollup-linux-x64-gnu@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.5.tgz#85946ee4d068bd12197aeeec2c6f679c94978a49" integrity sha512-Dq1bqBdLaZ1Gb/l2e5/+o3B18+8TI9ANlA1SkejZqDgdU/jK/ThYaMPMJpVMMXy2uRHvGKbkz9vheVGdq3cJfA== +"@rollup/rollup-linux-x64-musl@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.54.0.tgz#810134b4a9d0d88576938f2eed38999a653814a1" + integrity sha512-JzQmb38ATzHjxlPHuTH6tE7ojnMKM2kYNzt44LO/jJi8BpceEC8QuXYA908n8r3CNuG/B3BV8VR3Hi1rYtmPiw== + "@rollup/rollup-linux-x64-musl@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.5.tgz#fe0b20f9749a60eb1df43d20effa96c756ddcbd4" integrity sha512-ezyFUOwldYpj7AbkwyW9AJ203peub81CaAIVvckdkyH8EvhEIoKzaMFJj0G4qYJ5sw3BpqhFrsCc30t54HV8vg== +"@rollup/rollup-openharmony-arm64@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.54.0.tgz#0182bae7a54e748be806acef7a7f726f6949213c" + integrity sha512-huT3fd0iC7jigGh7n3q/+lfPcXxBi+om/Rs3yiFxjvSxbSB6aohDFXbWvlspaqjeOh+hx7DDHS+5Es5qRkWkZg== + +"@rollup/rollup-win32-arm64-msvc@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.54.0.tgz#1f19349bd1c5e454d03e4508a9277b6354985b9d" + integrity sha512-c2V0W1bsKIKfbLMBu/WGBz6Yci8nJ/ZJdheE0EwB73N3MvHYKiKGs3mVilX4Gs70eGeDaMqEob25Tw2Gb9Nqyw== + "@rollup/rollup-win32-arm64-msvc@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.5.tgz#422661ef0e16699a234465d15b2c1089ef963b2a" integrity sha512-aHSsMnUw+0UETB0Hlv7B/ZHOGY5bQdwMKJSzGfDfvyhnpmVxLMGnQPGNE9wgqkLUs3+gbG1Qx02S2LLfJ5GaRQ== +"@rollup/rollup-win32-ia32-msvc@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.54.0.tgz#234ff739993539f64efac6c2e59704a691a309c2" + integrity sha512-woEHgqQqDCkAzrDhvDipnSirm5vxUXtSKDYTVpZG3nUdW/VVB5VdCYA2iReSj/u3yCZzXID4kuKG7OynPnB3WQ== + "@rollup/rollup-win32-ia32-msvc@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.5.tgz#7b73a145891c202fbcc08759248983667a035d85" integrity sha512-AiqiLkb9KSf7Lj/o1U3SEP9Zn+5NuVKgFdRIZkvd4N0+bYrTOovVd0+LmYCPQGbocT4kvFyK+LXCDiXPBF3fyA== +"@rollup/rollup-win32-x64-gnu@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.54.0.tgz#a4df0507c3be09c152a795cfc0c4f0c225765c5c" + integrity sha512-dzAc53LOuFvHwbCEOS0rPbXp6SIhAf2txMP5p6mGyOXXw5mWY8NGGbPMPrs4P1WItkfApDathBj/NzMLUZ9rtQ== + +"@rollup/rollup-win32-x64-msvc@4.54.0": + version "4.54.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.54.0.tgz#beacb356412eef5dc0164e9edfee51c563732054" + integrity sha512-hYT5d3YNdSh3mbCU1gwQyPgQd3T2ne0A3KG8KSBdav5TiBg6eInVmV+TeR5uHufiIgSFg0XsOWGW5/RhNcSvPg== + "@rollup/rollup-win32-x64-msvc@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.5.tgz#10491ccf4f63c814d4149e0316541476ea603602" @@ -2756,6 +3903,151 @@ "@angular-devkit/schematics" "13.3.11" jsonc-parser "3.0.0" +"@shikijs/core@1.29.2": + version "1.29.2" + resolved "https://registry.yarnpkg.com/@shikijs/core/-/core-1.29.2.tgz#9c051d3ac99dd06ae46bd96536380c916e552bf3" + integrity sha512-vju0lY9r27jJfOY4Z7+Rt/nIOjzJpZ3y+nYpqtUZInVoXQ/TJZcfGnNOGnKjFdVZb8qexiCuSlZRKcGfhhTTZQ== + dependencies: + "@shikijs/engine-javascript" "1.29.2" + "@shikijs/engine-oniguruma" "1.29.2" + "@shikijs/types" "1.29.2" + "@shikijs/vscode-textmate" "^10.0.1" + "@types/hast" "^3.0.4" + hast-util-to-html "^9.0.4" + +"@shikijs/core@2.5.0", "@shikijs/core@^2.1.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@shikijs/core/-/core-2.5.0.tgz#e14d33961dfa3141393d4a76fc8923d0d1c4b62f" + integrity sha512-uu/8RExTKtavlpH7XqnVYBrfBkUc20ngXiX9NSrBhOVZYv/7XQRKUyhtkeflY5QsxC0GbJThCerruZfsUaSldg== + dependencies: + "@shikijs/engine-javascript" "2.5.0" + "@shikijs/engine-oniguruma" "2.5.0" + "@shikijs/types" "2.5.0" + "@shikijs/vscode-textmate" "^10.0.2" + "@types/hast" "^3.0.4" + hast-util-to-html "^9.0.4" + +"@shikijs/engine-javascript@1.29.2": + version "1.29.2" + resolved "https://registry.yarnpkg.com/@shikijs/engine-javascript/-/engine-javascript-1.29.2.tgz#a821ad713a3e0b7798a1926fd9e80116e38a1d64" + integrity sha512-iNEZv4IrLYPv64Q6k7EPpOCE/nuvGiKl7zxdq0WFuRPF5PAE9PRo2JGq/d8crLusM59BRemJ4eOqrFrC4wiQ+A== + dependencies: + "@shikijs/types" "1.29.2" + "@shikijs/vscode-textmate" "^10.0.1" + oniguruma-to-es "^2.2.0" + +"@shikijs/engine-javascript@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@shikijs/engine-javascript/-/engine-javascript-2.5.0.tgz#e045c6ecfbda6c99137547b0a482e0b87f1053fc" + integrity sha512-VjnOpnQf8WuCEZtNUdjjwGUbtAVKuZkVQ/5cHy/tojVVRIRtlWMYVjyWhxOmIq05AlSOv72z7hRNRGVBgQOl0w== + dependencies: + "@shikijs/types" "2.5.0" + "@shikijs/vscode-textmate" "^10.0.2" + oniguruma-to-es "^3.1.0" + +"@shikijs/engine-oniguruma@1.29.2": + version "1.29.2" + resolved "https://registry.yarnpkg.com/@shikijs/engine-oniguruma/-/engine-oniguruma-1.29.2.tgz#d879717ced61d44e78feab16f701f6edd75434f1" + integrity sha512-7iiOx3SG8+g1MnlzZVDYiaeHe7Ez2Kf2HrJzdmGwkRisT7r4rak0e655AcM/tF9JG/kg5fMNYlLLKglbN7gBqA== + dependencies: + "@shikijs/types" "1.29.2" + "@shikijs/vscode-textmate" "^10.0.1" + +"@shikijs/engine-oniguruma@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@shikijs/engine-oniguruma/-/engine-oniguruma-2.5.0.tgz#230de5693cc1da6c9d59c7ad83593c2027274817" + integrity sha512-pGd1wRATzbo/uatrCIILlAdFVKdxImWJGQ5rFiB5VZi2ve5xj3Ax9jny8QvkaV93btQEwR/rSz5ERFpC5mKNIw== + dependencies: + "@shikijs/types" "2.5.0" + "@shikijs/vscode-textmate" "^10.0.2" + +"@shikijs/engine-oniguruma@^3.20.0": + version "3.20.0" + resolved "https://registry.yarnpkg.com/@shikijs/engine-oniguruma/-/engine-oniguruma-3.20.0.tgz#4b476a8dff29561dfd9af1ba2edb4c378d3bee06" + integrity sha512-Yx3gy7xLzM0ZOjqoxciHjA7dAt5tyzJE3L4uQoM83agahy+PlW244XJSrmJRSBvGYELDhYXPacD4R/cauV5bzQ== + dependencies: + "@shikijs/types" "3.20.0" + "@shikijs/vscode-textmate" "^10.0.2" + +"@shikijs/langs@1.29.2": + version "1.29.2" + resolved "https://registry.yarnpkg.com/@shikijs/langs/-/langs-1.29.2.tgz#4f1de46fde8991468c5a68fa4a67dd2875d643cd" + integrity sha512-FIBA7N3LZ+223U7cJDUYd5shmciFQlYkFXlkKVaHsCPgfVLiO+e12FmQE6Tf9vuyEsFe3dIl8qGWKXgEHL9wmQ== + dependencies: + "@shikijs/types" "1.29.2" + +"@shikijs/langs@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@shikijs/langs/-/langs-2.5.0.tgz#97ab50c495922cc1ca06e192985b28dc73de5d50" + integrity sha512-Qfrrt5OsNH5R+5tJ/3uYBBZv3SuGmnRPejV9IlIbFH3HTGLDlkqgHymAlzklVmKBjAaVmkPkyikAV/sQ1wSL+w== + dependencies: + "@shikijs/types" "2.5.0" + +"@shikijs/langs@^3.20.0": + version "3.20.0" + resolved "https://registry.yarnpkg.com/@shikijs/langs/-/langs-3.20.0.tgz#5dcfdeb9eb2d5f811144ca606553a4d8a6a667d5" + integrity sha512-le+bssCxcSHrygCWuOrYJHvjus6zhQ2K7q/0mgjiffRbkhM4o1EWu2m+29l0yEsHDbWaWPNnDUTRVVBvBBeKaA== + dependencies: + "@shikijs/types" "3.20.0" + +"@shikijs/themes@1.29.2": + version "1.29.2" + resolved "https://registry.yarnpkg.com/@shikijs/themes/-/themes-1.29.2.tgz#293cc5c83dd7df3fdc8efa25cec8223f3a6acb0d" + integrity sha512-i9TNZlsq4uoyqSbluIcZkmPL9Bfi3djVxRnofUHwvx/h6SRW3cwgBC5SML7vsDcWyukY0eCzVN980rqP6qNl9g== + dependencies: + "@shikijs/types" "1.29.2" + +"@shikijs/themes@2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@shikijs/themes/-/themes-2.5.0.tgz#8c6aecf73f5455681c8bec15797cf678162896cb" + integrity sha512-wGrk+R8tJnO0VMzmUExHR+QdSaPUl/NKs+a4cQQRWyoc3YFbUzuLEi/KWK1hj+8BfHRKm2jNhhJck1dfstJpiw== + dependencies: + "@shikijs/types" "2.5.0" + +"@shikijs/themes@^3.20.0": + version "3.20.0" + resolved "https://registry.yarnpkg.com/@shikijs/themes/-/themes-3.20.0.tgz#9b030fe81fcd0a8b7941131ef14c274b4c6451a8" + integrity sha512-U1NSU7Sl26Q7ErRvJUouArxfM2euWqq1xaSrbqMu2iqa+tSp0D1Yah8216sDYbdDHw4C8b75UpE65eWorm2erQ== + dependencies: + "@shikijs/types" "3.20.0" + +"@shikijs/transformers@^2.1.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@shikijs/transformers/-/transformers-2.5.0.tgz#190c84786ff06c417580ab79177338a947168c55" + integrity sha512-SI494W5X60CaUwgi8u4q4m4s3YAFSxln3tzNjOSYqq54wlVgz0/NbbXEb3mdLbqMBztcmS7bVTaEd2w0qMmfeg== + dependencies: + "@shikijs/core" "2.5.0" + "@shikijs/types" "2.5.0" + +"@shikijs/types@1.29.2": + version "1.29.2" + resolved "https://registry.yarnpkg.com/@shikijs/types/-/types-1.29.2.tgz#a93fdb410d1af8360c67bf5fc1d1a68d58e21c4f" + integrity sha512-VJjK0eIijTZf0QSTODEXCqinjBn0joAHQ+aPSBzrv4O2d/QSbsMw+ZeSRx03kV34Hy7NzUvV/7NqfYGRLrASmw== + dependencies: + "@shikijs/vscode-textmate" "^10.0.1" + "@types/hast" "^3.0.4" + +"@shikijs/types@2.5.0", "@shikijs/types@^2.1.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@shikijs/types/-/types-2.5.0.tgz#e949c7384802703a48b9d6425dd41673c164df69" + integrity sha512-ygl5yhxki9ZLNuNpPitBWvcy9fsSKKaRuO4BAlMyagszQidxcpLAr0qiW/q43DtSIDxO6hEbtYLiFZNXO/hdGw== + dependencies: + "@shikijs/vscode-textmate" "^10.0.2" + "@types/hast" "^3.0.4" + +"@shikijs/types@3.20.0", "@shikijs/types@^3.20.0": + version "3.20.0" + resolved "https://registry.yarnpkg.com/@shikijs/types/-/types-3.20.0.tgz#b1fbacba2e1e38d31e3f869309fff216a5d27126" + integrity sha512-lhYAATn10nkZcBQ0BlzSbJA3wcmL5MXUUF8d2Zzon6saZDlToKaiRX60n2+ZaHJCmXEcZRWNzn+k9vplr8Jhsw== + dependencies: + "@shikijs/vscode-textmate" "^10.0.2" + "@types/hast" "^3.0.4" + +"@shikijs/vscode-textmate@^10.0.1", "@shikijs/vscode-textmate@^10.0.2": + version "10.0.2" + resolved "https://registry.yarnpkg.com/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz#a90ab31d0cc1dfb54c66a69e515bf624fa7b2224" + integrity sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg== + "@sinclair/typebox@^0.27.8": version "0.27.8" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" @@ -2811,6 +4103,11 @@ resolved "https://registry.yarnpkg.com/@stackblitz/sdk/-/sdk-1.9.0.tgz#b5174f3f45a51b6c1b9e67f1ef4e2e783ab105e9" integrity sha512-3m6C7f8pnR5KXys/Hqx2x6ylnpqOak6HtnZI6T5keEO0yT+E4Spkw37VEbdwuC+2oxmjdgq6YZEgiKX7hM1GmQ== +"@standard-schema/spec@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@standard-schema/spec/-/spec-1.1.0.tgz#a79b55dbaf8604812f52d140b2c9ab41bc150bb8" + integrity sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w== + "@swc/core-darwin-arm64@1.3.99": version "1.3.99" resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.99.tgz#def204349ac645b8de21a800fa784907642a6c91" @@ -2886,6 +4183,13 @@ dependencies: tslib "^2.4.0" +"@swc/helpers@^0.5.0", "@swc/helpers@^0.5.12": + version "0.5.18" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.18.tgz#feeeabea0d10106ee25aaf900165df911ab6d3b1" + integrity sha512-TXTnIcNJQEKwThMMqBXsZ4VGAza6bvN4pa41Rkqoio6QBKMvo+5lexeTMScGCIxtzgQJzElcvIltani+adC5PQ== + dependencies: + tslib "^2.8.0" + "@swc/types@^0.1.5": version "0.1.5" resolved "https://registry.yarnpkg.com/@swc/types/-/types-0.1.5.tgz#043b731d4f56a79b4897a3de1af35e75d56bc63a" @@ -2943,6 +4247,430 @@ dependencies: defer-to-connect "^1.0.1" +"@tailwindcss/cli@^4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/cli/-/cli-4.1.18.tgz#c4a8d55da0bcac803b0d21fae168dde76d3f47a3" + integrity sha512-sMZ+lZbDyxwjD2E0L7oRUjJ01Ffjtme5OtjvvnC+cV4CEDcbqzbp25TCpxHj6kWLU9+DlqJOiNgSOgctC2aZmg== + dependencies: + "@parcel/watcher" "^2.5.1" + "@tailwindcss/node" "4.1.18" + "@tailwindcss/oxide" "4.1.18" + enhanced-resolve "^5.18.3" + mri "^1.2.0" + picocolors "^1.1.1" + tailwindcss "4.1.18" + +"@tailwindcss/node@4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/node/-/node-4.1.18.tgz#9863be0d26178638794a38d6c7c14666fb992e8a" + integrity sha512-DoR7U1P7iYhw16qJ49fgXUlry1t4CpXeErJHnQ44JgTSKMaZUdf17cfn5mHchfJ4KRBZRFA/Coo+MUF5+gOaCQ== + dependencies: + "@jridgewell/remapping" "^2.3.4" + enhanced-resolve "^5.18.3" + jiti "^2.6.1" + lightningcss "1.30.2" + magic-string "^0.30.21" + source-map-js "^1.2.1" + tailwindcss "4.1.18" + +"@tailwindcss/oxide-android-arm64@4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.1.18.tgz#79717f87e90135e5d3d23a3d3aecde4ca5595dd5" + integrity sha512-dJHz7+Ugr9U/diKJA0W6N/6/cjI+ZTAoxPf9Iz9BFRF2GzEX8IvXxFIi/dZBloVJX/MZGvRuFA9rqwdiIEZQ0Q== + +"@tailwindcss/oxide-darwin-arm64@4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.1.18.tgz#7fa47608d62d60e9eb020682249d20159667fbb0" + integrity sha512-Gc2q4Qhs660bhjyBSKgq6BYvwDz4G+BuyJ5H1xfhmDR3D8HnHCmT/BSkvSL0vQLy/nkMLY20PQ2OoYMO15Jd0A== + +"@tailwindcss/oxide-darwin-x64@4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.1.18.tgz#c05991c85aa2af47bf9d1f8172fe9e4636591e79" + integrity sha512-FL5oxr2xQsFrc3X9o1fjHKBYBMD1QZNyc1Xzw/h5Qu4XnEBi3dZn96HcHm41c/euGV+GRiXFfh2hUCyKi/e+yw== + +"@tailwindcss/oxide-freebsd-x64@4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.1.18.tgz#3d48e8d79fd08ece0e02af8e72d5059646be34d0" + integrity sha512-Fj+RHgu5bDodmV1dM9yAxlfJwkkWvLiRjbhuO2LEtwtlYlBgiAT4x/j5wQr1tC3SANAgD+0YcmWVrj8R9trVMA== + +"@tailwindcss/oxide-linux-arm-gnueabihf@4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.1.18.tgz#982ecd1a65180807ccfde67dc17c6897f2e50aa8" + integrity sha512-Fp+Wzk/Ws4dZn+LV2Nqx3IilnhH51YZoRaYHQsVq3RQvEl+71VGKFpkfHrLM/Li+kt5c0DJe/bHXK1eHgDmdiA== + +"@tailwindcss/oxide-linux-arm64-gnu@4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.1.18.tgz#df49357bc9737b2e9810ea950c1c0647ba6573c3" + integrity sha512-S0n3jboLysNbh55Vrt7pk9wgpyTTPD0fdQeh7wQfMqLPM/Hrxi+dVsLsPrycQjGKEQk85Kgbx+6+QnYNiHalnw== + +"@tailwindcss/oxide-linux-arm64-musl@4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.1.18.tgz#b266c12822bf87883cf152615f8fffb8519d689c" + integrity sha512-1px92582HkPQlaaCkdRcio71p8bc8i/ap5807tPRDK/uw953cauQBT8c5tVGkOwrHMfc2Yh6UuxaH4vtTjGvHg== + +"@tailwindcss/oxide-linux-x64-gnu@4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.1.18.tgz#5c737f13dd9529b25b314e6000ff54e05b3811da" + integrity sha512-v3gyT0ivkfBLoZGF9LyHmts0Isc8jHZyVcbzio6Wpzifg/+5ZJpDiRiUhDLkcr7f/r38SWNe7ucxmGW3j3Kb/g== + +"@tailwindcss/oxide-linux-x64-musl@4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.1.18.tgz#3380e17f7be391f1ef924be9f0afe1f304fe3478" + integrity sha512-bhJ2y2OQNlcRwwgOAGMY0xTFStt4/wyU6pvI6LSuZpRgKQwxTec0/3Scu91O8ir7qCR3AuepQKLU/kX99FouqQ== + +"@tailwindcss/oxide-wasm32-wasi@4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.1.18.tgz#9464df0e28a499aab1c55e97682be37b3a656c88" + integrity sha512-LffYTvPjODiP6PT16oNeUQJzNVyJl1cjIebq/rWWBF+3eDst5JGEFSc5cWxyRCJ0Mxl+KyIkqRxk1XPEs9x8TA== + dependencies: + "@emnapi/core" "^1.7.1" + "@emnapi/runtime" "^1.7.1" + "@emnapi/wasi-threads" "^1.1.0" + "@napi-rs/wasm-runtime" "^1.1.0" + "@tybys/wasm-util" "^0.10.1" + tslib "^2.4.0" + +"@tailwindcss/oxide-win32-arm64-msvc@4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.18.tgz#bbcdd59c628811f6a0a4d5b09616967d8fb0c4d4" + integrity sha512-HjSA7mr9HmC8fu6bdsZvZ+dhjyGCLdotjVOgLA2vEqxEBZaQo9YTX4kwgEvPCpRh8o4uWc4J/wEoFzhEmjvPbA== + +"@tailwindcss/oxide-win32-x64-msvc@4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.1.18.tgz#9c628d04623aa4c3536c508289f58d58ba4b3fb1" + integrity sha512-bJWbyYpUlqamC8dpR7pfjA0I7vdF6t5VpUGMWRkXVE3AXgIZjYUYAK7II1GNaxR8J1SSrSrppRar8G++JekE3Q== + +"@tailwindcss/oxide@4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide/-/oxide-4.1.18.tgz#c8335cd0a83e9880caecd60abf7904f43ebab582" + integrity sha512-EgCR5tTS5bUSKQgzeMClT6iCY3ToqE1y+ZB0AKldj809QXk1Y+3jB0upOYZrn9aGIzPtUsP7sX4QQ4XtjBB95A== + optionalDependencies: + "@tailwindcss/oxide-android-arm64" "4.1.18" + "@tailwindcss/oxide-darwin-arm64" "4.1.18" + "@tailwindcss/oxide-darwin-x64" "4.1.18" + "@tailwindcss/oxide-freebsd-x64" "4.1.18" + "@tailwindcss/oxide-linux-arm-gnueabihf" "4.1.18" + "@tailwindcss/oxide-linux-arm64-gnu" "4.1.18" + "@tailwindcss/oxide-linux-arm64-musl" "4.1.18" + "@tailwindcss/oxide-linux-x64-gnu" "4.1.18" + "@tailwindcss/oxide-linux-x64-musl" "4.1.18" + "@tailwindcss/oxide-wasm32-wasi" "4.1.18" + "@tailwindcss/oxide-win32-arm64-msvc" "4.1.18" + "@tailwindcss/oxide-win32-x64-msvc" "4.1.18" + +"@tailwindcss/postcss@^4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/postcss/-/postcss-4.1.18.tgz#19152640d676beaa2a4a70b00bbc36ef54e998b5" + integrity sha512-Ce0GFnzAOuPyfV5SxjXGn0CubwGcuDB0zcdaPuCSzAa/2vII24JTkH+I6jcbXLb1ctjZMZZI6OjDaLPJQL1S0g== + dependencies: + "@alloc/quick-lru" "^5.2.0" + "@tailwindcss/node" "4.1.18" + "@tailwindcss/oxide" "4.1.18" + postcss "^8.4.41" + tailwindcss "4.1.18" + +"@tailwindcss/vite@^4.1.18": + version "4.1.18" + resolved "https://registry.yarnpkg.com/@tailwindcss/vite/-/vite-4.1.18.tgz#614b9d5483559518c72d31bca05d686f8df28e9a" + integrity sha512-jVA+/UpKL1vRLg6Hkao5jldawNmRo7mQYrZtNHMIVpLfLhDml5nMRUo/8MwoX2vNXvnaXNNMedrMfMugAVX1nA== + dependencies: + "@tailwindcss/node" "4.1.18" + "@tailwindcss/oxide" "4.1.18" + tailwindcss "4.1.18" + +"@tanstack/table-core@8.21.3": + version "8.21.3" + resolved "https://registry.yarnpkg.com/@tanstack/table-core/-/table-core-8.21.3.tgz#2977727d8fc8dfa079112d9f4d4c019110f1732c" + integrity sha512-ldZXEhOBb8Is7xLs01fR3YEc3DERiz5silj8tnGkFZytt1abEvl/GhUmCE0PMLaMPTa3Jk4HbKmRlHmu+gCftg== + +"@tanstack/virtual-core@3.13.14": + version "3.13.14" + resolved "https://registry.yarnpkg.com/@tanstack/virtual-core/-/virtual-core-3.13.14.tgz#ee838837e135e576227686e75a46c3fdd1951c4a" + integrity sha512-b5Uvd8J2dc7ICeX9SRb/wkCxWk7pUwN214eEPAQsqrsktSKTCmyLxOQWSMgogBByXclZeAdgZ3k4o0fIYUIBqQ== + +"@tanstack/vue-table@^8.21.3": + version "8.21.3" + resolved "https://registry.yarnpkg.com/@tanstack/vue-table/-/vue-table-8.21.3.tgz#09498ba5bbe5eca5aa665f9b76876da22715bb28" + integrity sha512-rusRyd77c5tDPloPskctMyPLFEQUeBzxdQ+2Eow4F7gDPlPOB1UnnhzfpdvqZ8ZyX2rRNGmqNnQWm87OI2OQPw== + dependencies: + "@tanstack/table-core" "8.21.3" + +"@tanstack/vue-virtual@^3.12.0", "@tanstack/vue-virtual@^3.13.13": + version "3.13.14" + resolved "https://registry.yarnpkg.com/@tanstack/vue-virtual/-/vue-virtual-3.13.14.tgz#2923f17cd4b73fc22863b47eeab6281b1580f8d8" + integrity sha512-dLKQCWj0uu6Rc1OsTGiClpH75hyf92MvJ9YALAzWdblwImSFnxfXD0mu8yOI7PlxiDAcDA5Pq0Q47YvADAfyfg== + dependencies: + "@tanstack/virtual-core" "3.13.14" + +"@tiptap/core@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@tiptap/core/-/core-3.13.0.tgz#ae3fe6fe7732f36b6ea8a2198e1fc53a4ad0d0d2" + integrity sha512-iUelgiTMgPVMpY5ZqASUpk8mC8HuR9FWKaDzK27w9oWip9tuB54Z8mePTxNcQaSPb6ErzEaC8x8egrRt7OsdGQ== + +"@tiptap/core@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/core/-/core-3.14.0.tgz#86e5f35971ea7c2d0695a9947efb57aed5cb5f1d" + integrity sha512-nm0VWVA1Vq/jaKY3wyRXViL/kf78yMdH7qETpv4qZXDQLU+pdWV3IGoRTQTKESc7d8L1wL/2uCeByLNUJfrSIw== + +"@tiptap/extension-blockquote@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-blockquote/-/extension-blockquote-3.14.0.tgz#6d885ec5420805eee815560065c89284b1adcdee" + integrity sha512-I7aOqcVLHBgCeRtMaMHA+ILSS8Sli46fjFq8477stOpQ79TPiBd6e4SDuFCAu58M94mVLMvlPKF2Eh5IvbIMyQ== + +"@tiptap/extension-bold@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-bold/-/extension-bold-3.14.0.tgz#199f4a5a41cf578636eb0899fe5a80acbe8de4bb" + integrity sha512-T4ma6VLoHm9JupglidD3CfZXm89A3HMv99gLplXNizvy1mlr4R3uC3aBqKw6lAP+NoqCqbIgjwc4YYsqZClNwA== + +"@tiptap/extension-bubble-menu@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-bubble-menu/-/extension-bubble-menu-3.13.0.tgz#c62dece2e865a2efaaf455061204f48f59f5b24f" + integrity sha512-qZ3j2DBsqP9DjG2UlExQ+tHMRhAnWlCKNreKddKocb/nAFrPdBCtvkqIEu+68zPlbLD4ukpoyjUklRJg+NipFg== + dependencies: + "@floating-ui/dom" "^1.0.0" + +"@tiptap/extension-bubble-menu@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-bubble-menu/-/extension-bubble-menu-3.14.0.tgz#268a8db0f2924d08c2236fc5b7e68299d12a0e5e" + integrity sha512-nraHy+5jumT67J7hWrCuVwVTS2vNj4FpV5kO8epVySBmgEBr/7Pyi4w7mQA1VRVOMdjeN9iypbgQ2rKhpfaoTw== + dependencies: + "@floating-ui/dom" "^1.0.0" + +"@tiptap/extension-bullet-list@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-bullet-list/-/extension-bullet-list-3.14.0.tgz#109e7e9c360176689b46504625467815a1a3ad79" + integrity sha512-luqPX4u52hiOAHJ95mYsNE+x+9dZxsM461Xny9d/eTXLjAcnwS7MghjrnpljvyYsSXNiwQtxUyEr4uEZZJ5gIQ== + +"@tiptap/extension-code-block@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-code-block/-/extension-code-block-3.14.0.tgz#abcdd414924574807a75759402d721b9d1a00261" + integrity sha512-hRSdIhhm3Q9JBMQdKaifRVFnAa4sG+M7l1QcTKR3VSYVy2/oR0U+aiOifi5OvMRBUwhaR71Ro+cMT9FH9s26Kg== + +"@tiptap/extension-code@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-code/-/extension-code-3.14.0.tgz#452ca88d58e769133f08e1827928fba7a7088755" + integrity sha512-Sx9yLorzS+oqNmXID4jt0G5tDnsEgU0HtEXPLD3KNt/ltVxWJU0AXwCsp1/Dg0HIDL868vWpJ2jC1t/4oaf9kA== + +"@tiptap/extension-document@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-document/-/extension-document-3.14.0.tgz#7b35ee080567f01f89b4f04c56ff1b857d5254a3" + integrity sha512-O3D7/GPB3XrWGy0y/b4LMHiY0eTd+dyIbSdiFtmUnbC/E9lqQLw43GiqvD9Gm6AyKhBA+Z45dKMbaOe1c6eTwQ== + +"@tiptap/extension-drag-handle-vue-3@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-drag-handle-vue-3/-/extension-drag-handle-vue-3-3.13.0.tgz#f38fb839925265b2da30a35cd07f17865ac6171d" + integrity sha512-kj0FpTEFo+KU7HUjrh245QY9HFhTL3y7PCuhNemRHcg9YdkFn07Up6LXthVxXGEFmnQfjR0L4aWFo7xPpUwj7g== + +"@tiptap/extension-dropcursor@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-dropcursor/-/extension-dropcursor-3.14.0.tgz#e3a5db8af6e999a2cecd74636cd761716f79a4c7" + integrity sha512-IwHyiZKLjV9WSBlQFS+afMjucIML8wFAKkG8UKCu+CVOe/Qd1ImDGyv6rzPlCmefJkDHIUWS+c2STapJlUD1VQ== + +"@tiptap/extension-floating-menu@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-floating-menu/-/extension-floating-menu-3.13.0.tgz#03d03292add49d1b380cdb1ff3890b2956d4e3f5" + integrity sha512-OsezV2cMofZM4c13gvgi93IEYBUzZgnu8BXTYZQiQYekz4bX4uulBmLa1KOA9EN71FzS+SoLkXHU0YzlbLjlxA== + +"@tiptap/extension-floating-menu@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-floating-menu/-/extension-floating-menu-3.14.0.tgz#7c178962667888bc036f311a2ac434db6d2638f2" + integrity sha512-+ErwDF74NzX4JV0nXMSIUT9V8FDdo85r0SaBZ8lb2NLmElaA3LDklcNV7SsoKlRcwsAXtFkqQbDwXLNGQLYSPQ== + +"@tiptap/extension-gapcursor@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-gapcursor/-/extension-gapcursor-3.14.0.tgz#18528d3525d6b5320577b9a7b6bcdcee78f21196" + integrity sha512-hMg2U59+c9FreYtTvzxx5GWKejdZLRITMLEu4OTfrgQok6uF4qkzGEEqmYqPiHk08TBqAg18Y5bbpyqTsuit9A== + +"@tiptap/extension-hard-break@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-hard-break/-/extension-hard-break-3.14.0.tgz#d4e7862760312d149522a82613108ddcefa8b2d9" + integrity sha512-XKxr8usQp+kFevhDK6Ccmnq1CIkLmPClhKwbt7AClGLKLBtEVAS1qUgcmKudkw8cD8Q2/69twI37LXa23sfuLA== + +"@tiptap/extension-heading@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-heading/-/extension-heading-3.14.0.tgz#1c6bb3e099b049ee8024380e73dd7fa6e4491167" + integrity sha512-4xpahSo3b1dN2nwA0XKXLQVz9nZ/vE443a/Y5QLWeXiu3v9wkcMs/5kQ5ysFeDZRBTfVUWBqhngI7zhvDUx2zQ== + +"@tiptap/extension-horizontal-rule@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-3.13.0.tgz#c51eb35f3b3bf6308ab6b354a06c0e96c19dbff6" + integrity sha512-ZUFyORtjj22ib8ykbxRhWFQOTZjNKqOsMQjaAGof30cuD2DN5J5pMz7Haj2fFRtLpugWYH+f0Mi+WumQXC3hCw== + +"@tiptap/extension-horizontal-rule@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-3.14.0.tgz#c8cb034428975fa0ecd2581637db8765698c323d" + integrity sha512-65O4T9vPKLUKO1fLowh5jqtfQlH5eaIL7qb/uj5sXMMg8O7TCvBIRkwNuYsFTkJmTk4vBy+fjZ0uwSY3DFkO1g== + +"@tiptap/extension-image@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-image/-/extension-image-3.13.0.tgz#55edb952e86c2ebed436cd53def8b2e743d71d7e" + integrity sha512-223uzLUkIa1rkK7aQK3AcIXe6LbCtmnpVb7sY5OEp+LpSaSPyXwyrZ4A0EO1o98qXG68/0B2OqMntFtA9c5Fbw== + +"@tiptap/extension-italic@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-italic/-/extension-italic-3.14.0.tgz#64f79253ec15faa5bb6f8345ec38b8dd9e276485" + integrity sha512-Arl5EaG4wdyipwvKjsI7Krlk3OkmqvLfF0YfGwsd5AVDxTiYuiDGgz7RF8J2kttbBeiUTqwME5xpkryQK3F+fg== + +"@tiptap/extension-link@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-link/-/extension-link-3.14.0.tgz#e1ba42af930f65e548af30a5be143616d97630d4" + integrity sha512-xaeJIktD42rJ4t9fbQpKe+yYNZ+YFIK96cp1Kdm0hZHv/8MPMNRiF85TRY+9U1aoyh5uRcspgCj7EKQb2Hs7qg== + dependencies: + linkifyjs "^4.3.2" + +"@tiptap/extension-list-item@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-list-item/-/extension-list-item-3.14.0.tgz#4830f5645db6f66a2c94ac89404fffc7d108e513" + integrity sha512-19Dcp8HCFdhINmRy0KQLFfz9ZEuVwFWGAAjYG7BvMvkd9k4sJ5vCv5fej59G99rhsc+tCmik77w+SLksOcxwKQ== + +"@tiptap/extension-list-keymap@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-list-keymap/-/extension-list-keymap-3.14.0.tgz#ad8d86f7442066c4e0d6a540a517a2b93708d53d" + integrity sha512-1oPbvNnQjeOxkHZcUbWPx/IY9o4fT3QGk/9A9cIjFrJRD2AHzbYfPDHNHINtg7Bj0jWz74cHvAHcaxP+M27jkA== + +"@tiptap/extension-list@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-list/-/extension-list-3.14.0.tgz#e58159df96f81852e1a80e088f5f0218d96689d0" + integrity sha512-rsjFH0Vd/4UbDsjwMLay7oz72VVu1r35t8ofAzy5587jn5JAjflaZs05XbRRMD2imUTK41dyajVSh8CqSnDEJw== + +"@tiptap/extension-mention@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-mention/-/extension-mention-3.13.0.tgz#c46170be77c37e730c81bbec2294ae5bc16e2a95" + integrity sha512-JcZ9ItaaifurERewyydfj/s52MGcWsCxk5hYdkSohzwa8Ohw4yyghHWCuEl/kvLK+9KhjIDDr1jvAmfZ89I7Fg== + +"@tiptap/extension-ordered-list@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-ordered-list/-/extension-ordered-list-3.14.0.tgz#ef717f5044e9eafa5391275e1c6514681123105d" + integrity sha512-/fXjVL4JajkJQoc213iiput0bCXC4ztUPUpvNuI62VcgFKHcTvX4eYxED1VflotCx0OdkyY9yYD8PtvyO5lkmA== + +"@tiptap/extension-paragraph@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-paragraph/-/extension-paragraph-3.14.0.tgz#f29ae67d1f28c676bce5e0654e0cce1cad02ff3b" + integrity sha512-NFxk2yNo3Cvh9g8evea+yTLNV48se7MbMcVizTnVhobqtBKv793qsb5FM5Hu30Y72FQPNfH+LRoap4XZyBPfVw== + +"@tiptap/extension-placeholder@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-placeholder/-/extension-placeholder-3.13.0.tgz#4bbddc173bc0a238ab9e6bfef6616a6131273fba" + integrity sha512-Au4ktRBraQktX9gjSzGWyJV6kPof7+kOhzE8ej+rOMjIrHbx3DCHy1CJWftSO9BbqIyonjsFmm4nE+vjzZ3Z5Q== + +"@tiptap/extension-strike@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-strike/-/extension-strike-3.14.0.tgz#650487246bb5ae8f3d33b45065f577d759fedbbd" + integrity sha512-R8BbAhnWpisBml6okMKl98hY4tJjedTTgyTkx8tPabIJ92nS9IURKEk3foWB9uHxdTOBUqTvVT+2ScDf9r6QHg== + +"@tiptap/extension-text@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-text/-/extension-text-3.14.0.tgz#bce76b90dc98c41a19d8ddeceb725904aeeca42b" + integrity sha512-XlpnD87LQ7lLcDcBenHgzxv3uivQzPdVHM16CY4lXR4aKDIp2mxjPZr4twHT+cOnRQHc8VYpRgkEo6LLX6VylA== + +"@tiptap/extension-underline@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extension-underline/-/extension-underline-3.14.0.tgz#7d9ac55419f353cdd3817b8f5d56a11e909b1251" + integrity sha512-zmnWlsi2g/tMlThHby0Je9O+v24j4d+qcXF3nuzLUUaDsGCEtOyC9RzwITft59ViK+Nc2PD2W/J14rsB0j+qoQ== + +"@tiptap/extensions@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/extensions/-/extensions-3.14.0.tgz#8367d3d644cf68b85341e059f5685b13b5722b1a" + integrity sha512-qQBVKqzU4ZVjRn8W0UbdfE4LaaIgcIWHOMrNnJ+PutrRzQ6ZzhmD/kRONvRWBfG9z3DU7pSKGwVYSR2hztsGuQ== + +"@tiptap/markdown@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@tiptap/markdown/-/markdown-3.13.0.tgz#78e1639242aca728c6801cc5ddcca3c57cdd556e" + integrity sha512-BI1GZxDFBrEeYbngbKh/si48tRSXO6HVGg7KzlfOwdncSD982/loG2KUnFIjoVGjmMzXNDWbI6O/eqfLVQPB5Q== + dependencies: + marked "^15.0.12" + +"@tiptap/pm@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@tiptap/pm/-/pm-3.13.0.tgz#d01e9f08e2be3e6bfa69ed4457a1c2fee87157b3" + integrity sha512-WKR4ucALq+lwx0WJZW17CspeTpXorbIOpvKv5mulZica6QxqfMhn8n1IXCkDws/mCoLRx4Drk5d377tIjFNsvQ== + dependencies: + prosemirror-changeset "^2.3.0" + prosemirror-collab "^1.3.1" + prosemirror-commands "^1.6.2" + prosemirror-dropcursor "^1.8.1" + prosemirror-gapcursor "^1.3.2" + prosemirror-history "^1.4.1" + prosemirror-inputrules "^1.4.0" + prosemirror-keymap "^1.2.2" + prosemirror-markdown "^1.13.1" + prosemirror-menu "^1.2.4" + prosemirror-model "^1.24.1" + prosemirror-schema-basic "^1.2.3" + prosemirror-schema-list "^1.5.0" + prosemirror-state "^1.4.3" + prosemirror-tables "^1.6.4" + prosemirror-trailing-node "^3.0.0" + prosemirror-transform "^1.10.2" + prosemirror-view "^1.38.1" + +"@tiptap/pm@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@tiptap/pm/-/pm-3.14.0.tgz#4536c351ec8ab2b7d44a8b4f0eba4b8c46437532" + integrity sha512-xrZmqI5jl4yMeAsu8p8gVP9S3An5h2MBi8BQHNnZmpyzkUrlpd40vlT6u13SWIqVi5ZWhBZ6U3rL7mkVLZuRKg== + dependencies: + prosemirror-changeset "^2.3.0" + prosemirror-collab "^1.3.1" + prosemirror-commands "^1.6.2" + prosemirror-dropcursor "^1.8.1" + prosemirror-gapcursor "^1.3.2" + prosemirror-history "^1.4.1" + prosemirror-inputrules "^1.4.0" + prosemirror-keymap "^1.2.2" + prosemirror-markdown "^1.13.1" + prosemirror-menu "^1.2.4" + prosemirror-model "^1.24.1" + prosemirror-schema-basic "^1.2.3" + prosemirror-schema-list "^1.5.0" + prosemirror-state "^1.4.3" + prosemirror-tables "^1.6.4" + prosemirror-trailing-node "^3.0.0" + prosemirror-transform "^1.10.2" + prosemirror-view "^1.38.1" + +"@tiptap/starter-kit@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@tiptap/starter-kit/-/starter-kit-3.13.0.tgz#7f803f0e089a7c2cbd016ad79b257c4cbe910208" + integrity sha512-Ojn6sRub04CRuyQ+9wqN62JUOMv+rG1vXhc2s6DCBCpu28lkCMMW+vTe7kXJcEdbot82+5swPbERw9vohswFzg== + dependencies: + "@tiptap/core" "^3.13.0" + "@tiptap/extension-blockquote" "^3.13.0" + "@tiptap/extension-bold" "^3.13.0" + "@tiptap/extension-bullet-list" "^3.13.0" + "@tiptap/extension-code" "^3.13.0" + "@tiptap/extension-code-block" "^3.13.0" + "@tiptap/extension-document" "^3.13.0" + "@tiptap/extension-dropcursor" "^3.13.0" + "@tiptap/extension-gapcursor" "^3.13.0" + "@tiptap/extension-hard-break" "^3.13.0" + "@tiptap/extension-heading" "^3.13.0" + "@tiptap/extension-horizontal-rule" "^3.13.0" + "@tiptap/extension-italic" "^3.13.0" + "@tiptap/extension-link" "^3.13.0" + "@tiptap/extension-list" "^3.13.0" + "@tiptap/extension-list-item" "^3.13.0" + "@tiptap/extension-list-keymap" "^3.13.0" + "@tiptap/extension-ordered-list" "^3.13.0" + "@tiptap/extension-paragraph" "^3.13.0" + "@tiptap/extension-strike" "^3.13.0" + "@tiptap/extension-text" "^3.13.0" + "@tiptap/extension-underline" "^3.13.0" + "@tiptap/extensions" "^3.13.0" + "@tiptap/pm" "^3.13.0" + +"@tiptap/suggestion@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@tiptap/suggestion/-/suggestion-3.13.0.tgz#ca4864323c9c7e7ce92f69c35e2d0a80713f2f68" + integrity sha512-IXNvyLITpPiuXHn/q1ntztPYJZMFjPAokKj+OQz3MFNYlzAX3I409KD/EwwCubisRIAFiNX0ZjIIXxxZ3AhFTw== + +"@tiptap/vue-3@3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@tiptap/vue-3/-/vue-3-3.13.0.tgz#87170cfaa42a01e8c2a27e3effaac77a5316bc1c" + integrity sha512-vl9l2oEARKyUNpViqwSPCL0+dlyIomrPTdHOtDJb6ldo/umWKvjqgLhAtgA7MQ9NwVQa1k5rKICWU6ZH+jLBOw== + optionalDependencies: + "@tiptap/extension-bubble-menu" "^3.13.0" + "@tiptap/extension-floating-menu" "^3.13.0" + "@tootallnate/once@1": version "1.1.2" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" @@ -2953,6 +4681,11 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== +"@trysound/sax@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" + integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== + "@tsconfig/node10@^1.0.7": version "1.0.9" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" @@ -2973,6 +4706,13 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== +"@tybys/wasm-util@^0.10.1": + version "0.10.1" + resolved "https://registry.yarnpkg.com/@tybys/wasm-util/-/wasm-util-0.10.1.tgz#ecddd3205cf1e2d5274649ff0eedd2991ed7f414" + integrity sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg== + dependencies: + tslib "^2.4.0" + "@types/archiver@^5.1.0": version "5.3.4" resolved "https://registry.yarnpkg.com/@types/archiver/-/archiver-5.3.4.tgz#32172d5a56f165b5b4ac902e366248bf03d3ae84" @@ -3025,6 +4765,11 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== +"@types/estree@1.0.8": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e" + integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w== + "@types/estree@^0.0.50": version "0.0.50" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" @@ -3045,6 +4790,13 @@ dependencies: "@types/unist" "^2" +"@types/hast@^3.0.0", "@types/hast@^3.0.4": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/hast/-/hast-3.0.4.tgz#1d6b39993b82cea6ad783945b0508c25903e15aa" + integrity sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ== + dependencies: + "@types/unist" "*" + "@types/http-proxy@^1.17.8": version "1.17.14" resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.14.tgz#57f8ccaa1c1c3780644f8a94f9c6b5000b5e2eec" @@ -3079,6 +4831,11 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== +"@types/linkify-it@^5": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-5.0.0.tgz#21413001973106cda1c3a9b91eedd4ccd5469d76" + integrity sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q== + "@types/lodash@^4.14.198": version "4.14.202" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.202.tgz#f09dbd2fb082d507178b2f2a5c7e74bd72ff98f8" @@ -3094,6 +4851,14 @@ resolved "https://registry.yarnpkg.com/@types/lunr/-/lunr-2.3.7.tgz#378a98ecf7a9fafc42466f67f73173c34a6265a0" integrity sha512-Tb/kUm38e8gmjahQzdCKhbdsvQ9/ppzHFfsJ0dMs3ckqQsRj+P5IkSAwFTBrBxdyr3E/LoMUUrZngjDYAjiE3A== +"@types/markdown-it@^14.0.0", "@types/markdown-it@^14.1.2": + version "14.1.2" + resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-14.1.2.tgz#57f2532a0800067d9b934f3521429a2e8bfb4c61" + integrity sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog== + dependencies: + "@types/linkify-it" "^5" + "@types/mdurl" "^2" + "@types/mdast@^3.0.0": version "3.0.15" resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.15.tgz#49c524a263f30ffa28b71ae282f813ed000ab9f5" @@ -3101,6 +4866,18 @@ dependencies: "@types/unist" "^2" +"@types/mdast@^4.0.0": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-4.0.4.tgz#7ccf72edd2f1aa7dd3437e180c64373585804dd6" + integrity sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA== + dependencies: + "@types/unist" "*" + +"@types/mdurl@^2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-2.0.0.tgz#d43878b5b20222682163ae6f897b20447233bdfd" + integrity sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg== + "@types/minimatch@*": version "5.1.2" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" @@ -3248,6 +5025,16 @@ "@types/unist" "*" "@types/vfile-message" "*" +"@types/web-bluetooth@^0.0.20": + version "0.0.20" + resolved "https://registry.yarnpkg.com/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz#f066abfcd1cbe66267cdbbf0de010d8a41b41597" + integrity sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow== + +"@types/web-bluetooth@^0.0.21": + version "0.0.21" + resolved "https://registry.yarnpkg.com/@types/web-bluetooth/-/web-bluetooth-0.0.21.tgz#525433c784aed9b457aaa0ee3d92aeb71f346b63" + integrity sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA== + "@types/yamljs@^0.2.34": version "0.2.34" resolved "https://registry.yarnpkg.com/@types/yamljs/-/yamljs-0.2.34.tgz#c10b1f31b173f2cc93342f27b0796c2eb5b3ae84" @@ -3512,11 +5299,29 @@ "@typescript-eslint/types" "6.19.0" eslint-visitor-keys "^3.4.1" +"@ungap/structured-clone@^1.0.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.3.0.tgz#d06bbb384ebcf6c505fde1c3d0ed4ddffe0aaff8" + integrity sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g== + "@ungap/structured-clone@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== +"@unhead/vue@^2.0.19": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@unhead/vue/-/vue-2.1.1.tgz#4de064a1892f56cde38137a9a53b940abdce3bb7" + integrity sha512-WYa8ORhfv7lWDSoNpkMKhbW1Dbsux/3HqMcVkZS3xZ2/c/VrcChLj+IMadpCd1WNR0srITfRJhBYZ1i9hON5Qw== + dependencies: + hookable "^5.5.3" + unhead "2.1.1" + +"@vitejs/plugin-vue@^5.2.1": + version "5.2.4" + resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-5.2.4.tgz#9e8a512eb174bfc2a333ba959bbf9de428d89ad8" + integrity sha512-7Yx/SXSOcQq5HiiV3orevHUFn+pmMB4cgbEkDYgnkUWb0WfeQ/wa2yFv6D5ICiCQOVpjA7vYDXrC7AGO8yjDHA== + "@vitest/expect@1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-1.2.1.tgz#574c0ac138a9e34522da202ea4c48a3adfe7240e" @@ -3561,6 +5366,193 @@ loupe "^2.3.7" pretty-format "^29.7.0" +"@vue/compiler-core@3.5.26": + version "3.5.26" + resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.5.26.tgz#1a91ea90980528bedff7b1c292690bfb30612485" + integrity sha512-vXyI5GMfuoBCnv5ucIT7jhHKl55Y477yxP6fc4eUswjP8FG3FFVFd41eNDArR+Uk3QKn2Z85NavjaxLxOC19/w== + dependencies: + "@babel/parser" "^7.28.5" + "@vue/shared" "3.5.26" + entities "^7.0.0" + estree-walker "^2.0.2" + source-map-js "^1.2.1" + +"@vue/compiler-dom@3.5.26": + version "3.5.26" + resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.5.26.tgz#66c36b6ed8bdf43236d7188ea332bc9d078eb286" + integrity sha512-y1Tcd3eXs834QjswshSilCBnKGeQjQXB6PqFn/1nxcQw4pmG42G8lwz+FZPAZAby6gZeHSt/8LMPfZ4Rb+Bd/A== + dependencies: + "@vue/compiler-core" "3.5.26" + "@vue/shared" "3.5.26" + +"@vue/compiler-sfc@3.5.26": + version "3.5.26" + resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.5.26.tgz#fb1c6c4bf9a9e22bb169e039e19437cb6995917a" + integrity sha512-egp69qDTSEZcf4bGOSsprUr4xI73wfrY5oRs6GSgXFTiHrWj4Y3X5Ydtip9QMqiCMCPVwLglB9GBxXtTadJ3mA== + dependencies: + "@babel/parser" "^7.28.5" + "@vue/compiler-core" "3.5.26" + "@vue/compiler-dom" "3.5.26" + "@vue/compiler-ssr" "3.5.26" + "@vue/shared" "3.5.26" + estree-walker "^2.0.2" + magic-string "^0.30.21" + postcss "^8.5.6" + source-map-js "^1.2.1" + +"@vue/compiler-ssr@3.5.26": + version "3.5.26" + resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.5.26.tgz#f6e94bccbb5339180779036ddfb614f998a197ea" + integrity sha512-lZT9/Y0nSIRUPVvapFJEVDbEXruZh2IYHMk2zTtEgJSlP5gVOqeWXH54xDKAaFS4rTnDeDBQUYDtxKyoW9FwDw== + dependencies: + "@vue/compiler-dom" "3.5.26" + "@vue/shared" "3.5.26" + +"@vue/devtools-api@^7.7.0": + version "7.7.9" + resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-7.7.9.tgz#999dbea50da6b00cf59a1336f11fdc2b43d9e063" + integrity sha512-kIE8wvwlcZ6TJTbNeU2HQNtaxLx3a84aotTITUuL/4bzfPxzajGBOoqjMhwZJ8L9qFYDU/lAYMEEm11dnZOD6g== + dependencies: + "@vue/devtools-kit" "^7.7.9" + +"@vue/devtools-kit@^7.7.9": + version "7.7.9" + resolved "https://registry.yarnpkg.com/@vue/devtools-kit/-/devtools-kit-7.7.9.tgz#bc218a815616e8987df7ab3e10fc1fb3b8706c58" + integrity sha512-PyQ6odHSgiDVd4hnTP+aDk2X4gl2HmLDfiyEnn3/oV+ckFDuswRs4IbBT7vacMuGdwY/XemxBoh302ctbsptuA== + dependencies: + "@vue/devtools-shared" "^7.7.9" + birpc "^2.3.0" + hookable "^5.5.3" + mitt "^3.0.1" + perfect-debounce "^1.0.0" + speakingurl "^14.0.1" + superjson "^2.2.2" + +"@vue/devtools-shared@^7.7.9": + version "7.7.9" + resolved "https://registry.yarnpkg.com/@vue/devtools-shared/-/devtools-shared-7.7.9.tgz#fa4c096b744927081a7dda5fcf05f34b1ae6ca14" + integrity sha512-iWAb0v2WYf0QWmxCGy0seZNDPdO3Sp5+u78ORnyeonS6MT4PC7VPrryX2BpMJrwlDeaZ6BD4vP4XKjK0SZqaeA== + dependencies: + rfdc "^1.4.1" + +"@vue/reactivity@3.5.26": + version "3.5.26" + resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.5.26.tgz#59a1edf566dc80133c1c26c93711c877e8602c48" + integrity sha512-9EnYB1/DIiUYYnzlnUBgwU32NNvLp/nhxLXeWRhHUEeWNTn1ECxX8aGO7RTXeX6PPcxe3LLuNBFoJbV4QZ+CFQ== + dependencies: + "@vue/shared" "3.5.26" + +"@vue/runtime-core@3.5.26": + version "3.5.26" + resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.5.26.tgz#3f2c040bcf8018c03a1ab5adb0d788c13c986f0e" + integrity sha512-xJWM9KH1kd201w5DvMDOwDHYhrdPTrAatn56oB/LRG4plEQeZRQLw0Bpwih9KYoqmzaxF0OKSn6swzYi84e1/Q== + dependencies: + "@vue/reactivity" "3.5.26" + "@vue/shared" "3.5.26" + +"@vue/runtime-dom@3.5.26": + version "3.5.26" + resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.5.26.tgz#5954848614883948ecc1f631a67b32cc32f81936" + integrity sha512-XLLd/+4sPC2ZkN/6+V4O4gjJu6kSDbHAChvsyWgm1oGbdSO3efvGYnm25yCjtFm/K7rrSDvSfPDgN1pHgS4VNQ== + dependencies: + "@vue/reactivity" "3.5.26" + "@vue/runtime-core" "3.5.26" + "@vue/shared" "3.5.26" + csstype "^3.2.3" + +"@vue/server-renderer@3.5.26": + version "3.5.26" + resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.5.26.tgz#269055497fcc75b3984063f866f17c748b565ef4" + integrity sha512-TYKLXmrwWKSodyVuO1WAubucd+1XlLg4set0YoV+Hu8Lo79mp/YMwWV5mC5FgtsDxX3qo1ONrxFaTP1OQgy1uA== + dependencies: + "@vue/compiler-ssr" "3.5.26" + "@vue/shared" "3.5.26" + +"@vue/shared@3.5.26", "@vue/shared@^3.5.13", "@vue/shared@^3.5.25": + version "3.5.26" + resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.5.26.tgz#1e02ef2d64aced818cd31d81ce5175711dc90a9f" + integrity sha512-7Z6/y3uFI5PRoKeorTOSXKcDj0MSasfNNltcslbFrPpcw6aXRUALq4IfJlaTRspiWIUOEZbrpM+iQGmCOiWe4A== + +"@vueuse/core@12.8.2", "@vueuse/core@^12.4.0", "@vueuse/core@^12.5.0": + version "12.8.2" + resolved "https://registry.yarnpkg.com/@vueuse/core/-/core-12.8.2.tgz#007c6dd29a7d1f6933e916e7a2f8ef3c3f968eaa" + integrity sha512-HbvCmZdzAu3VGi/pWYm5Ut+Kd9mn1ZHnn4L5G8kOQTPs/IwIAmJoBrmYk2ckLArgMXZj0AW3n5CAejLUO+PhdQ== + dependencies: + "@types/web-bluetooth" "^0.0.21" + "@vueuse/metadata" "12.8.2" + "@vueuse/shared" "12.8.2" + vue "^3.5.13" + +"@vueuse/core@14.1.0", "@vueuse/core@^14.1.0": + version "14.1.0" + resolved "https://registry.yarnpkg.com/@vueuse/core/-/core-14.1.0.tgz#274e98e591a505333b7dfb2bcaf7b4530a10b9c9" + integrity sha512-rgBinKs07hAYyPF834mDTigH7BtPqvZ3Pryuzt1SD/lg5wEcWqvwzXXYGEDb2/cP0Sj5zSvHl3WkmMELr5kfWw== + dependencies: + "@types/web-bluetooth" "^0.0.21" + "@vueuse/metadata" "14.1.0" + "@vueuse/shared" "14.1.0" + +"@vueuse/core@^10.8.0": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@vueuse/core/-/core-10.11.1.tgz#15d2c0b6448d2212235b23a7ba29c27173e0c2c6" + integrity sha512-guoy26JQktXPcz+0n3GukWIy/JDNKti9v6VEMu6kV2sYBsWuGiTU8OWdg+ADfUbHg3/3DlqySDe7JmdHrktiww== + dependencies: + "@types/web-bluetooth" "^0.0.20" + "@vueuse/metadata" "10.11.1" + "@vueuse/shared" "10.11.1" + vue-demi ">=0.14.8" + +"@vueuse/integrations@^12.4.0": + version "12.8.2" + resolved "https://registry.yarnpkg.com/@vueuse/integrations/-/integrations-12.8.2.tgz#d04f33d86fe985c9a27c98addcfde9f30f2db1df" + integrity sha512-fbGYivgK5uBTRt7p5F3zy6VrETlV9RtZjBqd1/HxGdjdckBgBM4ugP8LHpjolqTj14TXTxSK1ZfgPbHYyGuH7g== + dependencies: + "@vueuse/core" "12.8.2" + "@vueuse/shared" "12.8.2" + vue "^3.5.13" + +"@vueuse/integrations@^14.1.0": + version "14.1.0" + resolved "https://registry.yarnpkg.com/@vueuse/integrations/-/integrations-14.1.0.tgz#cda3b828125487474632cbcfd2e140f7efa9becd" + integrity sha512-eNQPdisnO9SvdydTIXnTE7c29yOsJBD/xkwEyQLdhDC/LKbqrFpXHb3uS//7NcIrQO3fWVuvMGp8dbK6mNEMCA== + dependencies: + "@vueuse/core" "14.1.0" + "@vueuse/shared" "14.1.0" + +"@vueuse/metadata@10.11.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@vueuse/metadata/-/metadata-10.11.1.tgz#209db7bb5915aa172a87510b6de2ca01cadbd2a7" + integrity sha512-IGa5FXd003Ug1qAZmyE8wF3sJ81xGLSqTqtQ6jaVfkeZ4i5kS2mwQF61yhVqojRnenVew5PldLyRgvdl4YYuSw== + +"@vueuse/metadata@12.8.2": + version "12.8.2" + resolved "https://registry.yarnpkg.com/@vueuse/metadata/-/metadata-12.8.2.tgz#6cb3a4e97cdcf528329eebc1bda73cd7f64318d3" + integrity sha512-rAyLGEuoBJ/Il5AmFHiziCPdQzRt88VxR+Y/A/QhJ1EWtWqPBBAxTAFaSkviwEuOEZNtW8pvkPgoCZQ+HxqW1A== + +"@vueuse/metadata@14.1.0": + version "14.1.0" + resolved "https://registry.yarnpkg.com/@vueuse/metadata/-/metadata-14.1.0.tgz#70fc2e94775e4a07369f11f86f6f0a465b04a381" + integrity sha512-7hK4g015rWn2PhKcZ99NyT+ZD9sbwm7SGvp7k+k+rKGWnLjS/oQozoIZzWfCewSUeBmnJkIb+CNr7Zc/EyRnnA== + +"@vueuse/shared@10.11.1": + version "10.11.1" + resolved "https://registry.yarnpkg.com/@vueuse/shared/-/shared-10.11.1.tgz#62b84e3118ae6e1f3ff38f4fbe71b0c5d0f10938" + integrity sha512-LHpC8711VFZlDaYUXEBbFBCQ7GS3dVU9mjOhhMhXP6txTV4EhYQg/KGnQuvt/sPAtoUKq7VVUnL6mVtFoL42sA== + dependencies: + vue-demi ">=0.14.8" + +"@vueuse/shared@12.8.2", "@vueuse/shared@^12.5.0": + version "12.8.2" + resolved "https://registry.yarnpkg.com/@vueuse/shared/-/shared-12.8.2.tgz#b9e4611d0603629c8e151f982459da394e22f930" + integrity sha512-dznP38YzxZoNloI0qpEfpkms8knDtaoQ6Y/sfS0L7Yki4zh40LFHEhur0odJC6xTHG5dxWVPiUWBXn+wCG2s5w== + dependencies: + vue "^3.5.13" + +"@vueuse/shared@14.1.0": + version "14.1.0" + resolved "https://registry.yarnpkg.com/@vueuse/shared/-/shared-14.1.0.tgz#49b2face86a9c0c52e20eaf4c732a0223276c11f" + integrity sha512-EcKxtYvn6gx1F8z9J5/rsg3+lTQnvOruQd8fUecW99DCK04BkWD7z5KQ/wTAx+DazyoEE9dJt/zV8OIEQbM6kw== + "@webassemblyjs/ast@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" @@ -3848,6 +5840,11 @@ acorn@^8.10.0, acorn@^8.11.3, acorn@^8.5.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== +acorn@^8.15.0: + version "8.15.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.15.0.tgz#a360898bc415edaac46c8241f6383975b930b816" + integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg== + acorn@^8.2.0, acorn@^8.4.1, acorn@^8.7.0, acorn@^8.8.2, acorn@^8.9.0: version "8.11.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.2.tgz#ca0d78b51895be5390a5903c5b3bdcdaf78ae40b" @@ -3976,6 +5973,26 @@ ajv@^8.0.0, ajv@^8.9.0: require-from-string "^2.0.2" uri-js "^4.2.2" +algoliasearch@^5.14.2: + version "5.46.2" + resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-5.46.2.tgz#3afba0e53f3293e39cfde9b2ef27c583d44bf2a5" + integrity sha512-qqAXW9QvKf2tTyhpDA4qXv1IfBwD2eduSW6tUEBFIfCeE9gn9HQ9I5+MaKoenRuHrzk5sQoNh1/iof8mY7uD6Q== + dependencies: + "@algolia/abtesting" "1.12.2" + "@algolia/client-abtesting" "5.46.2" + "@algolia/client-analytics" "5.46.2" + "@algolia/client-common" "5.46.2" + "@algolia/client-insights" "5.46.2" + "@algolia/client-personalization" "5.46.2" + "@algolia/client-query-suggestions" "5.46.2" + "@algolia/client-search" "5.46.2" + "@algolia/ingestion" "1.46.2" + "@algolia/monitoring" "1.46.2" + "@algolia/recommend" "5.46.2" + "@algolia/requester-browser-xhr" "5.46.2" + "@algolia/requester-fetch" "5.46.2" + "@algolia/requester-node-http" "5.46.2" + ambi@3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ambi/-/ambi-3.2.0.tgz#13b45fcf6845465f652137f80176322e911b70d6" @@ -4092,7 +6109,7 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" -anymatch@~3.1.2: +anymatch@^3.1.3, anymatch@~3.1.2: version "3.1.3" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== @@ -4193,6 +6210,13 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +aria-hidden@^1.2.4: + version "1.2.6" + resolved "https://registry.yarnpkg.com/aria-hidden/-/aria-hidden-1.2.6.tgz#73051c9b088114c795b1ea414e9c0fff874ffc1a" + integrity sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA== + dependencies: + tslib "^2.0.0" + aria-query@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" @@ -4454,6 +6478,17 @@ autoprefixer@^10.4.2: picocolors "^1.0.0" postcss-value-parser "^4.2.0" +autoprefixer@^10.4.20: + version "10.4.23" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.23.tgz#c6aa6db8e7376fcd900f9fd79d143ceebad8c4e6" + integrity sha512-YYTXSFulfwytnjAPlw8QHncHJmlvFKtczb8InXaAx9Q0LbfDnfEYDE55omerIJKihhmU61Ft+cAOSzQVaBUmeA== + dependencies: + browserslist "^4.28.1" + caniuse-lite "^1.0.30001760" + fraction.js "^5.3.4" + picocolors "^1.1.1" + postcss-value-parser "^4.2.0" + available-typed-arrays@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" @@ -4601,7 +6636,7 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base64-js@^1.2.0, base64-js@^1.3.0, base64-js@^1.3.1: +base64-js@^1.1.2, base64-js@^1.2.0, base64-js@^1.3.0, base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== @@ -4624,6 +6659,11 @@ base@^0.11.1: mixin-deep "^1.2.0" pascalcase "^0.1.1" +baseline-browser-mapping@^2.9.0: + version "2.9.11" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.11.tgz#53724708c8db5f97206517ecfe362dbe5181deea" + integrity sha512-Sg0xJUNDU1sJNGdfGWhVHX0kkZ+HWcvmVymJbj6NSgZZmW/8S9Y2HQ5euytnIgakgxN6papOAWiwDo1ctFDcoQ== + basic-auth-connect@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/basic-auth-connect/-/basic-auth-connect-1.0.0.tgz#fdb0b43962ca7b40456a7c2bb48fe173da2d2122" @@ -4693,6 +6733,11 @@ bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" +birpc@^2.3.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/birpc/-/birpc-2.9.0.tgz#b59550897e4cd96a223e2a6c1475b572236ed145" + integrity sha512-KrayHS5pBi69Xi9JmvoqrIgYGDkD6mcSe/i6YKi3w5kekCLzrX4+nawcXqrj2tIp50Kw/mT/s3p+GVK0A0sKxw== + bl@^4.0.3, bl@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" @@ -4851,6 +6896,20 @@ braces@^3.0.2, braces@~3.0.2: dependencies: fill-range "^7.0.1" +braces@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== + dependencies: + fill-range "^7.1.1" + +brotli@^1.3.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/brotli/-/brotli-1.3.3.tgz#7365d8cc00f12cf765d2b2c898716bcf4b604d48" + integrity sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg== + dependencies: + base64-js "^1.1.2" + browser-process-hrtime@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" @@ -4881,6 +6940,17 @@ browserslist@^4.22.2: node-releases "^2.0.14" update-browserslist-db "^1.0.13" +browserslist@^4.28.1: + version "4.28.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.1.tgz#7f534594628c53c63101079e27e40de490456a95" + integrity sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA== + dependencies: + baseline-browser-mapping "^2.9.0" + caniuse-lite "^1.0.30001759" + electron-to-chromium "^1.5.263" + node-releases "^2.0.27" + update-browserslist-db "^1.2.0" + browserstack@^1.5.1: version "1.6.1" resolved "https://registry.yarnpkg.com/browserstack/-/browserstack-1.6.1.tgz#e051f9733ec3b507659f395c7a4765a1b1e358b3" @@ -4953,6 +7023,24 @@ bytes@3.1.2: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== +c12@^3.3.2: + version "3.3.3" + resolved "https://registry.yarnpkg.com/c12/-/c12-3.3.3.tgz#cab6604e6e6117fc9e62439a8e8144bbbe5edcd6" + integrity sha512-750hTRvgBy5kcMNPdh95Qo+XUBeGo8C7nsKSmedDmaQI+E0r82DwHeM6vBewDe4rGFbnxoa4V9pw+sPh5+Iz8Q== + dependencies: + chokidar "^5.0.0" + confbox "^0.2.2" + defu "^6.1.4" + dotenv "^17.2.3" + exsolve "^1.0.8" + giget "^2.0.0" + jiti "^2.6.1" + ohash "^2.0.11" + pathe "^2.0.3" + perfect-debounce "^2.0.0" + pkg-types "^2.3.0" + rc9 "^2.1.2" + cac@^6.7.14: version "6.7.14" resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" @@ -5104,6 +7192,11 @@ caniuse-lite@^1.0.30001580: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001581.tgz#0dfd4db9e94edbdca67d57348ebc070dece279f4" integrity sha512-whlTkwhqV2tUmP3oYhtNfaWGYHDdS3JYFQBKXxcUR9qqPWsRhFHhoISO2Xnl/g0xyKzht9mI1LZpiNWfMzHixQ== +caniuse-lite@^1.0.30001759, caniuse-lite@^1.0.30001760: + version "1.0.30001762" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001762.tgz#e4dbfeda63d33258cdde93e53af2023a13ba27d4" + integrity sha512-PxZwGNvH7Ak8WX5iXzoK1KPZttBXNPuaOvI2ZYU7NrlM+d9Ov+TUvlLOBNGzVXAntMSMMlJPd+jY6ovrVjSmUw== + canonical-path@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/canonical-path/-/canonical-path-1.0.0.tgz#fcb470c23958def85081856be7a86e904f180d1d" @@ -5144,6 +7237,11 @@ ccount@^1.0.0, ccount@^1.0.3: resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" integrity sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg== +ccount@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" + integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== + chai@^4.3.10: version "4.4.1" resolved "https://registry.yarnpkg.com/chai/-/chai-4.4.1.tgz#3603fa6eba35425b0f2ac91a009fe924106e50d1" @@ -5263,11 +7361,21 @@ character-entities-html4@^1.0.0: resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.4.tgz#0e64b0a3753ddbf1fdc044c5fd01d0199a02e125" integrity sha512-HRcDxZuZqMx3/a+qrzxdBKBPUpxWEq9xw2OPZ3a/174ihfrQKVsFhqtthBInFy1zZ9GgZyFXOatNujm8M+El3g== +character-entities-html4@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-2.1.0.tgz#1f1adb940c971a4b22ba39ddca6b618dc6e56b2b" + integrity sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA== + character-entities-legacy@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz#94bc1845dce70a5bb9d2ecc748725661293d8fc1" integrity sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA== +character-entities-legacy@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz#76bc83a90738901d7bc223a9e93759fdd560125b" + integrity sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ== + character-entities@^1.0.0: version "1.2.4" resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.4.tgz#e12c3939b7eaf4e5b15e7ad4c5e28e1d48c5b16b" @@ -5329,6 +7437,20 @@ chokidar@^2.1.8: optionalDependencies: fsevents "^1.2.7" +chokidar@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-4.0.3.tgz#7be37a4c03c9aee1ecfe862a4a23b2c70c205d30" + integrity sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA== + dependencies: + readdirp "^4.0.1" + +chokidar@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-5.0.0.tgz#949c126a9238a80792be9a0265934f098af369a5" + integrity sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw== + dependencies: + readdirp "^5.0.0" + chownr@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -5371,6 +7493,13 @@ circular-dependency-plugin@5.2.2: resolved "https://registry.yarnpkg.com/circular-dependency-plugin/-/circular-dependency-plugin-5.2.2.tgz#39e836079db1d3cf2f988dc48c5188a44058b600" integrity sha512-g38K9Cm5WRwlaH6g03B9OEz/0qRizI+2I7n+Gz+L5DxXJAPAiWQvwlYNm1V1jkdpUv95bOe/ASm2vfi/G560jQ== +citty@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/citty/-/citty-0.1.6.tgz#0f7904da1ed4625e1a9ea7e0fa780981aab7c5e4" + integrity sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ== + dependencies: + consola "^3.2.3" + cjson@^0.3.1: version "0.3.3" resolved "https://registry.yarnpkg.com/cjson/-/cjson-0.3.3.tgz#a92d9c786e5bf9b930806329ee05d5d3261b4afa" @@ -5528,6 +7657,11 @@ clone@^1.0.2: resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== +clone@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== + clonedeep@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/clonedeep/-/clonedeep-2.0.0.tgz#8ceca0777f477bbf31fe8c871aaf63a390bbc272" @@ -5641,6 +7775,11 @@ colorspace@1.1.x: color "^3.1.3" text-hex "1.0.x" +colortranslator@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/colortranslator/-/colortranslator-5.0.0.tgz#a7590fa56702c2be75e4fec755127cb658385583" + integrity sha512-Z3UPUKasUVDFCDYAjP2fmlVRf1jFHJv1izAmPjiOa0OCIw1W7iC8PZ2GsoDa8uZv+mKyWopxxStT9q05+27h7w== + columnify@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.6.0.tgz#6989531713c9008bb29735e61e37acf5bd553cf3" @@ -5661,7 +7800,12 @@ comma-separated-tokens@^1.0.0, comma-separated-tokens@^1.0.1: resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== -commander@7.2.0: +comma-separated-tokens@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee" + integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg== + +commander@7.2.0, commander@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== @@ -5788,6 +7932,16 @@ concurrently@^5.3.0: tree-kill "^1.2.2" yargs "^13.3.0" +confbox@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/confbox/-/confbox-0.1.8.tgz#820d73d3b3c82d9bd910652c5d4d599ef8ff8b06" + integrity sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w== + +confbox@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/confbox/-/confbox-0.2.2.tgz#8652f53961c74d9e081784beed78555974a9c110" + integrity sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ== + configstore@^3.0.0: version "3.1.5" resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.5.tgz#e9af331fadc14dabd544d3e7e76dc446a09a530f" @@ -5832,6 +7986,11 @@ connect@^3.6.2, connect@^3.7.0: parseurl "~1.3.3" utils-merge "1.0.1" +consola@^3.2.3, consola@^3.4.0, consola@^3.4.2: + version "3.4.2" + resolved "https://registry.yarnpkg.com/consola/-/consola-3.4.2.tgz#5af110145397bb67afdab77013fdc34cae590ea7" + integrity sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA== + console-control-strings@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -5872,6 +8031,11 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== +cookie-es@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/cookie-es/-/cookie-es-1.2.2.tgz#18ceef9eb513cac1cb6c14bcbf8bdb2679b34821" + integrity sha512-+W7VmiVINB+ywl1HGXJXmrqkOhpKrIiVZV6tQuV54ZyQC7MMuBt81Vc336GMLoHBq5hV/F9eXgt5Mnx0Rha5Fg== + cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" @@ -5899,6 +8063,13 @@ copy-anything@^2.0.1: dependencies: is-what "^3.14.1" +copy-anything@^4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/copy-anything/-/copy-anything-4.0.5.tgz#16cabafd1ea4bb327a540b750f2b4df522825aea" + integrity sha512-7Vv6asjS4gMOuILabD3l739tsaxFQmC+a7pLZm02zyvs8p977bL3zEgq3yDk5rn9B0PbYgIv++jmHcuUab4RhA== + dependencies: + is-what "^5.2.0" + copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" @@ -6030,6 +8201,11 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== +crelt@^1.0.0: + version "1.0.6" + resolved "https://registry.yarnpkg.com/crelt/-/crelt-1.0.6.tgz#7cc898ea74e190fb6ef9dae57f8f81cf7302df72" + integrity sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g== + critters@0.0.16: version "0.0.16" resolved "https://registry.yarnpkg.com/critters/-/critters-0.0.16.tgz#ffa2c5561a65b43c53b940036237ce72dcebfe93" @@ -6086,6 +8262,13 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" +crossws@^0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/crossws/-/crossws-0.3.5.tgz#daad331d44148ea6500098bc858869f3a5ab81a6" + integrity sha512-ojKiDvcmByhwa8YYqbQI/hg7MEU0NC03+pSdEq4ZUnZR9xXpwk7E43SMNGkn+JxJGPFtNvQ48+vV2p+P1ml5PA== + dependencies: + uncrypto "^0.1.3" + crypt@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" @@ -6165,6 +8348,17 @@ css-select@^4.2.0: domutils "^2.8.0" nth-check "^2.0.1" +css-select@^5.1.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-5.2.2.tgz#01b6e8d163637bb2dd6c982ca4ed65863682786e" + integrity sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw== + dependencies: + boolbase "^1.0.0" + css-what "^6.1.0" + domhandler "^5.0.2" + domutils "^3.0.1" + nth-check "^2.0.1" + css-selector-parser@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/css-selector-parser/-/css-selector-parser-1.4.1.tgz#03f9cb8a81c3e5ab2c51684557d5aaf6d2569759" @@ -6186,6 +8380,30 @@ css-tree@^1.1.2: mdn-data "2.0.14" source-map "^0.6.1" +css-tree@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-2.3.1.tgz#10264ce1e5442e8572fc82fbe490644ff54b5c20" + integrity sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw== + dependencies: + mdn-data "2.0.30" + source-map-js "^1.0.1" + +css-tree@^3.0.0, css-tree@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-3.1.0.tgz#7aabc035f4e66b5c86f54570d55e05b1346eb0fd" + integrity sha512-0eW44TGN5SQXU1mWSkKwFstI/22X2bG1nYzZTYMAWjylYURhse752YgbE4Cx46AC+bAvI+/dYTPRk1LqSUnu6w== + dependencies: + mdn-data "2.12.2" + source-map-js "^1.0.1" + +css-tree@~2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-2.2.1.tgz#36115d382d60afd271e377f9c5f67d02bd48c032" + integrity sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA== + dependencies: + mdn-data "2.0.28" + source-map-js "^1.0.1" + css-what@^3.2.1: version "3.4.2" resolved "https://registry.yarnpkg.com/css-what/-/css-what-3.4.2.tgz#ea7026fcb01777edbde52124e21f327e7ae950e4" @@ -6196,6 +8414,11 @@ css-what@^6.0.1: resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.1.0.tgz#fb5effcf76f1ddea2c81bdfaa4de44e79bac70f4" integrity sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw== +css-what@^6.1.0: + version "6.2.2" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-6.2.2.tgz#cdcc8f9b6977719fdfbd1de7aec24abf756b9dea" + integrity sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA== + css@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/css/-/css-3.0.0.tgz#4447a4d58fdd03367c516ca9f64ae365cee4aa5d" @@ -6222,6 +8445,13 @@ csso@^4.0.2: dependencies: css-tree "^1.1.2" +csso@^5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/csso/-/csso-5.0.5.tgz#f9b7fe6cc6ac0b7d90781bb16d5e9874303e2ca6" + integrity sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ== + dependencies: + css-tree "~2.2.0" + cssom@0.3.x, cssom@~0.3.6: version "0.3.8" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" @@ -6246,6 +8476,11 @@ cssstyle@^2.0.0: dependencies: cssom "~0.3.6" +csstype@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.2.3.tgz#ec48c0f3e993e50648c86da559e2610995cf989a" + integrity sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ== + csv-streamify@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/csv-streamify/-/csv-streamify-3.0.4.tgz#4cb614c57e3f299cca17b63fdcb4ad167777f47a" @@ -6356,6 +8591,13 @@ debug@^3.1.0, debug@^3.2.6, debug@^3.2.7: dependencies: ms "^2.1.1" +debug@^4.4.3: + version "4.4.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.3.tgz#c6ae432d9bd9662582fce08709b038c58e9e3d6a" + integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA== + dependencies: + ms "^2.1.3" + debug@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" @@ -6496,6 +8738,11 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" +defu@^6.1.4: + version "6.1.4" + resolved "https://registry.yarnpkg.com/defu/-/defu-6.1.4.tgz#4e0c9cf9ff68fe5f3d7f2765cc1a012dfdcb0479" + integrity sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg== + degenerator@^3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-3.0.4.tgz#07ccf95bc11044a37a6efc2f66029fb636e31f24" @@ -6592,11 +8839,31 @@ dependency-graph@^0.7.0: resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.7.2.tgz#91db9de6eb72699209d88aea4c1fd5221cac1c49" integrity sha512-KqtH4/EZdtdfWX0p6MGP9jljvxSY6msy/pRUD4jgNwVpv3v1QmNLlsB3LDSSUg79BRVSn7jI1QPRtArGABovAQ== +dequal@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" + integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== + +destr@^2.0.3, destr@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/destr/-/destr-2.0.5.tgz#7d112ff1b925fb8d2079fac5bdb4a90973b51fdb" + integrity sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA== + destroy@1.2.0, destroy@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== +detect-libc@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== + +detect-libc@^2.0.3: + version "2.1.2" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.1.2.tgz#689c5dcdc1900ef5583a4cb9f6d7b473742074ad" + integrity sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ== + detect-node@^2.0.4: version "2.1.0" resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" @@ -6610,6 +8877,18 @@ detect-port@^1.5.1: address "^1.0.1" debug "4" +devlop@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/devlop/-/devlop-1.1.0.tgz#4db7c2ca4dc6e0e834c30be70c94bbc976dc7018" + integrity sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA== + dependencies: + dequal "^2.0.0" + +dfa@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/dfa/-/dfa-1.2.0.tgz#96ac3204e2d29c49ea5b57af8d92c2ae12790657" + integrity sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q== + dgeni-packages@^0.30.0: version "0.30.0" resolved "https://registry.yarnpkg.com/dgeni-packages/-/dgeni-packages-0.30.0.tgz#7e8002ee154fed7bc97841222e0f25628cf2285d" @@ -6750,12 +9029,21 @@ dom-serializer@^1.0.1: domhandler "^4.2.0" entities "^2.0.0" +dom-serializer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-2.0.0.tgz#e41b802e1eedf9f6cae183ce5e622d789d7d8e53" + integrity sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg== + dependencies: + domelementtype "^2.3.0" + domhandler "^5.0.2" + entities "^4.2.0" + domelementtype@1, domelementtype@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== -domelementtype@^2.0.1, domelementtype@^2.2.0: +domelementtype@^2.0.1, domelementtype@^2.2.0, domelementtype@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== @@ -6781,6 +9069,13 @@ domhandler@^4.2.0, domhandler@^4.3.1: dependencies: domelementtype "^2.2.0" +domhandler@^5.0.2, domhandler@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-5.0.3.tgz#cc385f7f751f1d1fc650c21374804254538c7d31" + integrity sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w== + dependencies: + domelementtype "^2.3.0" + domutils@^1.5.1, domutils@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" @@ -6798,6 +9093,15 @@ domutils@^2.8.0: domelementtype "^2.2.0" domhandler "^4.2.0" +domutils@^3.0.1: + version "3.2.2" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.2.2.tgz#edbfe2b668b0c1d97c24baf0f1062b132221bc78" + integrity sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw== + dependencies: + dom-serializer "^2.0.0" + domelementtype "^2.3.0" + domhandler "^5.0.3" + dot-case@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-2.1.1.tgz#34dcf37f50a8e93c2b3bca8bb7fb9155c7da3bee" @@ -6824,6 +9128,11 @@ dotenv-expand@~10.0.0: resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-10.0.0.tgz#12605d00fb0af6d0a592e6558585784032e4ef37" integrity sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A== +dotenv@^17.2.3: + version "17.2.3" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-17.2.3.tgz#ad995d6997f639b11065f419a22fabf567cdb9a2" + integrity sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w== + dotenv@^6.1.0: version "6.2.0" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064" @@ -6939,6 +9248,66 @@ electron-to-chromium@^1.4.648: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.652.tgz#1591c7542d43c990de786374c07a9d6ad2b63787" integrity sha512-XvQaa8hVUAuEJtLw6VKQqvdOxTOfBLWfI10t2xWpezx4XXD3k8bdLweEKeItqaa0+OkJX5l0mP1W+JWobyIDrg== +electron-to-chromium@^1.5.263: + version "1.5.267" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz#5d84f2df8cdb6bfe7e873706bb21bd4bfb574dc7" + integrity sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw== + +embla-carousel-auto-height@^8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/embla-carousel-auto-height/-/embla-carousel-auto-height-8.6.0.tgz#89ea31e2119531b2a83884497a6307178e66b00c" + integrity sha512-/HrJQOEM6aol/oF33gd2QlINcXy3e19fJWvHDuHWp2bpyTa+2dm9tVVJak30m2Qy6QyQ6Fc8DkImtv7pxWOJUQ== + +embla-carousel-auto-scroll@^8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/embla-carousel-auto-scroll/-/embla-carousel-auto-scroll-8.6.0.tgz#02f648acd8b184a0f3ae0f2b38a983afc16a2648" + integrity sha512-WT9fWhNXFpbQ6kP+aS07oF5IHYLZ1Dx4DkwgCY8Hv2ZyYd2KMCPfMV1q/cA3wFGuLO7GMgKiySLX90/pQkcOdQ== + +embla-carousel-autoplay@^8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/embla-carousel-autoplay/-/embla-carousel-autoplay-8.6.0.tgz#bc86c97de00d52ec34b05058736ef50af6e0d0e4" + integrity sha512-OBu5G3nwaSXkZCo1A6LTaFMZ8EpkYbwIaH+bPqdBnDGQ2fh4+NbzjXjs2SktoPNKCtflfVMc75njaDHOYXcrsA== + +embla-carousel-class-names@^8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/embla-carousel-class-names/-/embla-carousel-class-names-8.6.0.tgz#2bdd057427c60d6281f5e2d11fca02ca60529939" + integrity sha512-l1hm1+7GxQ+zwdU2sea/LhD946on7XO2qk3Xq2XWSwBaWfdgchXdK567yzLtYSHn4sWYdiX+x4nnaj+saKnJkw== + +embla-carousel-fade@^8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/embla-carousel-fade/-/embla-carousel-fade-8.6.0.tgz#92d19ecd54441eb6f37910bf9e16fd3f547e3374" + integrity sha512-qaYsx5mwCz72ZrjlsXgs1nKejSrW+UhkbOMwLgfRT7w2LtdEB03nPRI06GHuHv5ac2USvbEiX2/nAHctcDwvpg== + +embla-carousel-reactive-utils@8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/embla-carousel-reactive-utils/-/embla-carousel-reactive-utils-8.6.0.tgz#607f1d8ab9921c906a555c206251b2c6db687223" + integrity sha512-fMVUDUEx0/uIEDM0Mz3dHznDhfX+znCCDCeIophYb1QGVM7YThSWX+wz11zlYwWFOr74b4QLGg0hrGPJeG2s4A== + +embla-carousel-vue@^8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/embla-carousel-vue/-/embla-carousel-vue-8.6.0.tgz#ef70e8f49c8a04e502a9b3de45ab6ecc8247f50b" + integrity sha512-v8UO5UsyLocZnu/LbfQA7Dn2QHuZKurJY93VUmZYP//QRWoCWOsionmvLLAlibkET3pGPs7++03VhJKbWD7vhQ== + dependencies: + embla-carousel "8.6.0" + embla-carousel-reactive-utils "8.6.0" + +embla-carousel-wheel-gestures@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/embla-carousel-wheel-gestures/-/embla-carousel-wheel-gestures-8.1.0.tgz#dfdb865f634058723c46539bdde45248673a43a5" + integrity sha512-J68jkYrxbWDmXOm2n2YHl+uMEXzkGSKjWmjaEgL9xVvPb3HqVmg6rJSKfI3sqIDVvm7mkeTy87wtG/5263XqHQ== + dependencies: + wheel-gestures "^2.2.5" + +embla-carousel@8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/embla-carousel/-/embla-carousel-8.6.0.tgz#abcedff2bff36992ea8ac27cd30080ca5b6a3f58" + integrity sha512-SjWyZBHJPbqxHOzckOfo8lHisEaJWmwd23XppYFYVh10bU66/Pn5tkVkbkCMZVdbUE5eTCI2nD8OyIP4Z+uwkA== + +emoji-regex-xs@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex-xs/-/emoji-regex-xs-1.0.0.tgz#e8af22e5d9dbd7f7f22d280af3d19d2aab5b0724" + integrity sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg== + emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" @@ -7012,6 +9381,14 @@ enhanced-resolve@5.1.0: graceful-fs "^4.2.4" tapable "^2.0.0" +enhanced-resolve@^5.18.3: + version "5.18.4" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.4.tgz#c22d33055f3952035ce6a144ce092447c525f828" + integrity sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + enhanced-resolve@^5.7.0, enhanced-resolve@^5.8.3: version "5.15.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz#1af946c7d93603eb88e9896cee4904dc012e9c35" @@ -7050,6 +9427,16 @@ entities@^2.0.0: resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== +entities@^4.2.0, entities@^4.4.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + +entities@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-7.0.0.tgz#2ae4e443f3f17d152d3f5b0f79b932c1e59deb7a" + integrity sha512-FDWG5cmEYf2Z00IkYRhbFrwIwvdFKH07uV8dvNy0omp/Qb1xcyCWp2UDtcwJF4QZZvk0sLudP6/hAu42TaqVhQ== + env-paths@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" @@ -7079,6 +9466,11 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +errx@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/errx/-/errx-0.1.0.tgz#4881e411d90a3b1e1620a07604f50081dd59f3aa" + integrity sha512-fZmsRiDNv07K6s2KkKFTiD2aIvECa7++PKyD5NC32tpRw46qZA3sOz+aM+/V9V0GDHxVTKLziveV4JhzBHDp9Q== + es-abstract@^1.17.2, es-abstract@^1.22.1: version "1.22.3" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.3.tgz#48e79f5573198de6dee3589195727f4f74bc4f32" @@ -7355,11 +9747,109 @@ esbuild@^0.19.3: "@esbuild/win32-ia32" "0.19.11" "@esbuild/win32-x64" "0.19.11" +esbuild@^0.21.3: + version "0.21.5" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.21.5.tgz#9ca301b120922959b766360d8ac830da0d02997d" + integrity sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw== + optionalDependencies: + "@esbuild/aix-ppc64" "0.21.5" + "@esbuild/android-arm" "0.21.5" + "@esbuild/android-arm64" "0.21.5" + "@esbuild/android-x64" "0.21.5" + "@esbuild/darwin-arm64" "0.21.5" + "@esbuild/darwin-x64" "0.21.5" + "@esbuild/freebsd-arm64" "0.21.5" + "@esbuild/freebsd-x64" "0.21.5" + "@esbuild/linux-arm" "0.21.5" + "@esbuild/linux-arm64" "0.21.5" + "@esbuild/linux-ia32" "0.21.5" + "@esbuild/linux-loong64" "0.21.5" + "@esbuild/linux-mips64el" "0.21.5" + "@esbuild/linux-ppc64" "0.21.5" + "@esbuild/linux-riscv64" "0.21.5" + "@esbuild/linux-s390x" "0.21.5" + "@esbuild/linux-x64" "0.21.5" + "@esbuild/netbsd-x64" "0.21.5" + "@esbuild/openbsd-x64" "0.21.5" + "@esbuild/sunos-x64" "0.21.5" + "@esbuild/win32-arm64" "0.21.5" + "@esbuild/win32-ia32" "0.21.5" + "@esbuild/win32-x64" "0.21.5" + +esbuild@^0.25.12: + version "0.25.12" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.25.12.tgz#97a1d041f4ab00c2fce2f838d2b9969a2d2a97a5" + integrity sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg== + optionalDependencies: + "@esbuild/aix-ppc64" "0.25.12" + "@esbuild/android-arm" "0.25.12" + "@esbuild/android-arm64" "0.25.12" + "@esbuild/android-x64" "0.25.12" + "@esbuild/darwin-arm64" "0.25.12" + "@esbuild/darwin-x64" "0.25.12" + "@esbuild/freebsd-arm64" "0.25.12" + "@esbuild/freebsd-x64" "0.25.12" + "@esbuild/linux-arm" "0.25.12" + "@esbuild/linux-arm64" "0.25.12" + "@esbuild/linux-ia32" "0.25.12" + "@esbuild/linux-loong64" "0.25.12" + "@esbuild/linux-mips64el" "0.25.12" + "@esbuild/linux-ppc64" "0.25.12" + "@esbuild/linux-riscv64" "0.25.12" + "@esbuild/linux-s390x" "0.25.12" + "@esbuild/linux-x64" "0.25.12" + "@esbuild/netbsd-arm64" "0.25.12" + "@esbuild/netbsd-x64" "0.25.12" + "@esbuild/openbsd-arm64" "0.25.12" + "@esbuild/openbsd-x64" "0.25.12" + "@esbuild/openharmony-arm64" "0.25.12" + "@esbuild/sunos-x64" "0.25.12" + "@esbuild/win32-arm64" "0.25.12" + "@esbuild/win32-ia32" "0.25.12" + "@esbuild/win32-x64" "0.25.12" + +esbuild@~0.27.0: + version "0.27.2" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.27.2.tgz#d83ed2154d5813a5367376bb2292a9296fc83717" + integrity sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw== + optionalDependencies: + "@esbuild/aix-ppc64" "0.27.2" + "@esbuild/android-arm" "0.27.2" + "@esbuild/android-arm64" "0.27.2" + "@esbuild/android-x64" "0.27.2" + "@esbuild/darwin-arm64" "0.27.2" + "@esbuild/darwin-x64" "0.27.2" + "@esbuild/freebsd-arm64" "0.27.2" + "@esbuild/freebsd-x64" "0.27.2" + "@esbuild/linux-arm" "0.27.2" + "@esbuild/linux-arm64" "0.27.2" + "@esbuild/linux-ia32" "0.27.2" + "@esbuild/linux-loong64" "0.27.2" + "@esbuild/linux-mips64el" "0.27.2" + "@esbuild/linux-ppc64" "0.27.2" + "@esbuild/linux-riscv64" "0.27.2" + "@esbuild/linux-s390x" "0.27.2" + "@esbuild/linux-x64" "0.27.2" + "@esbuild/netbsd-arm64" "0.27.2" + "@esbuild/netbsd-x64" "0.27.2" + "@esbuild/openbsd-arm64" "0.27.2" + "@esbuild/openbsd-x64" "0.27.2" + "@esbuild/openharmony-arm64" "0.27.2" + "@esbuild/sunos-x64" "0.27.2" + "@esbuild/win32-arm64" "0.27.2" + "@esbuild/win32-ia32" "0.27.2" + "@esbuild/win32-x64" "0.27.2" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== +escalade@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== + escape-goat@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675" @@ -7380,6 +9870,11 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== +escape-string-regexp@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8" + integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw== + escodegen@^1.11.1, escodegen@^1.8.1: version "1.14.3" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" @@ -7585,6 +10080,11 @@ estraverse@^5.1.0, estraverse@^5.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== +estree-walker@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + estree-walker@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-3.0.3.tgz#67c3e549ec402a487b4fc193d1953a524752340d" @@ -7805,6 +10305,11 @@ express@^4.16.4, express@^4.17.1: utils-merge "1.0.1" vary "~1.1.2" +exsolve@^1.0.7, exsolve@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/exsolve/-/exsolve-1.0.8.tgz#7f5e34da61cd1116deda5136e62292c096f50613" + integrity sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA== + ext@^1.1.2: version "1.7.0" resolved "https://registry.yarnpkg.com/ext/-/ext-1.7.0.tgz#0ea4383c0103d60e70be99e9a7f11027a33c4f5f" @@ -7970,6 +10475,11 @@ faye-websocket@^0.11.3: dependencies: websocket-driver ">=0.5.1" +fdir@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350" + integrity sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg== + fecha@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.3.tgz#4d9ccdbc61e8629b259fdca67e65891448d569fd" @@ -8035,6 +10545,13 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + finalhandler@1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" @@ -8216,6 +10733,13 @@ fn.name@1.x.x: resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== +focus-trap@^7.6.4: + version "7.7.0" + resolved "https://registry.yarnpkg.com/focus-trap/-/focus-trap-7.7.0.tgz#277a8be672a23befc939461c6dab3d7b5a285b96" + integrity sha512-DJJDHpEgoSbP8ZE1MNeU2IzCpfFyFdNZZRilqmfH2XiQsPK6PtD8AfJqWzEBudUQB2yHwZc5iq54rjTaGQ+ljw== + dependencies: + tabbable "^6.3.0" + follow-redirects@^1.0.0, follow-redirects@^1.15.0: version "1.15.3" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" @@ -8226,6 +10750,53 @@ follow-redirects@^1.15.4: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020" integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw== +fontaine@0.7.0, fontaine@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/fontaine/-/fontaine-0.7.0.tgz#3b2ea6cefff86a202dc7cabd73abc3adb8b7a376" + integrity sha512-vlaWLyoJrOnCBqycmFo/CA8ZmPzuyJHYmgu261KYKByZ4YLz9sTyHZ4qoHgWSYiDsZXhiLo2XndVMz0WOAyZ8Q== + dependencies: + "@capsizecss/unpack" "^3.0.0" + css-tree "^3.1.0" + magic-regexp "^0.10.0" + magic-string "^0.30.21" + pathe "^2.0.3" + ufo "^1.6.1" + unplugin "^2.3.10" + +fontkit@^2.0.2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/fontkit/-/fontkit-2.0.4.tgz#4765d664c68b49b5d6feb6bd1051ee49d8ec5ab0" + integrity sha512-syetQadaUEDNdxdugga9CpEYVaQIxOwk7GlwZWWZ19//qW4zE5bknOKeMBDYAASwnpaSHKJITRLMF9m1fp3s6g== + dependencies: + "@swc/helpers" "^0.5.12" + brotli "^1.3.2" + clone "^2.1.2" + dfa "^1.2.0" + fast-deep-equal "^3.1.3" + restructure "^3.0.0" + tiny-inflate "^1.0.3" + unicode-properties "^1.4.0" + unicode-trie "^2.0.0" + +fontless@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/fontless/-/fontless-0.1.0.tgz#306f498f5000db5393a973e17137a7e0d026f018" + integrity sha512-KyvRd732HuVd/XP9iEFTb1w8Q01TPSA5GaCJV9HYmPiEs/ZZg/on2YdrQmlKfi9gDGpmN5Bn27Ze/CHqk0vE+w== + dependencies: + consola "^3.4.2" + css-tree "^3.1.0" + defu "^6.1.4" + esbuild "^0.25.12" + fontaine "0.7.0" + jiti "^2.6.1" + lightningcss "^1.30.2" + magic-string "^0.30.21" + ohash "^2.0.11" + pathe "^2.0.3" + ufo "^1.6.1" + unifont "^0.6.0" + unstorage "^1.17.1" + for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -8288,6 +10859,11 @@ fraction.js@^4.3.6: resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-4.3.7.tgz#06ca0085157e42fda7f9e726e79fefc4068840f7" integrity sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew== +fraction.js@^5.3.4: + version "5.3.4" + resolved "https://registry.yarnpkg.com/fraction.js/-/fraction.js-5.3.4.tgz#8c0fcc6a9908262df4ed197427bdeef563e0699a" + integrity sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ== + fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" @@ -8295,6 +10871,15 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" +framer-motion@12.23.12: + version "12.23.12" + resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-12.23.12.tgz#80cf6fd7c111073a0c558e336c85ca36cca80d3d" + integrity sha512-6e78rdVtnBvlEVgu6eFEAgG9v3wLnYEboM8I5O5EXvfKC8gxGQB8wXJdhkMy10iVcn05jl6CNw7/HTsTCfwcWg== + dependencies: + motion-dom "^12.23.12" + motion-utils "^12.23.6" + tslib "^2.4.0" + fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" @@ -8429,6 +11014,11 @@ functions-have-names@^1.2.3: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== +fuse.js@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-7.1.0.tgz#306228b4befeee11e05b027087c2744158527d09" + integrity sha512-trLf4SzuuUxfusZADLINj+dE8clK1frKdmqiJNb1Es75fmI5oY6X2mxLVUciLLjxqw/xr72Dhy+lER6dGd02FQ== + gauge@^4.0.3: version "4.0.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-4.0.4.tgz#52ff0652f2bbf607a989793d53b751bef2328dce" @@ -8534,6 +11124,13 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" +get-tsconfig@^4.7.5: + version "4.13.0" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.13.0.tgz#fcdd991e6d22ab9a600f00e91c318707a5d9a0d7" + integrity sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ== + dependencies: + resolve-pkg-maps "^1.0.0" + get-uri@3: version "3.0.2" resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-3.0.2.tgz#f0ef1356faabc70e1f9404fa3b66b2ba9bfc725c" @@ -8558,6 +11155,18 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +giget@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/giget/-/giget-2.0.0.tgz#395fc934a43f9a7a29a29d55b99f23e30c14f195" + integrity sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA== + dependencies: + citty "^0.1.6" + consola "^3.4.0" + defu "^6.1.4" + node-fetch-native "^1.6.6" + nypm "^0.6.0" + pathe "^2.0.3" + github-slugger@^1.1.1: version "1.5.0" resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.5.0.tgz#17891bbc73232051474d68bd867a34625c955f7d" @@ -8885,6 +11494,21 @@ gtoken@^5.0.4: google-p12-pem "^3.1.3" jws "^4.0.0" +h3@^1.15.4: + version "1.15.4" + resolved "https://registry.yarnpkg.com/h3/-/h3-1.15.4.tgz#022ab3563bbaf2108c25375c40460f3e54a5fe02" + integrity sha512-z5cFQWDffyOe4vQ9xIqNfCZdV4p//vy6fBnr8Q1AWnVZ0teurKMG66rLj++TKwKPUP3u7iMUvrvKaEUiQw2QWQ== + dependencies: + cookie-es "^1.2.2" + crossws "^0.3.5" + defu "^6.1.4" + destr "^2.0.5" + iron-webcrypto "^1.2.1" + node-mock-http "^1.0.2" + radix3 "^1.1.2" + ufo "^1.6.1" + uncrypto "^0.1.3" + handle-thing@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e" @@ -9091,6 +11715,23 @@ hast-util-to-html@^7.0.0: unist-util-is "^4.0.0" xtend "^4.0.0" +hast-util-to-html@^9.0.4: + version "9.0.5" + resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz#ccc673a55bb8e85775b08ac28380f72d47167005" + integrity sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw== + dependencies: + "@types/hast" "^3.0.0" + "@types/unist" "^3.0.0" + ccount "^2.0.0" + comma-separated-tokens "^2.0.0" + hast-util-whitespace "^3.0.0" + html-void-elements "^3.0.0" + mdast-util-to-hast "^13.0.0" + property-information "^7.0.0" + space-separated-tokens "^2.0.0" + stringify-entities "^4.0.0" + zwitch "^2.0.4" + hast-util-to-string@^1.0.0, hast-util-to-string@^1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/hast-util-to-string/-/hast-util-to-string-1.0.4.tgz#9b24c114866bdb9478927d7e9c36a485ac728378" @@ -9101,6 +11742,13 @@ hast-util-whitespace@^1.0.0: resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-1.0.4.tgz#e4fe77c4a9ae1cb2e6c25e02df0043d0164f6e41" integrity sha512-I5GTdSfhYfAPNztx2xJRQpG8cuDSNt599/7YUn7Gx/WxNMsG+a835k97TDkFgk123cwjfwINaZknkKkphx/f2A== +hast-util-whitespace@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz#7778ed9d3c92dd9e8c5c8f648a49c21fc51cb621" + integrity sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw== + dependencies: + "@types/hast" "^3.0.0" + hastscript@^5.0.0: version "5.1.2" resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-5.1.2.tgz#bde2c2e56d04c62dd24e8c5df288d050a355fb8a" @@ -9149,11 +11797,21 @@ header-case@^1.0.0: no-case "^2.2.0" upper-case "^1.1.3" +hey-listen@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/hey-listen/-/hey-listen-1.0.8.tgz#8e59561ff724908de1aa924ed6ecc84a56a9aa68" + integrity sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q== + home-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/home-dir/-/home-dir-1.0.0.tgz#2917eb44bdc9072ceda942579543847e3017fe4e" integrity sha512-PPAP0BMY72XQ0sYwFow8EgHwUYfptkZusnZEGHkBjdKRXIYcVFsbEViqU4k8VrJWf0m7wMr9gscQX9klJYh7zg== +hookable@^5.5.3: + version "5.5.3" + resolved "https://registry.yarnpkg.com/hookable/-/hookable-5.5.3.tgz#6cfc358984a1ef991e2518cb9ed4a778bbd3215d" + integrity sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ== + hosted-git-info@^2.1.4: version "2.8.9" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" @@ -9205,6 +11863,11 @@ html-void-elements@^1.0.0: resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.5.tgz#ce9159494e86d95e45795b166c2021c2cfca4483" integrity sha512-uE/TxKuyNIcx44cIWnjr/rfIATDH7ZaOMmstu0CwhFG1Dunhlp4OC6/NMbhiwoq5BpW0ubi303qnEk/PZj614w== +html-void-elements@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-3.0.0.tgz#fc9dbd84af9e747249034d4d62602def6517f1d7" + integrity sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg== + html@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/html/-/html-1.0.0.tgz#a544fa9ea5492bfb3a2cca8210a10be7b5af1f61" @@ -9457,6 +12120,11 @@ ignore@^5.0.4, ignore@^5.1.2, ignore@^5.1.9, ignore@^5.2.0, ignore@^5.2.4: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== +ignore@^7.0.5: + version "7.0.5" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-7.0.5.tgz#4cb5f6cd7d4c7ab0365738c7aea888baa6d7efd9" + integrity sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg== + ignorefs@^1.1.1: version "1.4.1" resolved "https://registry.yarnpkg.com/ignorefs/-/ignorefs-1.4.1.tgz#fac9be8777e1999d5179eb1546d36ac5c8099503" @@ -9687,6 +12355,11 @@ ipaddr.js@^2.0.1: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.1.0.tgz#2119bc447ff8c257753b196fc5f1ce08a4cdf39f" integrity sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ== +iron-webcrypto@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/iron-webcrypto/-/iron-webcrypto-1.2.1.tgz#aa60ff2aa10550630f4c0b11fd2442becdb35a6f" + integrity sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg== + is-accessor-descriptor@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz#3223b10628354644b86260db29b3e693f5ceedd4" @@ -10148,6 +12821,11 @@ is-what@^3.14.1: resolved "https://registry.yarnpkg.com/is-what/-/is-what-3.14.1.tgz#e1222f46ddda85dead0fd1c9df131760e77755c1" integrity sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA== +is-what@^5.2.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/is-what/-/is-what-5.5.0.tgz#a3031815757cfe1f03fed990bf6355a2d3f628c4" + integrity sha512-oG7cgbmg5kLYae2N5IVd3jm2s+vldjxJzK1pcu9LfpGuQ93MQSzo0okvRna+7y5ifrD+20FE8FvjusyGaz14fw== + is-whitespace-character@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.4.tgz#0858edd94a95594c7c9dd0b5c174ec6e45ee4aa7" @@ -10391,6 +13069,11 @@ jest-worker@^27.4.5: merge-stream "^2.0.0" supports-color "^8.0.0" +jiti@^2.4.2, jiti@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/jiti/-/jiti-2.6.1.tgz#178ef2fc9a1a594248c20627cd820187a4d78d92" + integrity sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ== + jju@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/jju/-/jju-1.4.0.tgz#a3abe2718af241a2b2904f84a625970f389ae32a" @@ -10420,6 +13103,11 @@ js-tokens@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== +js-tokens@^9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-9.0.1.tgz#2ec43964658435296f6761b34e10671c2d9527f4" + integrity sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ== + js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" @@ -10795,11 +13483,16 @@ kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== -klona@^2.0.4, klona@^2.0.5: +klona@^2.0.4, klona@^2.0.5, klona@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.6.tgz#85bffbf819c03b2f53270412420a4555ef882e22" integrity sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA== +knitwork@^1.2.0, knitwork@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/knitwork/-/knitwork-1.3.0.tgz#4a0d0b0d45378cac909ee1117481392522bd08a4" + integrity sha512-4LqMNoONzR43B1W0ek0fhXMsDNW/zxa1NdFAVMY+k28pgZLovR4G3PB5MrpTxCy1QaZCqNoiaKPr5w5qZHfSNw== + kuler@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3" @@ -10936,6 +13629,80 @@ lighthouse@^7.0.1: yargs "^16.1.1" yargs-parser "^20.2.4" +lightningcss-android-arm64@1.30.2: + version "1.30.2" + resolved "https://registry.yarnpkg.com/lightningcss-android-arm64/-/lightningcss-android-arm64-1.30.2.tgz#6966b7024d39c94994008b548b71ab360eb3a307" + integrity sha512-BH9sEdOCahSgmkVhBLeU7Hc9DWeZ1Eb6wNS6Da8igvUwAe0sqROHddIlvU06q3WyXVEOYDZ6ykBZQnjTbmo4+A== + +lightningcss-darwin-arm64@1.30.2: + version "1.30.2" + resolved "https://registry.yarnpkg.com/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.2.tgz#a5fa946d27c029e48c7ff929e6e724a7de46eb2c" + integrity sha512-ylTcDJBN3Hp21TdhRT5zBOIi73P6/W0qwvlFEk22fkdXchtNTOU4Qc37SkzV+EKYxLouZ6M4LG9NfZ1qkhhBWA== + +lightningcss-darwin-x64@1.30.2: + version "1.30.2" + resolved "https://registry.yarnpkg.com/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.30.2.tgz#5ce87e9cd7c4f2dcc1b713f5e8ee185c88d9b7cd" + integrity sha512-oBZgKchomuDYxr7ilwLcyms6BCyLn0z8J0+ZZmfpjwg9fRVZIR5/GMXd7r9RH94iDhld3UmSjBM6nXWM2TfZTQ== + +lightningcss-freebsd-x64@1.30.2: + version "1.30.2" + resolved "https://registry.yarnpkg.com/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.30.2.tgz#6ae1d5e773c97961df5cff57b851807ef33692a5" + integrity sha512-c2bH6xTrf4BDpK8MoGG4Bd6zAMZDAXS569UxCAGcA7IKbHNMlhGQ89eRmvpIUGfKWNVdbhSbkQaWhEoMGmGslA== + +lightningcss-linux-arm-gnueabihf@1.30.2: + version "1.30.2" + resolved "https://registry.yarnpkg.com/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.30.2.tgz#62c489610c0424151a6121fa99d77731536cdaeb" + integrity sha512-eVdpxh4wYcm0PofJIZVuYuLiqBIakQ9uFZmipf6LF/HRj5Bgm0eb3qL/mr1smyXIS1twwOxNWndd8z0E374hiA== + +lightningcss-linux-arm64-gnu@1.30.2: + version "1.30.2" + resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.30.2.tgz#2a3661b56fe95a0cafae90be026fe0590d089298" + integrity sha512-UK65WJAbwIJbiBFXpxrbTNArtfuznvxAJw4Q2ZGlU8kPeDIWEX1dg3rn2veBVUylA2Ezg89ktszWbaQnxD/e3A== + +lightningcss-linux-arm64-musl@1.30.2: + version "1.30.2" + resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.30.2.tgz#d7ddd6b26959245e026bc1ad9eb6aa983aa90e6b" + integrity sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA== + +lightningcss-linux-x64-gnu@1.30.2: + version "1.30.2" + resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.2.tgz#5a89814c8e63213a5965c3d166dff83c36152b1a" + integrity sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w== + +lightningcss-linux-x64-musl@1.30.2: + version "1.30.2" + resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.2.tgz#808c2e91ce0bf5d0af0e867c6152e5378c049728" + integrity sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA== + +lightningcss-win32-arm64-msvc@1.30.2: + version "1.30.2" + resolved "https://registry.yarnpkg.com/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.30.2.tgz#ab4a8a8a2e6a82a4531e8bbb6bf0ff161ee6625a" + integrity sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ== + +lightningcss-win32-x64-msvc@1.30.2: + version "1.30.2" + resolved "https://registry.yarnpkg.com/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.2.tgz#f01f382c8e0a27e1c018b0bee316d210eac43b6e" + integrity sha512-5g1yc73p+iAkid5phb4oVFMB45417DkRevRbt/El/gKXJk4jid+vPFF/AXbxn05Aky8PapwzZrdJShv5C0avjw== + +lightningcss@1.30.2, lightningcss@^1.30.2: + version "1.30.2" + resolved "https://registry.yarnpkg.com/lightningcss/-/lightningcss-1.30.2.tgz#4ade295f25d140f487d37256f4cd40dc607696d0" + integrity sha512-utfs7Pr5uJyyvDETitgsaqSyjCb2qNRAtuqUeWIAKztsOYdcACf2KtARYXg2pSvhkt+9NfoaNY7fxjl6nuMjIQ== + dependencies: + detect-libc "^2.0.3" + optionalDependencies: + lightningcss-android-arm64 "1.30.2" + lightningcss-darwin-arm64 "1.30.2" + lightningcss-darwin-x64 "1.30.2" + lightningcss-freebsd-x64 "1.30.2" + lightningcss-linux-arm-gnueabihf "1.30.2" + lightningcss-linux-arm64-gnu "1.30.2" + lightningcss-linux-arm64-musl "1.30.2" + lightningcss-linux-x64-gnu "1.30.2" + lightningcss-linux-x64-musl "1.30.2" + lightningcss-win32-arm64-msvc "1.30.2" + lightningcss-win32-x64-msvc "1.30.2" + lines-and-columns@^1.1.6: version "1.2.4" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" @@ -10946,6 +13713,18 @@ lines-and-columns@~2.0.3: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-2.0.4.tgz#d00318855905d2660d8c0822e3f5a4715855fc42" integrity sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A== +linkify-it@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-5.0.0.tgz#9ef238bfa6dc70bd8e7f9572b52d369af569b421" + integrity sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ== + dependencies: + uc.micro "^2.0.0" + +linkifyjs@^4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/linkifyjs/-/linkifyjs-4.3.2.tgz#d97eb45419aabf97ceb4b05a7adeb7b8c8ade2b1" + integrity sha512-NT1CJtq3hHIreOianA8aSXn6Cw0JzYOuDQbOrSPe7gqFnCpKP++MQe3ODgO3oh2GJFORkAAdqredOa60z63GbA== + lint-staged@^10.2.11: version "10.5.4" resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.5.4.tgz#cd153b5f0987d2371fc1d2847a409a2fe705b665" @@ -11032,6 +13811,15 @@ local-pkg@^0.5.0: mlly "^1.4.2" pkg-types "^1.0.3" +local-pkg@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-1.1.2.tgz#c03d208787126445303f8161619dc701afa4abb5" + integrity sha512-arhlxbFRmoQHl33a0Zkle/YWlmNwoyt6QNZEIJcqNbdrsix5Lvc4HyyI3EnwxTYlZYc32EbYrQ8SzEZ7dqgg9A== + dependencies: + mlly "^1.7.4" + pkg-types "^2.3.0" + quansync "^0.2.11" + locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" @@ -11346,6 +14134,11 @@ lru-cache@^10.0.1, "lru-cache@^9.1.1 || ^10.0.0": resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.1.0.tgz#2098d41c2dc56500e6c88584aa656c84de7d0484" integrity sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag== +lru-cache@^10.4.3: + version "10.4.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" + integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== + lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" @@ -11380,11 +14173,24 @@ lru-queue@^0.1.0: dependencies: es5-ext "~0.10.2" -lunr@^2.1.0: +lunr@^2.1.0, lunr@^2.3.9: version "2.3.9" resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== +magic-regexp@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/magic-regexp/-/magic-regexp-0.10.0.tgz#78b4421a50d2b7a67129bf2c424a333927c3a0e5" + integrity sha512-Uly1Bu4lO1hwHUW0CQeSWuRtzCMNO00CmXtS8N6fyvB3B979GOEEeAkiTUDsmbYLAbvpUS/Kt5c4ibosAzVyVg== + dependencies: + estree-walker "^3.0.3" + magic-string "^0.30.12" + mlly "^1.7.2" + regexp-tree "^0.1.27" + type-level-regexp "~0.1.17" + ufo "^1.5.4" + unplugin "^2.0.0" + magic-string@0.25.7: version "0.25.7" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" @@ -11399,6 +14205,13 @@ magic-string@^0.26.0: dependencies: sourcemap-codec "^1.4.8" +magic-string@^0.30.12, magic-string@^0.30.19, magic-string@^0.30.21: + version "0.30.21" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.21.tgz#56763ec09a0fa8091df27879fd94d19078c00d91" + integrity sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ== + dependencies: + "@jridgewell/sourcemap-codec" "^1.5.5" + magic-string@^0.30.5: version "0.30.5" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.5.tgz#1994d980bd1c8835dc6e78db7cbd4ae4f24746f9" @@ -11518,11 +14331,28 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" +mark.js@8.11.1: + version "8.11.1" + resolved "https://registry.yarnpkg.com/mark.js/-/mark.js-8.11.1.tgz#180f1f9ebef8b0e638e4166ad52db879beb2ffc5" + integrity sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ== + markdown-escapes@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg== +markdown-it@^14.0.0, markdown-it@^14.1.0: + version "14.1.0" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-14.1.0.tgz#3c3c5992883c633db4714ccb4d7b5935d98b7d45" + integrity sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg== + dependencies: + argparse "^2.0.1" + entities "^4.4.0" + linkify-it "^5.0.0" + mdurl "^2.0.0" + punycode.js "^2.3.1" + uc.micro "^2.1.0" + markdown-table@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-2.0.0.tgz#194a90ced26d31fe753d8b9434430214c011865b" @@ -11547,6 +14377,11 @@ marked@^0.7.0: resolved "https://registry.yarnpkg.com/marked/-/marked-0.7.0.tgz#b64201f051d271b1edc10a04d1ae9b74bb8e5c0e" integrity sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg== +marked@^15.0.12: + version "15.0.12" + resolved "https://registry.yarnpkg.com/marked/-/marked-15.0.12.tgz#30722c7346e12d0a2d0207ab9b0c4f0102d86c4e" + integrity sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA== + marky@^1.2.2: version "1.2.5" resolved "https://registry.yarnpkg.com/marky/-/marky-1.2.5.tgz#55796b688cbd72390d2d399eaaf1832c9413e3c0" @@ -11589,21 +14424,56 @@ mdast-util-to-hast@^10.0.0: unist-util-position "^3.0.0" unist-util-visit "^2.0.0" +mdast-util-to-hast@^13.0.0: + version "13.2.1" + resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz#d7ff84ca499a57e2c060ae67548ad950e689a053" + integrity sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA== + dependencies: + "@types/hast" "^3.0.0" + "@types/mdast" "^4.0.0" + "@ungap/structured-clone" "^1.0.0" + devlop "^1.0.0" + micromark-util-sanitize-uri "^2.0.0" + trim-lines "^3.0.0" + unist-util-position "^5.0.0" + unist-util-visit "^5.0.0" + vfile "^6.0.0" + mdn-data@2.0.14: version "2.0.14" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow== +mdn-data@2.0.28: + version "2.0.28" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.28.tgz#5ec48e7bef120654539069e1ae4ddc81ca490eba" + integrity sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g== + +mdn-data@2.0.30: + version "2.0.30" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.30.tgz#ce4df6f80af6cfbe218ecd5c552ba13c4dfa08cc" + integrity sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA== + mdn-data@2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== +mdn-data@2.12.2: + version "2.12.2" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.12.2.tgz#9ae6c41a9e65adf61318b32bff7b64fbfb13f8cf" + integrity sha512-IEn+pegP1aManZuckezWCO+XZQDplx1366JoVhTpMpBB1sPey/SbveZQUosKiKiGYjg1wH4pMlNgXbCiYgihQA== + mdurl@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== +mdurl@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-2.0.0.tgz#80676ec0433025dd3e17ee983d0fe8de5a2237e0" + integrity sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w== + media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -11660,6 +14530,38 @@ methods@~1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== +micromark-util-character@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-2.1.1.tgz#2f987831a40d4c510ac261e89852c4e9703ccda6" + integrity sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q== + dependencies: + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-encode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz#0d51d1c095551cfaac368326963cf55f15f540b8" + integrity sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw== + +micromark-util-sanitize-uri@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz#ab89789b818a58752b73d6b55238621b7faa8fd7" + integrity sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-encode "^2.0.0" + micromark-util-symbol "^2.0.0" + +micromark-util-symbol@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz#e5da494e8eb2b071a0d08fb34f6cefec6c0a19b8" + integrity sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q== + +micromark-util-types@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-2.0.2.tgz#f00225f5f5a0ebc3254f96c36b6605c4b393908e" + integrity sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA== + micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -11687,6 +14589,14 @@ micromatch@^4.0.2, micromatch@^4.0.4: braces "^3.0.2" picomatch "^2.3.1" +micromatch@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== + dependencies: + braces "^3.0.3" + picomatch "^2.3.1" + mime-db@1.52.0, "mime-db@>= 1.43.0 < 2": version "1.52.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" @@ -11783,6 +14693,13 @@ minimatch@^5.0.1, minimatch@^5.1.0: dependencies: brace-expansion "^2.0.1" +minimatch@^9.0.5: + version "9.0.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" + integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.1.0, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5, minimist@^1.2.6: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" @@ -11889,6 +14806,11 @@ minipass@^5.0.0: resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.4.tgz#dbce03740f50a4786ba994c1fb908844d27b038c" integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ== +minisearch@^7.1.1: + version "7.2.0" + resolved "https://registry.yarnpkg.com/minisearch/-/minisearch-7.2.0.tgz#3dc30e41e9464b3836553b6d969b656614f8f359" + integrity sha512-dqT2XBYUOZOiC5t2HRnwADjhNS2cecp9u+TJRiJ1Qp/f5qjkeT5APcGPjHw+bz89Ms8Jp+cG4AlE+QZ/QnDglg== + minizlib@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" @@ -11904,6 +14826,11 @@ minizlib@^2.0.0, minizlib@^2.1.1, minizlib@^2.1.2: minipass "^3.0.0" yallist "^4.0.0" +mitt@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/mitt/-/mitt-3.0.1.tgz#ea36cf0cc30403601ae074c8f77b7092cdab36d1" + integrity sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw== + mixin-deep@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" @@ -11939,6 +14866,16 @@ mlly@^1.2.0, mlly@^1.4.2: pkg-types "^1.0.3" ufo "^1.3.2" +mlly@^1.7.2, mlly@^1.7.4, mlly@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.8.0.tgz#e074612b938af8eba1eaf43299cbc89cb72d824e" + integrity sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g== + dependencies: + acorn "^8.15.0" + pathe "^2.0.3" + pkg-types "^1.3.1" + ufo "^1.6.1" + mocha@^10.2.0: version "10.2.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8" @@ -11977,6 +14914,44 @@ morgan@^1.10.0, morgan@^1.8.2: on-finished "~2.3.0" on-headers "~1.0.2" +motion-dom@12.23.12: + version "12.23.12" + resolved "https://registry.yarnpkg.com/motion-dom/-/motion-dom-12.23.12.tgz#87974046e7e61bc4932f36d35e8eab6bb6f3e434" + integrity sha512-RcR4fvMCTESQBD/uKQe49D5RUeDOokkGRmz4ceaJKDBgHYtZtntC/s2vLvY38gqGaytinij/yi3hMcWVcEF5Kw== + dependencies: + motion-utils "^12.23.6" + +motion-dom@^12.23.12: + version "12.23.23" + resolved "https://registry.yarnpkg.com/motion-dom/-/motion-dom-12.23.23.tgz#8f874333ea1a04ee3a89eb928f518b463d589e0e" + integrity sha512-n5yolOs0TQQBRUFImrRfs/+6X4p3Q4n1dUEqt/H58Vx7OW6RF+foWEgmTVDhIWJIMXOuNNL0apKH2S16en9eiA== + dependencies: + motion-utils "^12.23.6" + +motion-utils@^12.23.6: + version "12.23.6" + resolved "https://registry.yarnpkg.com/motion-utils/-/motion-utils-12.23.6.tgz#fafef80b4ea85122dd0d6c599a0c63d72881f312" + integrity sha512-eAWoPgr4eFEOFfg2WjIsMoqJTW6Z8MTUCgn/GZ3VRpClWBdnbjryiA3ZSNLyxCTmCQx4RmYX6jX1iWHbenUPNQ== + +motion-v@^1.7.3: + version "1.7.4" + resolved "https://registry.yarnpkg.com/motion-v/-/motion-v-1.7.4.tgz#d0ef91da780733f297c91304feb92e232f922f27" + integrity sha512-YNDUAsany04wfI7YtHxQK3kxzNvh+OdFUk9GpA3+hMt7j6P+5WrVAAgr8kmPPoVza9EsJiAVhqoN3YYFN0Twrw== + dependencies: + framer-motion "12.23.12" + hey-listen "^1.0.8" + motion-dom "12.23.12" + +mri@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" + integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== + +mrmime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-2.0.1.tgz#bc3e87f7987853a54c9850eeb1f1078cd44adddc" + integrity sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ== + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -11987,7 +14962,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3, ms@^2.0.0, ms@^2.1.1: +ms@2.1.3, ms@^2.0.0, ms@^2.1.1, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -12030,6 +15005,11 @@ nanoid@^3.1.30, nanoid@^3.3.6, nanoid@^3.3.7: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== +nanoid@^3.3.11: + version "3.3.11" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.11.tgz#4f4f112cefbe303202f2199838128936266d185b" + integrity sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w== + nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -12127,6 +15107,11 @@ node-addon-api@^3.0.0, node-addon-api@^3.2.1: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161" integrity sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A== +node-addon-api@^7.0.0: + version "7.1.1" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-7.1.1.tgz#1aba6693b0f255258a049d621329329322aad558" + integrity sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ== + node-emoji@^1.4.1: version "1.11.0" resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.11.0.tgz#69a0150e6946e2f115e9d7ea4df7971e2628301c" @@ -12134,6 +15119,11 @@ node-emoji@^1.4.1: dependencies: lodash "^4.17.21" +node-fetch-native@^1.6.6, node-fetch-native@^1.6.7: + version "1.6.7" + resolved "https://registry.yarnpkg.com/node-fetch-native/-/node-fetch-native-1.6.7.tgz#9d09ca63066cc48423211ed4caf5d70075d76a71" + integrity sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q== + node-fetch@^2.6.1, node-fetch@^2.6.7: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" @@ -12193,6 +15183,11 @@ node-machine-id@1.1.12: resolved "https://registry.yarnpkg.com/node-machine-id/-/node-machine-id-1.1.12.tgz#37904eee1e59b320bb9c5d6c0a59f3b469cb6267" integrity sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ== +node-mock-http@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/node-mock-http/-/node-mock-http-1.0.4.tgz#21f2ab4ce2fe4fbe8a660d7c5195a1db85e042a4" + integrity sha512-8DY+kFsDkNXy1sJglUfuODx1/opAGJGyrTuFqEoN90oRc2Vk0ZbD4K2qmKXBBEhZQzdKHIVfEJpDU8Ak2NJEvQ== + node-releases@^2.0.13: version "2.0.13" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" @@ -12203,6 +15198,11 @@ node-releases@^2.0.14: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== +node-releases@^2.0.27: + version "2.0.27" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e" + integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA== + nodemon@^1.9.2: version "1.19.4" resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.19.4.tgz#56db5c607408e0fdf8920d2b444819af1aae0971" @@ -12525,6 +15525,17 @@ nx@17.3.2: "@nx/nx-win32-arm64-msvc" "17.3.2" "@nx/nx-win32-x64-msvc" "17.3.2" +nypm@^0.6.0: + version "0.6.2" + resolved "https://registry.yarnpkg.com/nypm/-/nypm-0.6.2.tgz#467512024948398fafa73cea30a3ed9efc5af071" + integrity sha512-7eM+hpOtrKrBDCh7Ypu2lJ9Z7PNZBdi/8AT3AX8xoCj43BBVHD0hPSTEvMtkMpfs8FCqBGhxB+uToIQimA111g== + dependencies: + citty "^0.1.6" + consola "^3.4.2" + pathe "^2.0.3" + pkg-types "^2.3.0" + tinyexec "^1.0.1" + oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" @@ -12640,6 +15651,20 @@ obuf@^1.0.0, obuf@^1.1.2: resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== +ofetch@^1.4.1, ofetch@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/ofetch/-/ofetch-1.5.1.tgz#5c43cc56e03398b273014957060344254505c5c7" + integrity sha512-2W4oUZlVaqAPAil6FUg/difl6YhqhUR7x2eZY4bQCko22UXg3hptq9KLQdqFClV+Wu85UX7hNtdGTngi/1BxcA== + dependencies: + destr "^2.0.5" + node-fetch-native "^1.6.7" + ufo "^1.6.1" + +ohash@^2.0.0, ohash@^2.0.11: + version "2.0.11" + resolved "https://registry.yarnpkg.com/ohash/-/ohash-2.0.11.tgz#60b11e8cff62ca9dee88d13747a5baa145f5900b" + integrity sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ== + omit-deep@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/omit-deep/-/omit-deep-0.3.0.tgz#21c8af3499bcadd29651a232cbcacbc52445ebec" @@ -12702,6 +15727,24 @@ onetime@^6.0.0: dependencies: mimic-fn "^4.0.0" +oniguruma-to-es@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/oniguruma-to-es/-/oniguruma-to-es-2.3.0.tgz#35ea9104649b7c05f3963c6b3b474d964625028b" + integrity sha512-bwALDxriqfKGfUufKGGepCzu9x7nJQuoRoAFp4AnwehhC2crqrDIAP/uN2qdlsAvSMpeRC3+Yzhqc7hLmle5+g== + dependencies: + emoji-regex-xs "^1.0.0" + regex "^5.1.1" + regex-recursion "^5.1.1" + +oniguruma-to-es@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/oniguruma-to-es/-/oniguruma-to-es-3.1.1.tgz#480e4bac4d3bc9439ac0d2124f0725e7a0d76d17" + integrity sha512-bUH8SDvPkH3ho3dvwJwfonjlQ4R80vjyvrU8YpxuROddv55vAEJrTuCuCVUhhsHbtlD9tGGbaNApGQckXhS8iQ== + dependencies: + emoji-regex-xs "^1.0.0" + regex "^6.0.1" + regex-recursion "^6.0.2" + open@8.4.0: version "8.4.0" resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8" @@ -12809,6 +15852,11 @@ ora@^3.4.0: strip-ansi "^5.2.0" wcwidth "^1.0.1" +orderedmap@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/orderedmap/-/orderedmap-2.1.1.tgz#61481269c44031c449915497bf5a4ad273c512d2" + integrity sha512-TvAWxi0nDe1j/rtMcWcIj94+Ffe6n7zhow33h40SKxmsmozs6dz/e+EajymfoFcHd7sxNn8yHM8839uixMOV6g== + os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -12935,6 +15983,11 @@ package-json@^6.3.0: registry-url "^5.0.0" semver "^6.2.0" +package-manager-detector@^1.3.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/package-manager-detector/-/package-manager-detector-1.6.0.tgz#70d0cf0aa02c877eeaf66c4d984ede0be9130734" + integrity sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA== + pacote@12.0.3: version "12.0.3" resolved "https://registry.yarnpkg.com/pacote/-/pacote-12.0.3.tgz#b6f25868deb810e7e0ddf001be88da2bcaca57c7" @@ -12967,6 +16020,11 @@ pad-right@^0.2.2: dependencies: repeat-string "^1.5.2" +pako@^0.2.5: + version "0.2.9" + resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" + integrity sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA== + pako@^1.0.3, pako@~1.0.2: version "1.0.11" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" @@ -13170,6 +16228,11 @@ pathe@^1.1.0, pathe@^1.1.1, pathe@^1.1.2: resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.2.tgz#6c4cb47a945692e48a1ddd6e4094d170516437ec" integrity sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ== +pathe@^2.0.1, pathe@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/pathe/-/pathe-2.0.3.tgz#3ecbec55421685b70a9da872b2cff3e1cbed1716" + integrity sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w== + pathval@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" @@ -13182,6 +16245,16 @@ pause-stream@0.0.11: dependencies: through "~2.3" +perfect-debounce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/perfect-debounce/-/perfect-debounce-1.0.0.tgz#9c2e8bc30b169cc984a58b7d5b28049839591d2a" + integrity sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA== + +perfect-debounce@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/perfect-debounce/-/perfect-debounce-2.0.0.tgz#0ff94f1ecbe0a6bca4b1703a2ed08bbe43739aa7" + integrity sha512-fkEH/OBiKrqqI/yIgjR92lMfs2K8105zt/VT6+7eTjNwisrsh47CeIED9z58zI7DfKdH3uHAn25ziRZn3kgAow== + performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -13197,11 +16270,21 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +picomatch@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042" + integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== + pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -13263,6 +16346,24 @@ pkg-types@^1.0.3: mlly "^1.2.0" pathe "^1.1.0" +pkg-types@^1.2.1, pkg-types@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.3.1.tgz#bd7cc70881192777eef5326c19deb46e890917df" + integrity sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ== + dependencies: + confbox "^0.1.8" + mlly "^1.7.4" + pathe "^2.0.1" + +pkg-types@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-2.3.0.tgz#037f2c19bd5402966ff6810e32706558cb5b5726" + integrity sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig== + dependencies: + confbox "^0.2.2" + exsolve "^1.0.7" + pathe "^2.0.3" + please-upgrade-node@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" @@ -13598,6 +16699,20 @@ postcss@^8.4.32: picocolors "^1.0.0" source-map-js "^1.0.2" +postcss@^8.4.41, postcss@^8.4.43, postcss@^8.5.3, postcss@^8.5.6: + version "8.5.6" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.6.tgz#2825006615a619b4f62a9e7426cc120b349a8f3c" + integrity sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg== + dependencies: + nanoid "^3.3.11" + picocolors "^1.1.1" + source-map-js "^1.2.1" + +preact@^10.0.0: + version "10.28.1" + resolved "https://registry.yarnpkg.com/preact/-/preact-10.28.1.tgz#83325f0141bc8c97977c64d532429d667a26b411" + integrity sha512-u1/ixq/lVQI0CakKNvLDEcW5zfCjUQfZdK9qqWuIJtsezuyG6pk9TWj75GMuI/EzRSZB/VAE43sNWWZfiy8psw== + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -13682,6 +16797,165 @@ property-information@^5.0.0, property-information@^5.2.0: dependencies: xtend "^4.0.0" +property-information@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/property-information/-/property-information-7.1.0.tgz#b622e8646e02b580205415586b40804d3e8bfd5d" + integrity sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ== + +prosemirror-changeset@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/prosemirror-changeset/-/prosemirror-changeset-2.3.1.tgz#eee3299cfabc7a027694e9abdc4e85505e9dd5e7" + integrity sha512-j0kORIBm8ayJNl3zQvD1TTPHJX3g042et6y/KQhZhnPrruO8exkTgG8X+NRpj7kIyMMEx74Xb3DyMIBtO0IKkQ== + dependencies: + prosemirror-transform "^1.0.0" + +prosemirror-collab@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/prosemirror-collab/-/prosemirror-collab-1.3.1.tgz#0e8c91e76e009b53457eb3b3051fb68dad029a33" + integrity sha512-4SnynYR9TTYaQVXd/ieUvsVV4PDMBzrq2xPUWutHivDuOshZXqQ5rGbZM84HEaXKbLdItse7weMGOUdDVcLKEQ== + dependencies: + prosemirror-state "^1.0.0" + +prosemirror-commands@^1.0.0, prosemirror-commands@^1.6.2: + version "1.7.1" + resolved "https://registry.yarnpkg.com/prosemirror-commands/-/prosemirror-commands-1.7.1.tgz#d101fef85618b1be53d5b99ea17bee5600781b38" + integrity sha512-rT7qZnQtx5c0/y/KlYaGvtG411S97UaL6gdp6RIZ23DLHanMYLyfGBV5DtSnZdthQql7W+lEVbpSfwtO8T+L2w== + dependencies: + prosemirror-model "^1.0.0" + prosemirror-state "^1.0.0" + prosemirror-transform "^1.10.2" + +prosemirror-dropcursor@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/prosemirror-dropcursor/-/prosemirror-dropcursor-1.8.2.tgz#2ed30c4796109ddeb1cf7282372b3850528b7228" + integrity sha512-CCk6Gyx9+Tt2sbYk5NK0nB1ukHi2ryaRgadV/LvyNuO3ena1payM2z6Cg0vO1ebK8cxbzo41ku2DE5Axj1Zuiw== + dependencies: + prosemirror-state "^1.0.0" + prosemirror-transform "^1.1.0" + prosemirror-view "^1.1.0" + +prosemirror-gapcursor@^1.3.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/prosemirror-gapcursor/-/prosemirror-gapcursor-1.4.0.tgz#e1144a83b79db7ed0ec32cd0e915a0364220af43" + integrity sha512-z00qvurSdCEWUIulij/isHaqu4uLS8r/Fi61IbjdIPJEonQgggbJsLnstW7Lgdk4zQ68/yr6B6bf7sJXowIgdQ== + dependencies: + prosemirror-keymap "^1.0.0" + prosemirror-model "^1.0.0" + prosemirror-state "^1.0.0" + prosemirror-view "^1.0.0" + +prosemirror-history@^1.0.0, prosemirror-history@^1.4.1: + version "1.5.0" + resolved "https://registry.yarnpkg.com/prosemirror-history/-/prosemirror-history-1.5.0.tgz#ee21fc5de85a1473e3e3752015ffd6d649a06859" + integrity sha512-zlzTiH01eKA55UAf1MEjtssJeHnGxO0j4K4Dpx+gnmX9n+SHNlDqI2oO1Kv1iPN5B1dm5fsljCfqKF9nFL6HRg== + dependencies: + prosemirror-state "^1.2.2" + prosemirror-transform "^1.0.0" + prosemirror-view "^1.31.0" + rope-sequence "^1.3.0" + +prosemirror-inputrules@^1.4.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/prosemirror-inputrules/-/prosemirror-inputrules-1.5.1.tgz#d2e935f6086e3801486b09222638f61dae89a570" + integrity sha512-7wj4uMjKaXWAQ1CDgxNzNtR9AlsuwzHfdFH1ygEHA2KHF2DOEaXl1CJfNPAKCg9qNEh4rum975QLaCiQPyY6Fw== + dependencies: + prosemirror-state "^1.0.0" + prosemirror-transform "^1.0.0" + +prosemirror-keymap@^1.0.0, prosemirror-keymap@^1.2.2, prosemirror-keymap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/prosemirror-keymap/-/prosemirror-keymap-1.2.3.tgz#c0f6ab95f75c0b82c97e44eb6aaf29cbfc150472" + integrity sha512-4HucRlpiLd1IPQQXNqeo81BGtkY8Ai5smHhKW9jjPKRc2wQIxksg7Hl1tTI2IfT2B/LgX6bfYvXxEpJl7aKYKw== + dependencies: + prosemirror-state "^1.0.0" + w3c-keyname "^2.2.0" + +prosemirror-markdown@^1.13.1: + version "1.13.2" + resolved "https://registry.yarnpkg.com/prosemirror-markdown/-/prosemirror-markdown-1.13.2.tgz#863eb3fd5f57a444e4378174622b562735b1c503" + integrity sha512-FPD9rHPdA9fqzNmIIDhhnYQ6WgNoSWX9StUZ8LEKapaXU9i6XgykaHKhp6XMyXlOWetmaFgGDS/nu/w9/vUc5g== + dependencies: + "@types/markdown-it" "^14.0.0" + markdown-it "^14.0.0" + prosemirror-model "^1.25.0" + +prosemirror-menu@^1.2.4: + version "1.2.5" + resolved "https://registry.yarnpkg.com/prosemirror-menu/-/prosemirror-menu-1.2.5.tgz#dea00e7b623cea89f4d76963bee22d2ac2343250" + integrity sha512-qwXzynnpBIeg1D7BAtjOusR+81xCp53j7iWu/IargiRZqRjGIlQuu1f3jFi+ehrHhWMLoyOQTSRx/IWZJqOYtQ== + dependencies: + crelt "^1.0.0" + prosemirror-commands "^1.0.0" + prosemirror-history "^1.0.0" + prosemirror-state "^1.0.0" + +prosemirror-model@^1.0.0, prosemirror-model@^1.20.0, prosemirror-model@^1.21.0, prosemirror-model@^1.24.1, prosemirror-model@^1.25.0, prosemirror-model@^1.25.4: + version "1.25.4" + resolved "https://registry.yarnpkg.com/prosemirror-model/-/prosemirror-model-1.25.4.tgz#8ebfbe29ecbee9e5e2e4048c4fe8e363fcd56e7c" + integrity sha512-PIM7E43PBxKce8OQeezAs9j4TP+5yDpZVbuurd1h5phUxEKIu+G2a+EUZzIC5nS1mJktDJWzbqS23n1tsAf5QA== + dependencies: + orderedmap "^2.0.0" + +prosemirror-schema-basic@^1.2.3: + version "1.2.4" + resolved "https://registry.yarnpkg.com/prosemirror-schema-basic/-/prosemirror-schema-basic-1.2.4.tgz#389ce1ec09b8a30ea9bbb92c58569cb690c2d695" + integrity sha512-ELxP4TlX3yr2v5rM7Sb70SqStq5NvI15c0j9j/gjsrO5vaw+fnnpovCLEGIcpeGfifkuqJwl4fon6b+KdrODYQ== + dependencies: + prosemirror-model "^1.25.0" + +prosemirror-schema-list@^1.5.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/prosemirror-schema-list/-/prosemirror-schema-list-1.5.1.tgz#5869c8f749e8745c394548bb11820b0feb1e32f5" + integrity sha512-927lFx/uwyQaGwJxLWCZRkjXG0p48KpMj6ueoYiu4JX05GGuGcgzAy62dfiV8eFZftgyBUvLx76RsMe20fJl+Q== + dependencies: + prosemirror-model "^1.0.0" + prosemirror-state "^1.0.0" + prosemirror-transform "^1.7.3" + +prosemirror-state@^1.0.0, prosemirror-state@^1.2.2, prosemirror-state@^1.4.3, prosemirror-state@^1.4.4: + version "1.4.4" + resolved "https://registry.yarnpkg.com/prosemirror-state/-/prosemirror-state-1.4.4.tgz#72b5e926f9e92dcee12b62a05fcc8a2de3bf5b39" + integrity sha512-6jiYHH2CIGbCfnxdHbXZ12gySFY/fz/ulZE333G6bPqIZ4F+TXo9ifiR86nAHpWnfoNjOb3o5ESi7J8Uz1jXHw== + dependencies: + prosemirror-model "^1.0.0" + prosemirror-transform "^1.0.0" + prosemirror-view "^1.27.0" + +prosemirror-tables@^1.6.4: + version "1.8.5" + resolved "https://registry.yarnpkg.com/prosemirror-tables/-/prosemirror-tables-1.8.5.tgz#104427012e5a5da1d2a38c122efee8d66bdd5104" + integrity sha512-V/0cDCsHKHe/tfWkeCmthNUcEp1IVO3p6vwN8XtwE9PZQLAZJigbw3QoraAdfJPir4NKJtNvOB8oYGKRl+t0Dw== + dependencies: + prosemirror-keymap "^1.2.3" + prosemirror-model "^1.25.4" + prosemirror-state "^1.4.4" + prosemirror-transform "^1.10.5" + prosemirror-view "^1.41.4" + +prosemirror-trailing-node@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/prosemirror-trailing-node/-/prosemirror-trailing-node-3.0.0.tgz#5bc223d4fc1e8d9145e4079ec77a932b54e19e04" + integrity sha512-xiun5/3q0w5eRnGYfNlW1uU9W6x5MoFKWwq/0TIRgt09lv7Hcser2QYV8t4muXbEr+Fwo0geYn79Xs4GKywrRQ== + dependencies: + "@remirror/core-constants" "3.0.0" + escape-string-regexp "^4.0.0" + +prosemirror-transform@^1.0.0, prosemirror-transform@^1.1.0, prosemirror-transform@^1.10.2, prosemirror-transform@^1.10.5, prosemirror-transform@^1.7.3: + version "1.10.5" + resolved "https://registry.yarnpkg.com/prosemirror-transform/-/prosemirror-transform-1.10.5.tgz#4cf9fe5dcbdbfebd62499f24386e7cec9bc9979b" + integrity sha512-RPDQCxIDhIBb1o36xxwsaeAvivO8VLJcgBtzmOwQ64bMtsVFh5SSuJ6dWSxO1UsHTiTXPCgQm3PDJt7p6IOLbw== + dependencies: + prosemirror-model "^1.21.0" + +prosemirror-view@^1.0.0, prosemirror-view@^1.1.0, prosemirror-view@^1.27.0, prosemirror-view@^1.31.0, prosemirror-view@^1.38.1, prosemirror-view@^1.41.4: + version "1.41.4" + resolved "https://registry.yarnpkg.com/prosemirror-view/-/prosemirror-view-1.41.4.tgz#4e1b3e90accc0eebe3bddb497a40ce54e4de722d" + integrity sha512-WkKgnyjNncri03Gjaz3IFWvCAE94XoiEgvtr0/r2Xw7R8/IjK3sKLSiDoCHWcsXSAinVaKlGRZDvMCsF1kbzjA== + dependencies: + prosemirror-model "^1.20.0" + prosemirror-state "^1.0.0" + prosemirror-transform "^1.1.0" + proto3-json-serializer@^0.1.8: version "0.1.9" resolved "https://registry.yarnpkg.com/proto3-json-serializer/-/proto3-json-serializer-0.1.9.tgz#705ddb41b009dd3e6fcd8123edd72926abf65a34" @@ -13833,6 +17107,11 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" +punycode.js@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode.js/-/punycode.js-2.3.1.tgz#6b53e56ad75588234e79f4affa90972c7dd8cdb7" + integrity sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA== + punycode@^1.3.2, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -13884,11 +17163,21 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== +quansync@^0.2.11: + version "0.2.11" + resolved "https://registry.yarnpkg.com/quansync/-/quansync-0.2.11.tgz#f9c3adda2e1272e4f8cf3f1457b04cbdb4ee692a" + integrity sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA== + queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== +radix3@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/radix3/-/radix3-1.1.2.tgz#fd27d2af3896c6bf4bcdfab6427c69c2afc69ec0" + integrity sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA== + randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -13932,6 +17221,14 @@ raw-body@2.5.2, raw-body@^2.2.0, raw-body@^2.3.3: iconv-lite "0.4.24" unpipe "1.0.0" +rc9@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/rc9/-/rc9-2.1.2.tgz#6282ff638a50caa0a91a31d76af4a0b9cbd1080d" + integrity sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg== + dependencies: + defu "^6.1.4" + destr "^2.0.3" + rc@1.2.8, rc@^1.0.1, rc@^1.1.6, rc@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" @@ -14056,6 +17353,16 @@ readdirp@^2.2.1: micromatch "^3.1.10" readable-stream "^2.0.2" +readdirp@^4.0.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-4.1.2.tgz#eb85801435fbf2a7ee58f19e0921b068fc69948d" + integrity sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg== + +readdirp@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-5.0.0.tgz#fbf1f71a727891d685bb1786f9ba74084f6e2f91" + integrity sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ== + readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -14129,7 +17436,41 @@ regex-parser@^2.2.11: resolved "https://registry.yarnpkg.com/regex-parser/-/regex-parser-2.2.11.tgz#3b37ec9049e19479806e878cabe7c1ca83ccfe58" integrity sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q== -regexp-tree@~0.1.1: +regex-recursion@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/regex-recursion/-/regex-recursion-5.1.1.tgz#5a73772d18adbf00f57ad097bf54171b39d78f8b" + integrity sha512-ae7SBCbzVNrIjgSbh7wMznPcQel1DNlDtzensnFxpiNpXt1U2ju/bHugH422r+4LAVS1FpW1YCwilmnNsjum9w== + dependencies: + regex "^5.1.1" + regex-utilities "^2.3.0" + +regex-recursion@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/regex-recursion/-/regex-recursion-6.0.2.tgz#a0b1977a74c87f073377b938dbedfab2ea582b33" + integrity sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg== + dependencies: + regex-utilities "^2.3.0" + +regex-utilities@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/regex-utilities/-/regex-utilities-2.3.0.tgz#87163512a15dce2908cf079c8960d5158ff43280" + integrity sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng== + +regex@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/regex/-/regex-5.1.1.tgz#cf798903f24d6fe6e531050a36686e082b29bd03" + integrity sha512-dN5I359AVGPnwzJm2jN1k0W9LPZ+ePvoOeVMMfqIMFz53sSwXkxaJoxr50ptnsC771lK95BnTrVSZxq0b9yCGw== + dependencies: + regex-utilities "^2.3.0" + +regex@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/regex/-/regex-6.1.0.tgz#d7ce98f8ee32da7497c13f6601fca2bc4a6a7803" + integrity sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg== + dependencies: + regex-utilities "^2.3.0" + +regexp-tree@^0.1.27, regexp-tree@~0.1.1: version "0.1.27" resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.27.tgz#2198f0ef54518ffa743fe74d983b56ffd631b6cd" integrity sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA== @@ -14236,6 +17577,38 @@ rehype@^8.0.0: rehype-stringify "^6.0.0" unified "^7.0.0" +reka-ui@2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/reka-ui/-/reka-ui-2.6.1.tgz#08f6b8a8ee774887b6bcde3d8ea54b608acfe82c" + integrity sha512-XK7cJDQoNuGXfCNzBBo/81Yg/OgjPwvbabnlzXG2VsdSgNsT6iIkuPBPr+C0Shs+3bb0x0lbPvgQAhMSCKm5Ww== + dependencies: + "@floating-ui/dom" "^1.6.13" + "@floating-ui/vue" "^1.1.6" + "@internationalized/date" "^3.5.0" + "@internationalized/number" "^3.5.0" + "@tanstack/vue-virtual" "^3.12.0" + "@vueuse/core" "^12.5.0" + "@vueuse/shared" "^12.5.0" + aria-hidden "^1.2.4" + defu "^6.1.4" + ohash "^2.0.11" + +reka-ui@^2.0.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/reka-ui/-/reka-ui-2.7.0.tgz#906697e744e9a9682f89372a46ef384d4500eae7" + integrity sha512-m+XmxQN2xtFzBP3OAdIafKq7C8OETo2fqfxcIIxYmNN2Ch3r5oAf6yEYCIJg5tL/yJU2mHqF70dCCekUkrAnXA== + dependencies: + "@floating-ui/dom" "^1.6.13" + "@floating-ui/vue" "^1.1.6" + "@internationalized/date" "^3.5.0" + "@internationalized/number" "^3.5.0" + "@tanstack/vue-virtual" "^3.12.0" + "@vueuse/core" "^12.5.0" + "@vueuse/shared" "^12.5.0" + aria-hidden "^1.2.4" + defu "^6.1.4" + ohash "^2.0.11" + remark-html@^13.0.2: version "13.0.2" resolved "https://registry.yarnpkg.com/remark-html/-/remark-html-13.0.2.tgz#de5f052749ff61fc904c9708c155c88a2e2655dc" @@ -14401,6 +17774,11 @@ resolve-import@^1.4.4: glob "^10.3.3" walk-up-path "^3.0.1" +resolve-pkg-maps@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" + integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== + resolve-url-loader@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-url-loader/-/resolve-url-loader-4.0.0.tgz#d50d4ddc746bb10468443167acf800dcd6c3ad57" @@ -14458,6 +17836,11 @@ restore-cursor@^3.1.0: onetime "^5.1.0" signal-exit "^3.0.2" +restructure@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/restructure/-/restructure-3.0.2.tgz#e6b2fad214f78edee21797fa8160fef50eb9b49a" + integrity sha512-gSfoiOEA0VPE6Tukkrr7I0RBdE0s7H1eFCDBk05l1KIQT1UIKNc5JZy6jdyW6eYH3aR3g5b3PuL77rq0hvwtAw== + ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -14491,6 +17874,11 @@ rfdc@^1.3.0: resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== +rfdc@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.4.1.tgz#778f76c4fb731d93414e8f925fbecf64cce7f6ca" + integrity sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA== + right-pad@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/right-pad/-/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0" @@ -14544,6 +17932,42 @@ rollup@^4.2.0: "@rollup/rollup-win32-x64-msvc" "4.9.5" fsevents "~2.3.2" +rollup@^4.20.0: + version "4.54.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.54.0.tgz#930f4dfc41ff94d720006f9f62503612a6c319b8" + integrity sha512-3nk8Y3a9Ea8szgKhinMlGMhGMw89mqule3KWczxhIzqudyHdCIOHw8WJlj/r329fACjKLEh13ZSk7oE22kyeIw== + dependencies: + "@types/estree" "1.0.8" + optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.54.0" + "@rollup/rollup-android-arm64" "4.54.0" + "@rollup/rollup-darwin-arm64" "4.54.0" + "@rollup/rollup-darwin-x64" "4.54.0" + "@rollup/rollup-freebsd-arm64" "4.54.0" + "@rollup/rollup-freebsd-x64" "4.54.0" + "@rollup/rollup-linux-arm-gnueabihf" "4.54.0" + "@rollup/rollup-linux-arm-musleabihf" "4.54.0" + "@rollup/rollup-linux-arm64-gnu" "4.54.0" + "@rollup/rollup-linux-arm64-musl" "4.54.0" + "@rollup/rollup-linux-loong64-gnu" "4.54.0" + "@rollup/rollup-linux-ppc64-gnu" "4.54.0" + "@rollup/rollup-linux-riscv64-gnu" "4.54.0" + "@rollup/rollup-linux-riscv64-musl" "4.54.0" + "@rollup/rollup-linux-s390x-gnu" "4.54.0" + "@rollup/rollup-linux-x64-gnu" "4.54.0" + "@rollup/rollup-linux-x64-musl" "4.54.0" + "@rollup/rollup-openharmony-arm64" "4.54.0" + "@rollup/rollup-win32-arm64-msvc" "4.54.0" + "@rollup/rollup-win32-ia32-msvc" "4.54.0" + "@rollup/rollup-win32-x64-gnu" "4.54.0" + "@rollup/rollup-win32-x64-msvc" "4.54.0" + fsevents "~2.3.2" + +rope-sequence@^1.3.0: + version "1.3.4" + resolved "https://registry.yarnpkg.com/rope-sequence/-/rope-sequence-1.3.4.tgz#df85711aaecd32f1e756f76e43a415171235d425" + integrity sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ== + router@^1.3.1: version "1.3.8" resolved "https://registry.yarnpkg.com/router/-/router-1.3.8.tgz#1509614ae1fbc67139a728481c54b057ecfb04bf" @@ -14747,6 +18171,11 @@ schema-utils@^4.0.0: ajv-formats "^2.1.1" ajv-keywords "^5.1.0" +scule@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/scule/-/scule-1.3.0.tgz#6efbd22fd0bb801bdcc585c89266a7d2daa8fbd3" + integrity sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g== + secure-compare@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/secure-compare/-/secure-compare-3.0.1.tgz#f1a0329b308b221fae37b9974f3d578d0ca999e3" @@ -14841,6 +18270,11 @@ semver@^7.0.0, semver@^7.1.1, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semve dependencies: lru-cache "^6.0.0" +semver@^7.6.3, semver@^7.7.3: + version "7.7.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.3.tgz#4b5f4143d007633a8dc671cd0a6ef9147b8bb946" + integrity sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q== + send@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" @@ -14999,6 +18433,34 @@ shelljs@^0.8.3, shelljs@^0.8.4, shelljs@^0.8.5: interpret "^1.0.0" rechoir "^0.6.2" +shiki@^1.0.0: + version "1.29.2" + resolved "https://registry.yarnpkg.com/shiki/-/shiki-1.29.2.tgz#5c93771f2d5305ce9c05975c33689116a27dc657" + integrity sha512-njXuliz/cP+67jU2hukkxCNuH1yUi4QfdZZY+sMr5PPrIyXSu5iTb/qYC4BiWWB0vZ+7TbdvYUCeL23zpwCfbg== + dependencies: + "@shikijs/core" "1.29.2" + "@shikijs/engine-javascript" "1.29.2" + "@shikijs/engine-oniguruma" "1.29.2" + "@shikijs/langs" "1.29.2" + "@shikijs/themes" "1.29.2" + "@shikijs/types" "1.29.2" + "@shikijs/vscode-textmate" "^10.0.1" + "@types/hast" "^3.0.4" + +shiki@^2.1.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/shiki/-/shiki-2.5.0.tgz#09d01ebf3b0b06580431ce3ddc023320442cf223" + integrity sha512-mI//trrsaiCIPsja5CNfsyNOqgAZUb6VpJA+340toL42UpzQlXpwRV9nch69X6gaUxrr9kaOOa6e3y3uAkGFxQ== + dependencies: + "@shikijs/core" "2.5.0" + "@shikijs/engine-javascript" "2.5.0" + "@shikijs/engine-oniguruma" "2.5.0" + "@shikijs/langs" "2.5.0" + "@shikijs/themes" "2.5.0" + "@shikijs/types" "2.5.0" + "@shikijs/vscode-textmate" "^10.0.2" + "@types/hast" "^3.0.4" + shx@^0.3.2: version "0.3.4" resolved "https://registry.yarnpkg.com/shx/-/shx-0.3.4.tgz#74289230b4b663979167f94e1935901406e40f02" @@ -15063,6 +18525,15 @@ sinon@^15.0.1: nise "^5.1.4" supports-color "^7.2.0" +sirv@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/sirv/-/sirv-3.0.2.tgz#f775fccf10e22a40832684848d636346f41cd970" + integrity sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g== + dependencies: + "@polka/url" "^1.0.0-next.24" + mrmime "^2.0.0" + totalist "^3.0.0" + slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" @@ -15229,6 +18700,11 @@ source-map-js@^1.0.1, source-map-js@^1.0.2: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== +source-map-js@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" + integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== + source-map-loader@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/source-map-loader/-/source-map-loader-3.0.0.tgz#f2a04ee2808ad01c774dea6b7d2639839f3b3049" @@ -15322,6 +18798,11 @@ space-separated-tokens@^1.0.0: resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899" integrity sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA== +space-separated-tokens@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz#1ecd9d2350a3844572c3f4a312bceb018348859f" + integrity sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q== + spawn-command@^0.0.2-1: version "0.0.2-1" resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" @@ -15381,6 +18862,11 @@ spdy@^4.0.2: select-hose "^2.0.0" spdy-transport "^3.0.0" +speakingurl@^14.0.1: + version "14.0.1" + resolved "https://registry.yarnpkg.com/speakingurl/-/speakingurl-14.0.1.tgz#f37ec8ddc4ab98e9600c1c9ec324a8c48d772a53" + integrity sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ== + speedline-core@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/speedline-core/-/speedline-core-1.4.3.tgz#4d6e7276e2063c2d36a375cb25a523ac73475319" @@ -15483,6 +18969,11 @@ statuses@2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== +std-env@^3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.10.0.tgz#d810b27e3a073047b2b5e40034881f5ea6f9c83b" + integrity sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg== + std-env@^3.5.0: version "3.7.0" resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.7.0.tgz#c9f7386ced6ecf13360b6c6c55b8aaa4ef7481d2" @@ -15531,7 +19022,16 @@ string-length@^1.0.0: dependencies: strip-ansi "^3.0.0" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -15641,6 +19141,14 @@ stringify-entities@^3.0.0, stringify-entities@^3.0.1: character-entities-legacy "^1.0.0" xtend "^4.0.0" +stringify-entities@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-4.0.4.tgz#b3b79ef5f277cc4ac73caeb0236c5ba939b3a4f3" + integrity sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg== + dependencies: + character-entities-html4 "^2.0.0" + character-entities-legacy "^3.0.0" + stringify-object@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" @@ -15650,7 +19158,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -15678,6 +19186,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.0, strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -15722,6 +19237,13 @@ strip-literal@^1.3.0: dependencies: acorn "^8.10.0" +strip-literal@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/strip-literal/-/strip-literal-3.1.0.tgz#222b243dd2d49c0bcd0de8906adbd84177196032" + integrity sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg== + dependencies: + js-tokens "^9.0.1" + strong-log-transformer@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz#0f5ed78d325e0421ac6f90f7f10e691d6ae3ae10" @@ -15754,6 +19276,13 @@ stylus@0.55.0: semver "^6.3.0" source-map "^0.7.3" +superjson@^2.2.2: + version "2.2.6" + resolved "https://registry.yarnpkg.com/superjson/-/superjson-2.2.6.tgz#a223a3a988172a5f9656e2063fe5f733af40d099" + integrity sha512-H+ue8Zo4vJmV2nRjpx86P35lzwDT3nItnIsocgumgr0hHMQ+ZGq5vrERg9kJBo5AWGmxZDhzDo+WVIJqkB0cGA== + dependencies: + copy-anything "^4" + superstatic@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/superstatic/-/superstatic-7.1.0.tgz#42cc773a0f500fb691841e0533d0b8c31f25997f" @@ -15851,6 +19380,19 @@ svgo@^1.3.2: unquote "~1.1.1" util.promisify "~1.0.0" +svgo@^3.0.0: + version "3.3.2" + resolved "https://registry.yarnpkg.com/svgo/-/svgo-3.3.2.tgz#ad58002652dffbb5986fc9716afe52d869ecbda8" + integrity sha512-OoohrmuUlBs8B8o6MB2Aevn+pRIH9zDALSR+6hhqVfa6fRwG/Qw9VUMSMW9VNg2CFc/MTIfabtdOVl9ODIJjpw== + dependencies: + "@trysound/sax" "0.2.0" + commander "^7.2.0" + css-select "^5.1.0" + css-tree "^2.3.1" + css-what "^6.1.0" + csso "^5.0.5" + picocolors "^1.0.0" + svgson@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/svgson/-/svgson-4.1.0.tgz#eb70dac8d0075c61e5bfd45411a56014e2d3610e" @@ -15888,6 +19430,26 @@ sync-content@^1.0.2: path-scurry "^1.9.2" rimraf "^5.0.1" +tabbable@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-6.3.0.tgz#2e0e6163935387cdeacd44e9334616ca0115a8d3" + integrity sha512-EIHvdY5bPLuWForiR/AN2Bxngzpuwn1is4asboytXtpTgsArc+WmSJKVLlhdh71u7jFcryDqB2A8lQvj78MkyQ== + +tailwind-merge@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/tailwind-merge/-/tailwind-merge-3.4.0.tgz#5a264e131a096879965f1175d11f8c36e6b64eca" + integrity sha512-uSaO4gnW+b3Y2aWoWfFpX62vn2sR3skfhbjsEnaBI81WD1wBLlHZe5sWf0AqjksNdYTbGBEd0UasQMT3SNV15g== + +tailwind-variants@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/tailwind-variants/-/tailwind-variants-3.2.2.tgz#3ac8ccc735cae8b6f416330070f5f7437a77a0f3" + integrity sha512-Mi4kHeMTLvKlM98XPnK+7HoBPmf4gygdFmqQPaDivc3DpYS6aIY6KiG/PgThrGvii5YZJqRsPz0aPyhoFzmZgg== + +tailwindcss@4.1.18, tailwindcss@^4.0.0, tailwindcss@^4.1.18: + version "4.1.18" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-4.1.18.tgz#f488ba47853abdb5354daf9679d3e7791fc4f4e3" + integrity sha512-4+Z+0yiYyEtUVCScyfHCxOYP06L5Ne+JiHhY2IjR2KWMIWhJOYZKLSGZaP5HkZ8+bY0cxfzwDE5uOmzFXyIwxw== + tapable@^2.0.0, tapable@^2.1.1, tapable@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" @@ -16051,11 +19613,29 @@ timers-ext@^0.1.5, timers-ext@^0.1.7: es5-ext "~0.10.46" next-tick "1" +tiny-inflate@^1.0.0, tiny-inflate@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tiny-inflate/-/tiny-inflate-1.0.3.tgz#122715494913a1805166aaf7c93467933eea26c4" + integrity sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw== + tinybench@^2.5.1: version "2.6.0" resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.6.0.tgz#1423284ee22de07c91b3752c048d2764714b341b" integrity sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA== +tinyexec@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-1.0.2.tgz#bdd2737fe2ba40bd6f918ae26642f264b99ca251" + integrity sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg== + +tinyglobby@^0.2.15: + version "0.2.15" + resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.15.tgz#e228dd1e638cea993d2fdb4fcd2d4602a79951c2" + integrity sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ== + dependencies: + fdir "^6.5.0" + picomatch "^4.0.3" + tinypool@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-0.8.1.tgz#b6c4e4972ede3e3e5cda74a3da1679303d386b03" @@ -16142,6 +19722,11 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== +totalist@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/totalist/-/totalist-3.0.1.tgz#ba3a3d600c915b1a97872348f79c127475f6acf8" + integrity sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ== + touch@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b" @@ -16195,6 +19780,11 @@ tree-kill@1.2.2, tree-kill@^1.2.2: resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== +trim-lines@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-3.0.1.tgz#d802e332a07df861c48802c04321017b1bd87338" + integrity sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg== + trim-trailing-lines@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.4.tgz#bd4abbec7cc880462f10b2c8b5ce1d8d1ec7c2c0" @@ -16337,6 +19927,11 @@ tslib@^2.0.0, tslib@^2.0.1, tslib@^2.1.0, tslib@^2.2.0, tslib@^2.3.0, tslib@^2.3 resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== +tslib@^2.8.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== + tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" @@ -16344,6 +19939,16 @@ tsutils@^3.21.0: dependencies: tslib "^1.8.1" +tsx@^4.7.0: + version "4.21.0" + resolved "https://registry.yarnpkg.com/tsx/-/tsx-4.21.0.tgz#32aa6cf17481e336f756195e6fe04dae3e6308b1" + integrity sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw== + dependencies: + esbuild "~0.27.0" + get-tsconfig "^4.7.5" + optionalDependencies: + fsevents "~2.3.3" + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -16411,6 +20016,11 @@ type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" +type-level-regexp@~0.1.17: + version "0.1.17" + resolved "https://registry.yarnpkg.com/type-level-regexp/-/type-level-regexp-0.1.17.tgz#ec1bf7dd65b85201f9863031d6f023bdefc2410f" + integrity sha512-wTk4DH3cxwk196uGLK/E9pE45aLfeKJacKmcEgEOA/q5dnPGNxXt0cfYdFxb57L+sEpf1oJH4Dnx/pnRcku9jg== + type@^1.0.1: version "1.2.0" resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" @@ -16484,6 +20094,34 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== +typedoc-plugin-default-groups@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/typedoc-plugin-default-groups/-/typedoc-plugin-default-groups-1.0.2.tgz#9222756c1bf93f048dd7ec1ea63cfca7636d8e85" + integrity sha512-DRQrsPVwJBThYtwIRha82bW5u4WPQGFfElNUizTmCopuaTgLnh3aS3tYaO0S9ZJLYIJ9X4jkwRLsFXLA6N/nnA== + dependencies: + typedoc "^0.28.12" + +typedoc-plugin-markdown@^4.9.0: + version "4.9.0" + resolved "https://registry.yarnpkg.com/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.9.0.tgz#88f37ba2417fc8b93951d457a3a557682ce5e01e" + integrity sha512-9Uu4WR9L7ZBgAl60N/h+jqmPxxvnC9nQAlnnO/OujtG2ubjnKTVUFY1XDhcMY+pCqlX3N2HsQM2QTYZIU9tJuw== + +typedoc-vitepress-theme@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/typedoc-vitepress-theme/-/typedoc-vitepress-theme-1.1.2.tgz#71c85dd1b85a8599843804e924327aa9a93426f4" + integrity sha512-hQvCZRr5uKDqY1bRuY1+eNTNn6d4TE4OP5pnw65Y7WGgajkJW9X1/lVJK2UJpcwCmwkdjw1QIO49H9JQlxWhhw== + +typedoc@^0.28.12, typedoc@^0.28.15: + version "0.28.15" + resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.28.15.tgz#667faf77eb934deb935fbfd5108a6de5f953948f" + integrity sha512-mw2/2vTL7MlT+BVo43lOsufkkd2CJO4zeOSuWQQsiXoV2VuEn7f6IZp2jsUDPmBMABpgR0R5jlcJ2OGEFYmkyg== + dependencies: + "@gerrit0/mini-shiki" "^3.17.0" + lunr "^2.3.9" + markdown-it "^14.1.0" + minimatch "^9.0.5" + yaml "^2.8.1" + typescript@4.5.4: version "4.5.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8" @@ -16504,11 +20142,21 @@ ua-parser-js@^0.7.30: resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.37.tgz#e464e66dac2d33a7a1251d7d7a99d6157ec27832" integrity sha512-xV8kqRKM+jhMvcHWUKthV9fNebIzrNy//2O9ZwWcfiBFR5f25XVZPLlEajk/sf3Ra15V92isyQqnIEXRDaZWEA== +uc.micro@^2.0.0, uc.micro@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee" + integrity sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A== + ufo@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.3.2.tgz#c7d719d0628a1c80c006d2240e0d169f6e3c0496" integrity sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA== +ufo@^1.5.4, ufo@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.6.1.tgz#ac2db1d54614d1b22c1d603e3aef44a85d8f146b" + integrity sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA== + uglify-js@^3.1.4: version "3.17.4" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" @@ -16536,6 +20184,21 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +uncrypto@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/uncrypto/-/uncrypto-0.1.3.tgz#e1288d609226f2d02d8d69ee861fa20d8348ef2b" + integrity sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q== + +unctx@^2.4.1: + version "2.5.0" + resolved "https://registry.yarnpkg.com/unctx/-/unctx-2.5.0.tgz#a0c3ba03838856d336e815a71403ce1a848e4108" + integrity sha512-p+Rz9x0R7X+CYDkT+Xg8/GhpcShTlU8n+cf9OtOEf7zEQsNcCZO1dPKNRDqvUTaq+P32PMMkxWHwfrxkqfqAYg== + dependencies: + acorn "^8.15.0" + estree-walker "^3.0.3" + magic-string "^0.30.21" + unplugin "^2.3.11" + undefsafe@^2.0.2: version "2.0.5" resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.5.tgz#38733b9327bdcd226db889fb723a6efd162e6e2c" @@ -16546,6 +20209,13 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +unhead@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/unhead/-/unhead-2.1.1.tgz#81f1cd59db2be6c910c862dab2938b7798b33c24" + integrity sha512-NOt8n2KybAOxSLfNXegAVai4SGU8bPKqWnqCzNAvnRH2i8mW+0bbFjN/L75LBgCSTiOjJSpANe5w2V34Grr7Cw== + dependencies: + hookable "^5.5.3" + unherit@^1.0.4: version "1.1.3" resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.3.tgz#6c9b503f2b41b262330c80e91c8614abdaa69c22" @@ -16572,11 +20242,27 @@ unicode-match-property-value-ecmascript@^2.1.0: resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== +unicode-properties@^1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/unicode-properties/-/unicode-properties-1.4.1.tgz#96a9cffb7e619a0dc7368c28da27e05fc8f9be5f" + integrity sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg== + dependencies: + base64-js "^1.3.0" + unicode-trie "^2.0.0" + unicode-property-aliases-ecmascript@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== +unicode-trie@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unicode-trie/-/unicode-trie-2.0.0.tgz#8fd8845696e2e14a8b67d78fa9e0dd2cad62fec8" + integrity sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ== + dependencies: + pako "^0.2.5" + tiny-inflate "^1.0.0" + unified@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/unified/-/unified-7.1.0.tgz#5032f1c1ee3364bd09da12e27fdd4a7553c7be13" @@ -16603,6 +20289,35 @@ unified@^9.0.0, unified@^9.2.0: trough "^1.0.0" vfile "^4.0.0" +unifont@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/unifont/-/unifont-0.6.0.tgz#c0ddd6411f1917f934907d989b4566842c5b482b" + integrity sha512-5Fx50fFQMQL5aeHyWnZX9122sSLckcDvcfFiBf3QYeHa7a1MKJooUy52b67moi2MJYkrfo/TWY+CoLdr/w0tTA== + dependencies: + css-tree "^3.0.0" + ofetch "^1.4.1" + ohash "^2.0.0" + +unimport@^5.5.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/unimport/-/unimport-5.6.0.tgz#22cd39a0eb74b76c5e64ed6bec27ca4fd4b086e3" + integrity sha512-8rqAmtJV8o60x46kBAJKtHpJDJWkA2xcBqWKPI14MgUb05o1pnpnCnXSxedUXyeq7p8fR5g3pTo2BaswZ9lD9A== + dependencies: + acorn "^8.15.0" + escape-string-regexp "^5.0.0" + estree-walker "^3.0.3" + local-pkg "^1.1.2" + magic-string "^0.30.21" + mlly "^1.8.0" + pathe "^2.0.3" + picomatch "^4.0.3" + pkg-types "^2.3.0" + scule "^1.3.0" + strip-literal "^3.1.0" + tinyglobby "^0.2.15" + unplugin "^2.3.11" + unplugin-utils "^0.3.1" + union-value@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" @@ -16704,11 +20419,25 @@ unist-util-is@^4.0.0: resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-4.1.0.tgz#976e5f462a7a5de73d94b706bac1b90671b57797" integrity sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg== +unist-util-is@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-6.0.1.tgz#d0a3f86f2dd0db7acd7d8c2478080b5c67f9c6a9" + integrity sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g== + dependencies: + "@types/unist" "^3.0.0" + unist-util-position@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-3.1.0.tgz#1c42ee6301f8d52f47d14f62bbdb796571fa2d47" integrity sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA== +unist-util-position@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-5.0.0.tgz#678f20ab5ca1207a97d7ea8a388373c9cf896be4" + integrity sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA== + dependencies: + "@types/unist" "^3.0.0" + unist-util-remove-position@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz#5d19ca79fdba712301999b2b73553ca8f3b352cc" @@ -16757,6 +20486,14 @@ unist-util-visit-parents@^3.0.0: "@types/unist" "^2.0.0" unist-util-is "^4.0.0" +unist-util-visit-parents@^6.0.0: + version "6.0.2" + resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz#777df7fb98652ce16b4b7cd999d0a1a40efa3a02" + integrity sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ== + dependencies: + "@types/unist" "^3.0.0" + unist-util-is "^6.0.0" + unist-util-visit@^1.1.0, unist-util-visit@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.4.1.tgz#4724aaa8486e6ee6e26d7ff3c8685960d560b1e3" @@ -16773,6 +20510,15 @@ unist-util-visit@^2.0.0: unist-util-is "^4.0.0" unist-util-visit-parents "^3.0.0" +unist-util-visit@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-5.0.0.tgz#a7de1f31f72ffd3519ea71814cccf5fd6a9217d6" + integrity sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg== + dependencies: + "@types/unist" "^3.0.0" + unist-util-is "^6.0.0" + unist-util-visit-parents "^6.0.0" + universal-analytics@^0.4.16: version "0.4.23" resolved "https://registry.yarnpkg.com/universal-analytics/-/universal-analytics-0.4.23.tgz#d915e676850c25c4156762471bdd7cf2eaaca8ac" @@ -16797,6 +20543,50 @@ unpipe@1.0.0, unpipe@~1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== +unplugin-auto-import@^20.3.0: + version "20.3.0" + resolved "https://registry.yarnpkg.com/unplugin-auto-import/-/unplugin-auto-import-20.3.0.tgz#a4947cea55b2b06413b28a8477cb120e03b9db32" + integrity sha512-RcSEQiVv7g0mLMMXibYVKk8mpteKxvyffGuDKqZZiFr7Oq3PB1HwgHdK5O7H4AzbhzHoVKG0NnMnsk/1HIVYzQ== + dependencies: + local-pkg "^1.1.2" + magic-string "^0.30.21" + picomatch "^4.0.3" + unimport "^5.5.0" + unplugin "^2.3.11" + unplugin-utils "^0.3.1" + +unplugin-utils@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/unplugin-utils/-/unplugin-utils-0.3.1.tgz#ef2873670a6a2a21bd2c9d31307257cc863a709c" + integrity sha512-5lWVjgi6vuHhJ526bI4nlCOmkCIF3nnfXkCMDeMJrtdvxTs6ZFCM8oNufGTsDbKv/tJ/xj8RpvXjRuPBZJuJog== + dependencies: + pathe "^2.0.3" + picomatch "^4.0.3" + +unplugin-vue-components@^30.0.0: + version "30.0.0" + resolved "https://registry.yarnpkg.com/unplugin-vue-components/-/unplugin-vue-components-30.0.0.tgz#c0972272364f4a58a7904c54e5d262b75cefd008" + integrity sha512-4qVE/lwCgmdPTp6h0qsRN2u642tt4boBQtcpn4wQcWZAsr8TQwq+SPT3NDu/6kBFxzo/sSEK4ioXhOOBrXc3iw== + dependencies: + chokidar "^4.0.3" + debug "^4.4.3" + local-pkg "^1.1.2" + magic-string "^0.30.19" + mlly "^1.8.0" + tinyglobby "^0.2.15" + unplugin "^2.3.10" + unplugin-utils "^0.3.1" + +unplugin@^2.0.0, unplugin@^2.3.10, unplugin@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/unplugin/-/unplugin-2.3.11.tgz#411e020dd2ba90e2fbe1e7bd63a5a399e6ee3b54" + integrity sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww== + dependencies: + "@jridgewell/remapping" "^2.3.5" + acorn "^8.15.0" + picomatch "^4.0.3" + webpack-virtual-modules "^0.6.2" + unquote@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/unquote/-/unquote-1.1.1.tgz#8fded7324ec6e88a0ff8b905e7c098cdc086d544" @@ -16818,6 +20608,31 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" +unstorage@^1.17.1, unstorage@^1.17.2: + version "1.17.3" + resolved "https://registry.yarnpkg.com/unstorage/-/unstorage-1.17.3.tgz#805acbeab7f7b97f0d0492427af18e650eda4e57" + integrity sha512-i+JYyy0DoKmQ3FximTHbGadmIYb8JEpq7lxUjnjeB702bCPum0vzo6oy5Mfu0lpqISw7hCyMW2yj4nWC8bqJ3Q== + dependencies: + anymatch "^3.1.3" + chokidar "^4.0.3" + destr "^2.0.5" + h3 "^1.15.4" + lru-cache "^10.4.3" + node-fetch-native "^1.6.7" + ofetch "^1.5.1" + ufo "^1.6.1" + +untyped@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/untyped/-/untyped-2.0.0.tgz#86bc205a4ec4b0137282285866b8278557aeee97" + integrity sha512-nwNCjxJTjNuLCgFr42fEak5OcLuB3ecca+9ksPFNvtfYSLpjf+iJqSIaSnIile6ZPbKYxI5k2AfXqeopGudK/g== + dependencies: + citty "^0.1.6" + defu "^6.1.4" + jiti "^2.4.2" + knitwork "^1.2.0" + scule "^1.3.0" + unzip-response@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" @@ -16852,6 +20667,14 @@ update-browserslist-db@^1.0.13: escalade "^3.1.1" picocolors "^1.0.0" +update-browserslist-db@^1.2.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz#64d76db58713136acbeb4c49114366cc6cc2e80d" + integrity sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w== + dependencies: + escalade "^3.2.0" + picocolors "^1.1.1" + update-notifier@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6" @@ -17067,6 +20890,15 @@ vary@^1, vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== +vaul-vue@0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/vaul-vue/-/vaul-vue-0.4.1.tgz#76ad8ccf8f9a61ea89ae51874defd3e36a5cef6d" + integrity sha512-A6jOWOZX5yvyo1qMn7IveoWN91mJI5L3BUKsIwkg6qrTGgHs1Sb1JF/vyLJgnbN1rH4OOOxFbtqL9A46bOyGUQ== + dependencies: + "@vueuse/core" "^10.8.0" + reka-ui "^2.0.0" + vue "^3.4.5" + verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" @@ -17109,6 +20941,14 @@ vfile-message@^2.0.0: "@types/unist" "^2.0.0" unist-util-stringify-position "^2.0.0" +vfile-message@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-4.0.3.tgz#87b44dddd7b70f0641c2e3ed0864ba73e2ea8df4" + integrity sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw== + dependencies: + "@types/unist" "^3.0.0" + unist-util-stringify-position "^4.0.0" + vfile@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/vfile/-/vfile-3.0.1.tgz#47331d2abe3282424f4a4bb6acd20a44c4121803" @@ -17129,6 +20969,14 @@ vfile@^4.0.0: unist-util-stringify-position "^2.0.0" vfile-message "^2.0.0" +vfile@^6.0.0: + version "6.0.3" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-6.0.3.tgz#3652ab1c496531852bf55a6bac57af981ebc38ab" + integrity sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q== + dependencies: + "@types/unist" "^3.0.0" + vfile-message "^4.0.0" + vite-node@1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-1.2.1.tgz#bca96ae91b2b1ee9a7aa73685908362d70ce26a8" @@ -17151,6 +20999,41 @@ vite@^5.0.0: optionalDependencies: fsevents "~2.3.3" +vite@^5.4.14: + version "5.4.21" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.21.tgz#84a4f7c5d860b071676d39ba513c0d598fdc7027" + integrity sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw== + dependencies: + esbuild "^0.21.3" + postcss "^8.4.43" + rollup "^4.20.0" + optionalDependencies: + fsevents "~2.3.3" + +vitepress@^1.6.4: + version "1.6.4" + resolved "https://registry.yarnpkg.com/vitepress/-/vitepress-1.6.4.tgz#1b6c68fede541a3f401a66263dce0c985e2d8d92" + integrity sha512-+2ym1/+0VVrbhNyRoFFesVvBvHAVMZMK0rw60E3X/5349M1GuVdKeazuksqopEdvkKwKGs21Q729jX81/bkBJg== + dependencies: + "@docsearch/css" "3.8.2" + "@docsearch/js" "3.8.2" + "@iconify-json/simple-icons" "^1.2.21" + "@shikijs/core" "^2.1.0" + "@shikijs/transformers" "^2.1.0" + "@shikijs/types" "^2.1.0" + "@types/markdown-it" "^14.1.2" + "@vitejs/plugin-vue" "^5.2.1" + "@vue/devtools-api" "^7.7.0" + "@vue/shared" "^3.5.13" + "@vueuse/core" "^12.4.0" + "@vueuse/integrations" "^12.4.0" + focus-trap "^7.6.4" + mark.js "8.11.1" + minisearch "^7.1.1" + shiki "^2.1.0" + vite "^5.4.14" + vue "^3.5.13" + vitest@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/vitest/-/vitest-1.2.1.tgz#9afb705826a2c6260a71b625d28b49117833dce6" @@ -17191,6 +21074,27 @@ void-elements@^2.0.0: resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" integrity sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung== +vue-component-type-helpers@^3.1.5: + version "3.2.1" + resolved "https://registry.yarnpkg.com/vue-component-type-helpers/-/vue-component-type-helpers-3.2.1.tgz#6388d2326720d6e349649dd4160d0e9374e1a6b4" + integrity sha512-gKV7XOkQl4urSuLHNY1tnVQf7wVgtb/mKbRyxSLWGZUY9RK7aDPhBenTjm+i8ZFe0zC2PZeHMPtOZXZfyaFOzQ== + +vue-demi@>=0.13.0, vue-demi@>=0.14.8: + version "0.14.10" + resolved "https://registry.yarnpkg.com/vue-demi/-/vue-demi-0.14.10.tgz#afc78de3d6f9e11bf78c55e8510ee12814522f04" + integrity sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg== + +vue@^3.4.5, vue@^3.5.13: + version "3.5.26" + resolved "https://registry.yarnpkg.com/vue/-/vue-3.5.26.tgz#03a0b17311e0e593d34b9358fa249b85e3a6d9fb" + integrity sha512-SJ/NTccVyAoNUJmkM9KUqPcYlY+u8OVL1X5EW9RIs3ch5H2uERxyyIUI4MRxVCSOiEcupX9xNGde1tL9ZKpimA== + dependencies: + "@vue/compiler-dom" "3.5.26" + "@vue/compiler-sfc" "3.5.26" + "@vue/runtime-dom" "3.5.26" + "@vue/server-renderer" "3.5.26" + "@vue/shared" "3.5.26" + w3c-hr-time@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" @@ -17198,6 +21102,11 @@ w3c-hr-time@^1.0.1: dependencies: browser-process-hrtime "^1.0.0" +w3c-keyname@^2.2.0: + version "2.2.8" + resolved "https://registry.yarnpkg.com/w3c-keyname/-/w3c-keyname-2.2.8.tgz#7b17c8c6883d4e8b86ac8aba79d39e880f8869c5" + integrity sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ== + w3c-xmlserializer@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz#30485ca7d70a6fd052420a3d12fd90e6339ce794" @@ -17365,6 +21274,11 @@ webpack-subresource-integrity@5.0.0: dependencies: typed-assert "^1.0.8" +webpack-virtual-modules@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz#057faa9065c8acf48f24cb57ac0e77739ab9a7e8" + integrity sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ== + webpack@5.65.0: version "5.65.0" resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.65.0.tgz#ed2891d9145ba1f0d318e4ea4f89c3fa18e6f9be" @@ -17438,6 +21352,11 @@ whatwg-url@^7.0.0: tr46 "^1.0.1" webidl-conversions "^4.0.2" +wheel-gestures@^2.2.5: + version "2.2.48" + resolved "https://registry.yarnpkg.com/wheel-gestures/-/wheel-gestures-2.2.48.tgz#7b84b2522e66962efb50b5fe7e4a55503061255e" + integrity sha512-f+Gy33Oa5Z14XY9679Zze+7VFhbsQfBFXodnU2x589l4kxGM9L5Y8zETTmcMR5pWOPQyRv4Z0lNax6xCO0NSlA== + which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" @@ -17578,7 +21497,16 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@7.0.0, wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@7.0.0, wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -17762,6 +21690,11 @@ yaml@^1.10.0, yaml@^1.10.2, yaml@^1.7.2: resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== +yaml@^2.8.1: + version "2.8.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.8.2.tgz#5694f25eca0ce9c3e7a9d9e00ce0ddabbd9e35c5" + integrity sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A== + yamljs@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/yamljs/-/yamljs-0.3.0.tgz#dc060bf267447b39f7304e9b2bfbe8b5a7ddb03b" @@ -17914,3 +21847,8 @@ zone.js@~0.11.4: integrity sha512-82bctBg2hKcEJ21humWIkXRlLBBmrc3nN7DFh5LGGhcyycO2S7FN8NmdvlcKaGFDNVL4/9kFLmwmInTavdJERA== dependencies: tslib "^2.3.0" + +zwitch@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.4.tgz#c827d4b0acb76fc3e685a4c6ec2902d51070e9d7" + integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==