diff --git a/docs_app/content/guide/operators.md b/docs_app/content/guide/operators.md index 086e6a97b1..c8d2551260 100644 --- a/docs_app/content/guide/operators.md +++ b/docs_app/content/guide/operators.md @@ -152,7 +152,6 @@ These are Observable creation operators that also have join functionality -- emi - [`bufferWhen`](/api/operators/bufferWhen) - [`concatMap`](/api/operators/concatMap) - [`concatMapTo`](/api/operators/concatMapTo) -- [`exhaust`](/api/operators/exhaust) - [`exhaustMap`](/api/operators/exhaustMap) - [`expand`](/api/operators/expand) - [`groupBy`](/api/operators/groupBy) diff --git a/docs_app/content/guide/scheduler.md b/docs_app/content/guide/scheduler.md index 38de9d45d4..4496e13d5c 100644 --- a/docs_app/content/guide/scheduler.md +++ b/docs_app/content/guide/scheduler.md @@ -8,7 +8,7 @@ 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 `async` scheduler to use for delivering those values. +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 @@ -98,13 +98,13 @@ const proxyObserver = { }; ``` -The `async` 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 `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 `async` 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. +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 | | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | @@ -116,7 +116,7 @@ The `async` Scheduler is one of the built-in schedulers provided by RxJS. Each o ## 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, `queue` Scheduler is used. For operators which use timers, `async` is used. +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)`. @@ -146,4 +146,4 @@ Time-related operators like `bufferTime`, `debounceTime`, `delay`, `auditTime`, Other instance operators that take a Scheduler as argument: `cache`, `combineLatest`, `concat`, `expand`, `merge`, `publishReplay`, `startWith`. -Notice that both `cache` and `publishReplay` accept a Scheduler because they utilize a ReplaySubject. The constructor of a ReplaySubjects takes an optional Scheduler as the last argument because ReplaySubject may deal with time, which only makes sense in the context of a Scheduler. By default, a ReplaySubject uses the `queue` Scheduler to provide a clock. +Notice that both `cache` and `publishReplay` accept a Scheduler because they utilize a ReplaySubject. The constructor of a ReplaySubjects takes an optional Scheduler as the last argument because ReplaySubject may deal with time, which only makes sense in the context of a Scheduler. By default, a ReplaySubject uses the `queueScheduler` Scheduler to provide a clock. diff --git a/docs_app/src/assets/images/marble-diagrams/exhaust.png b/docs_app/src/assets/images/marble-diagrams/exhaustAll.png similarity index 100% rename from docs_app/src/assets/images/marble-diagrams/exhaust.png rename to docs_app/src/assets/images/marble-diagrams/exhaustAll.png diff --git a/spec-dtslint/operators/onErrorResumeNext-spec.ts b/spec-dtslint/operators/onErrorResumeNextWith-spec.ts similarity index 59% rename from spec-dtslint/operators/onErrorResumeNext-spec.ts rename to spec-dtslint/operators/onErrorResumeNextWith-spec.ts index 5920e00481..75be8efe32 100644 --- a/spec-dtslint/operators/onErrorResumeNext-spec.ts +++ b/spec-dtslint/operators/onErrorResumeNextWith-spec.ts @@ -1,51 +1,51 @@ import { of } from 'rxjs'; -import { onErrorResumeNext } from 'rxjs/operators'; +import { onErrorResumeNextWith } from 'rxjs/operators'; it('should infer correctly', () => { - const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNext()); // $ExpectType Observable + const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNextWith()); // $ExpectType Observable }); it('should accept one input', () => { - const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNext(of(1))); // $ExpectType Observable - const p = of('apple', 'banana', 'peach').pipe(onErrorResumeNext(of('5'))); // $ExpectType Observable + const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNextWith(of(1))); // $ExpectType Observable + const p = of('apple', 'banana', 'peach').pipe(onErrorResumeNextWith(of('5'))); // $ExpectType Observable }); it('should accept promises', () => { - const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNext(Promise.resolve(5))); // $ExpectType Observable + const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNextWith(Promise.resolve(5))); // $ExpectType Observable }); it('should accept iterables', () => { - const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNext('foo')); // $ExpectType Observable + const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNextWith('foo')); // $ExpectType Observable }); it('should accept arrays', () => { - const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNext([5])); // $ExpectType Observable + const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNextWith([5])); // $ExpectType Observable }); it('should accept two inputs', () => { - const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNext(of(1), of(2))); // $ExpectType Observable + const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNextWith(of(1), of(2))); // $ExpectType Observable }); it('should accept three inputs', () => { - const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNext(of(1), of(2), of('3'))); // $ExpectType Observable + const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNextWith(of(1), of(2), of('3'))); // $ExpectType Observable }); it('should accept four inputs', () => { - const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNext(of(1), of(2), of('3'), of('4'))); // $ExpectType Observable + const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNextWith(of(1), of(2), of('3'), of('4'))); // $ExpectType Observable }); it('should accept five inputs', () => { - const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNext(of(1), of(2), of('3'), of('4'), of(5))); // $ExpectType Observable + const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNextWith(of(1), of(2), of('3'), of('4'), of(5))); // $ExpectType Observable }); it('should accept six inputs', () => { - const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNext(of(1), of(2), of('3'), of('4'), of(5), of('6'))); // $ExpectType Observable + const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNextWith(of(1), of(2), of('3'), of('4'), of(5), of('6'))); // $ExpectType Observable }); it('should accept seven and more inputs', () => { - const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNext(of(1), of(2), of('3'), of('4'), of(5), of('6'), of(7))); // $ExpectType Observable + const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNextWith(of(1), of(2), of('3'), of('4'), of(5), of('6'), of(7))); // $ExpectType Observable }); it('should enforce types', () => { - const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNext(5)); // $ExpectError -}); \ No newline at end of file + const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNextWith(5)); // $ExpectError +}); diff --git a/spec/helpers/setup.ts b/spec/helpers/setup.ts index a18b3b0bb0..17af84a536 100644 --- a/spec/helpers/setup.ts +++ b/spec/helpers/setup.ts @@ -17,7 +17,7 @@ if (!(Symbol as any).observable) { (Symbol as any).observable = Symbol('Symbol.observable polyfill from RxJS Testing'); } -/** Polyfill requestAnimationFrame for testing animationFrame scheduler in Node */ +/** Polyfill requestAnimationFrame for testing animationFrameScheduler scheduler in Node */ // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating diff --git a/spec/index-spec.ts b/spec/index-spec.ts index fbdc049b27..551bd5e996 100644 --- a/spec/index-spec.ts +++ b/spec/index-spec.ts @@ -84,7 +84,6 @@ describe('index', () => { expect(index.bufferToggle).to.exist; expect(index.bufferWhen).to.exist; expect(index.catchError).to.exist; - expect(index.combineAll).to.exist; expect(index.combineLatestAll).to.exist; expect(index.combineLatestWith).to.exist; expect(index.concatAll).to.exist; @@ -105,7 +104,6 @@ describe('index', () => { expect(index.elementAt).to.exist; expect(index.endWith).to.exist; expect(index.every).to.exist; - expect(index.exhaust).to.exist; expect(index.exhaustAll).to.exist; expect(index.exhaustMap).to.exist; expect(index.expand).to.exist; @@ -123,7 +121,6 @@ describe('index', () => { expect(index.materialize).to.exist; expect(index.max).to.exist; expect(index.mergeAll).to.exist; - expect(index.flatMap).to.exist; expect(index.mergeMap).to.exist; expect(index.mergeMapTo).to.exist; expect(index.mergeScan).to.exist; diff --git a/spec/operators/exhaustAll-spec.ts b/spec/operators/exhaustAll-spec.ts index 4ad593c1b2..01f42492b5 100644 --- a/spec/operators/exhaustAll-spec.ts +++ b/spec/operators/exhaustAll-spec.ts @@ -4,8 +4,8 @@ import { TestScheduler } from 'rxjs/testing'; import { of, Observable } from 'rxjs'; import { observableMatcher } from '../helpers/observableMatcher'; -/** @test {exhaust} */ -describe('exhaust', () => { +/** @test {exhaustAll} */ +describe('exhaustAll', () => { let testScheduler: TestScheduler; beforeEach(() => { diff --git a/spec/operators/index-spec.ts b/spec/operators/index-spec.ts index ad9251b364..fcfa639eef 100644 --- a/spec/operators/index-spec.ts +++ b/spec/operators/index-spec.ts @@ -11,7 +11,6 @@ describe('operators/index', () => { expect(index.bufferToggle).to.exist; expect(index.bufferWhen).to.exist; expect(index.catchError).to.exist; - expect(index.combineAll).to.exist; expect(index.combineLatestAll).to.exist; expect(index.concatAll).to.exist; expect(index.concatMap).to.exist; @@ -28,7 +27,6 @@ describe('operators/index', () => { expect(index.distinctUntilKeyChanged).to.exist; expect(index.elementAt).to.exist; expect(index.every).to.exist; - expect(index.exhaust).to.exist; expect(index.exhaustAll).to.exist; expect(index.exhaustMap).to.exist; expect(index.expand).to.exist; @@ -47,7 +45,6 @@ describe('operators/index', () => { expect(index.max).to.exist; expect(index.mergeAll).to.exist; expect(index.mergeMap).to.exist; - expect(index.flatMap).to.exist; expect(index.mergeMap).to.exist; expect(index.mergeMapTo).to.exist; expect(index.mergeScan).to.exist; diff --git a/spec/operators/onErrorResumeNext-spec.ts b/spec/operators/onErrorResumeNext-spec.ts index 19cf8b407f..4daf786611 100644 --- a/spec/operators/onErrorResumeNext-spec.ts +++ b/spec/operators/onErrorResumeNext-spec.ts @@ -1,11 +1,11 @@ import { expect } from 'chai'; import { TestScheduler } from 'rxjs/testing'; -import { onErrorResumeNext, take, finalize, tap } from 'rxjs/operators'; +import { onErrorResumeNextWith, take, finalize, tap } from 'rxjs/operators'; import { concat, throwError, of, Observable } from 'rxjs'; import { asInteropObservable } from '../helpers/interop-helper'; import { observableMatcher } from '../helpers/observableMatcher'; -describe('onErrorResumeNext', () => { +describe('onErrorResumeNextWith', () => { let testScheduler: TestScheduler; beforeEach(() => { @@ -20,7 +20,7 @@ describe('onErrorResumeNext', () => { const e2subs = ' --------^-------!'; const expected = '--a--b----c--d--|'; - expectObservable(e1.pipe(onErrorResumeNext(e2))).toBe(expected); + expectObservable(e1.pipe(onErrorResumeNextWith(e2))).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); expectSubscriptions(e2.subscriptions).toBe(e2subs); }); @@ -34,7 +34,7 @@ describe('onErrorResumeNext', () => { const e2subs = ' --------^-------!'; const expected = '--a--b----c--d--|'; - expectObservable(e1.pipe(onErrorResumeNext(e2))).toBe(expected); + expectObservable(e1.pipe(onErrorResumeNextWith(e2))).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); expectSubscriptions(e2.subscriptions).toBe(e2subs); }); @@ -56,7 +56,7 @@ describe('onErrorResumeNext', () => { ]; const expected = '--a--b----c--d----e----f--g--|'; - expectObservable(e1.pipe(onErrorResumeNext(e2))).toBe(expected); + expectObservable(e1.pipe(onErrorResumeNextWith(e2))).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); expectSubscriptions(e2[0].subscriptions).toBe(e2subs[0]); expectSubscriptions(e2[1].subscriptions).toBe(e2subs[1]); @@ -76,7 +76,7 @@ describe('onErrorResumeNext', () => { const e4subs = ' ---------------------^-------!'; const expected = '--a--b----c--d----e----f--g--|'; - expectObservable(e1.pipe(onErrorResumeNext(e2, e3, e4))).toBe(expected); + expectObservable(e1.pipe(onErrorResumeNextWith(e2, e3, e4))).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); expectSubscriptions(e2.subscriptions).toBe(e2subs); expectSubscriptions(e3.subscriptions).toBe(e3subs); @@ -96,7 +96,7 @@ describe('onErrorResumeNext', () => { const e4subs = ' ---------------------^-------!'; const expected = '--a--b----c--d----e----f--g--|'; - expectObservable(e1.pipe(onErrorResumeNext(e2, e3, e4))).toBe(expected); + expectObservable(e1.pipe(onErrorResumeNextWith(e2, e3, e4))).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); expectSubscriptions(e2.subscriptions).toBe(e2subs); expectSubscriptions(e3.subscriptions).toBe(e3subs); @@ -116,7 +116,7 @@ describe('onErrorResumeNext', () => { const e4subs = ' -------------^-------!'; const expected = '--c--d----e----f--g--|'; - expectObservable(e1.pipe(onErrorResumeNext(e2, e3, e4))).toBe(expected); + expectObservable(e1.pipe(onErrorResumeNextWith(e2, e3, e4))).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); expectSubscriptions(e2.subscriptions).toBe(e2subs); expectSubscriptions(e3.subscriptions).toBe(e3subs); @@ -132,7 +132,7 @@ describe('onErrorResumeNext', () => { const e2subs = ' --------^-'; const expected = '--a--b----'; - expectObservable(e1.pipe(onErrorResumeNext(e2))).toBe(expected); + expectObservable(e1.pipe(onErrorResumeNextWith(e2))).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); expectSubscriptions(e2.subscriptions).toBe(e2subs); }); @@ -146,7 +146,7 @@ describe('onErrorResumeNext', () => { const e2subs: string[] = []; const expected = '--a--'; - expectObservable(e1.pipe(onErrorResumeNext(e2))).toBe(expected); + expectObservable(e1.pipe(onErrorResumeNextWith(e2))).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); expectSubscriptions(e2.subscriptions).toBe(e2subs); }); @@ -160,7 +160,7 @@ describe('onErrorResumeNext', () => { const e2subs = ' --------^-------!'; const expected = '--a--b----c--d--|'; - expectObservable(e1.pipe(onErrorResumeNext(e2))).toBe(expected); + expectObservable(e1.pipe(onErrorResumeNextWith(e2))).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); expectSubscriptions(e2.subscriptions).toBe(e2subs); }); @@ -178,7 +178,7 @@ describe('onErrorResumeNext', () => { }); throwError(() => new Error('Some error')) - .pipe(onErrorResumeNext(synchronousObservable), take(3)) + .pipe(onErrorResumeNextWith(synchronousObservable), take(3)) .subscribe(() => { /* noop */ }); @@ -201,7 +201,7 @@ describe('onErrorResumeNext', () => { // test ensures that unsubscriptions are chained all the way to the // interop subscriber. - expectObservable(e1.pipe(onErrorResumeNext(asInteropObservable(e2))), unsub).toBe(expected); + expectObservable(e1.pipe(onErrorResumeNextWith(asInteropObservable(e2))), unsub).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); expectSubscriptions(e2.subscriptions).toBe(e2subs); }); @@ -214,7 +214,7 @@ describe('onErrorResumeNext', () => { throwError(() => 'meh') ); - source.pipe(onErrorResumeNext(Promise.resolve(2))).subscribe({ + source.pipe(onErrorResumeNextWith(Promise.resolve(2))).subscribe({ next: (x) => { expect(expected.shift()).to.equal(x); }, @@ -232,7 +232,7 @@ describe('onErrorResumeNext', () => { const results: any[] = []; of(1) - .pipe(onErrorResumeNext([2, 3, 4], { notValid: 'LOL' } as any, of(5, 6))) + .pipe(onErrorResumeNextWith([2, 3, 4], { notValid: 'LOL' } as any, of(5, 6))) .subscribe({ next: (value) => results.push(value), complete: () => results.push('complete'), @@ -247,7 +247,7 @@ describe('onErrorResumeNext', () => { of(1) .pipe( finalize(() => results.push('finalize 1')), - onErrorResumeNext( + onErrorResumeNextWith( of(2).pipe(finalize(() => results.push('finalize 2'))), of(3).pipe(finalize(() => results.push('finalize 3'))), of(4).pipe(finalize(() => results.push('finalize 4'))) @@ -270,7 +270,7 @@ describe('onErrorResumeNext', () => { subscribe: () => results.push('subscribe 1'), finalize: () => results.push('finalize 1'), }), - onErrorResumeNext( + onErrorResumeNextWith( of(2).pipe( tap({ subscribe: () => results.push('subscribe 2'), diff --git a/spec/operators/share-spec.ts b/spec/operators/share-spec.ts index 2fd7f0588f..b38aed486c 100644 --- a/spec/operators/share-spec.ts +++ b/spec/operators/share-spec.ts @@ -4,7 +4,7 @@ import { map, mergeMap, mergeMapTo, - onErrorResumeNext, + onErrorResumeNextWith, repeat, retry, share, @@ -906,7 +906,7 @@ describe('share', () => { const sharedSource = source.pipe(share({ resetOnError: () => reset, resetOnRefCountZero })); - const result = concat(sharedSource.pipe(onErrorResumeNext(firstPause)), sharedSource); + const result = concat(sharedSource.pipe(onErrorResumeNextWith(firstPause)), sharedSource); expectObservable(result, subscription).toBe(expected); expectSubscriptions(source.subscriptions).toBe(sourceSubs); diff --git a/spec/schedulers/TestScheduler-spec.ts b/spec/schedulers/TestScheduler-spec.ts index 686095ea23..5bfd213184 100644 --- a/spec/schedulers/TestScheduler-spec.ts +++ b/spec/schedulers/TestScheduler-spec.ts @@ -736,7 +736,7 @@ describe('TestScheduler', () => { }); describe('schedulers', () => { - it('should support animationFrame, async and asap schedulers', () => { + it('should support animationFrameScheduler, async and asap schedulers', () => { const testScheduler = new TestScheduler(assertDeepEquals); testScheduler.run(({ animate, cold, expectObservable, time }) => { animate(' ---------x'); diff --git a/src/index.ts b/src/index.ts index 6a154053a4..713a6129f1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,10 +27,10 @@ export { ReplaySubject } from './internal/ReplaySubject'; export { AsyncSubject } from './internal/AsyncSubject'; /* Schedulers */ -export { asap, asapScheduler } from './internal/scheduler/asap'; -export { async, asyncScheduler } from './internal/scheduler/async'; -export { queue, queueScheduler } from './internal/scheduler/queue'; -export { animationFrame, animationFrameScheduler } from './internal/scheduler/animationFrame'; +export { asapScheduler } from './internal/scheduler/asap'; +export { asyncScheduler } from './internal/scheduler/async'; +export { queueScheduler } from './internal/scheduler/queue'; +export { animationFrameScheduler } from './internal/scheduler/animationFrame'; export { VirtualTimeScheduler, VirtualAction } from './internal/scheduler/VirtualTimeScheduler'; export { Scheduler } from './internal/Scheduler'; @@ -103,7 +103,6 @@ export { bufferTime } from './internal/operators/bufferTime'; export { bufferToggle } from './internal/operators/bufferToggle'; export { bufferWhen } from './internal/operators/bufferWhen'; export { catchError } from './internal/operators/catchError'; -export { combineAll } from './internal/operators/combineAll'; export { combineLatestAll } from './internal/operators/combineLatestAll'; export { combineLatestWith } from './internal/operators/combineLatestWith'; export { concatAll } from './internal/operators/concatAll'; @@ -124,7 +123,6 @@ export { distinctUntilKeyChanged } from './internal/operators/distinctUntilKeyCh export { elementAt } from './internal/operators/elementAt'; export { endWith } from './internal/operators/endWith'; export { every } from './internal/operators/every'; -export { exhaust } from './internal/operators/exhaust'; export { exhaustAll } from './internal/operators/exhaustAll'; export { exhaustMap } from './internal/operators/exhaustMap'; export { expand } from './internal/operators/expand'; @@ -142,7 +140,6 @@ export { mapTo } from './internal/operators/mapTo'; export { materialize } from './internal/operators/materialize'; export { max } from './internal/operators/max'; export { mergeAll } from './internal/operators/mergeAll'; -export { flatMap } from './internal/operators/flatMap'; export { mergeMap } from './internal/operators/mergeMap'; export { mergeMapTo } from './internal/operators/mergeMapTo'; export { mergeScan } from './internal/operators/mergeScan'; diff --git a/src/internal/observable/generate.ts b/src/internal/observable/generate.ts index e8af3036fd..7010936d53 100644 --- a/src/internal/observable/generate.ts +++ b/src/internal/observable/generate.ts @@ -136,7 +136,7 @@ export function generate( * `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 `async` scheduler. Note that + * 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. * * diff --git a/src/internal/observable/interval.ts b/src/internal/observable/interval.ts index fc1b3e0a77..df709f3dd6 100644 --- a/src/internal/observable/interval.ts +++ b/src/internal/observable/interval.ts @@ -15,7 +15,7 @@ import { timer } from './timer'; * 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 - * `async` {@link SchedulerLike} to provide a notion of time, but you may pass any + * `asyncScheduler` {@link SchedulerLike} to provide a notion of time, but you may pass any * {@link SchedulerLike} to it. * * ## Example @@ -43,7 +43,7 @@ import { timer } from './timer'; * * @param {number} [period=0] The interval size in milliseconds (by default) * or the time unit determined by the scheduler's clock. - * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for scheduling + * @param {SchedulerLike} [scheduler=asyncScheduler] The {@link SchedulerLike} to use for scheduling * the emission of values, and providing a notion of "time". * @return {Observable} An Observable that emits a sequential number each time * interval. diff --git a/src/internal/observable/timer.ts b/src/internal/observable/timer.ts index 09f4a903e2..22c8a2584d 100644 --- a/src/internal/observable/timer.ts +++ b/src/internal/observable/timer.ts @@ -1,6 +1,6 @@ import { Observable } from '../Observable'; import { SchedulerLike } from '../types'; -import { async as asyncScheduler } from '../scheduler/async'; +import { asyncScheduler } from '../scheduler/async'; import { isScheduler } from '../util/isScheduler'; import { isValidDate } from '../util/isDate'; diff --git a/src/internal/operators/auditTime.ts b/src/internal/operators/auditTime.ts index af83889db9..49169b1569 100644 --- a/src/internal/operators/auditTime.ts +++ b/src/internal/operators/auditTime.ts @@ -45,7 +45,7 @@ import { MonoTypeOperatorFunction, SchedulerLike } from '../types'; * @param {number} duration Time to wait before emitting the most recent source * value, measured in milliseconds or the time unit determined internally * by the optional `scheduler`. - * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for + * @param {SchedulerLike} [scheduler=asyncScheduler] The {@link SchedulerLike} to use for * managing the timers that handle the rate-limiting behavior. * @return A function that returns an Observable that performs rate-limiting of * emissions from the source Observable. diff --git a/src/internal/operators/catchError.ts b/src/internal/operators/catchError.ts index 39eeb98acd..b2a251783c 100644 --- a/src/internal/operators/catchError.ts +++ b/src/internal/operators/catchError.ts @@ -92,7 +92,7 @@ export function catchError>( * // 1, 2, 3, error in source. Details: four! * ``` * - * @see {@link onErrorResumeNext} + * @see {@link onErrorResumeNextWith} * @see {@link repeat} * @see {@link repeatWhen} * @see {@link retry } diff --git a/src/internal/operators/combineAll.ts b/src/internal/operators/combineAll.ts deleted file mode 100644 index c24157e08b..0000000000 --- a/src/internal/operators/combineAll.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { combineLatestAll } from './combineLatestAll'; - -/** - * @deprecated Renamed to {@link combineLatestAll}. Will be removed in v8. - */ -export const combineAll = combineLatestAll; diff --git a/src/internal/operators/debounceTime.ts b/src/internal/operators/debounceTime.ts index 1bbbe4dbc2..e375592b3c 100644 --- a/src/internal/operators/debounceTime.ts +++ b/src/internal/operators/debounceTime.ts @@ -55,7 +55,7 @@ import { createOperatorSubscriber } from './OperatorSubscriber'; * 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. - * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for + * @param {SchedulerLike} [scheduler=asyncScheduler] The {@link SchedulerLike} to use for * managing the timers that handle the timeout for each value. * @return A function that returns an Observable that delays the emissions of * the source Observable by the specified `dueTime`, and may drop some values diff --git a/src/internal/operators/delay.ts b/src/internal/operators/delay.ts index 64dd894b29..e823e46f14 100644 --- a/src/internal/operators/delay.ts +++ b/src/internal/operators/delay.ts @@ -54,7 +54,7 @@ import { timer } from '../observable/timer'; * * @param {number|Date} due The delay duration in milliseconds (a `number`) or * a `Date` until which the emission of the source items is delayed. - * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for + * @param {SchedulerLike} [scheduler=asyncScheduler] The {@link SchedulerLike} to use for * managing the timers that handle the time-shift for each item. * @return A function that returns an Observable that delays the emissions of * the source Observable by the specified timeout or Date. diff --git a/src/internal/operators/exhaust.ts b/src/internal/operators/exhaust.ts deleted file mode 100644 index a4410dbfdf..0000000000 --- a/src/internal/operators/exhaust.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { exhaustAll } from './exhaustAll'; - -/** - * @deprecated Renamed to {@link exhaustAll}. Will be removed in v8. - */ -export const exhaust = exhaustAll; diff --git a/src/internal/operators/exhaustAll.ts b/src/internal/operators/exhaustAll.ts index 8004306be1..af85e14e84 100644 --- a/src/internal/operators/exhaustAll.ts +++ b/src/internal/operators/exhaustAll.ts @@ -9,7 +9,7 @@ import { identity } from '../util/identity'; * Flattens an Observable-of-Observables by dropping the * next inner Observables while the current inner is still executing. * - * ![](exhaust.png) + * ![](exhaustAll.png) * * `exhaustAll` subscribes to an Observable that emits Observables, also known as a * higher-order Observable. Each time it observes one of these emitted inner diff --git a/src/internal/operators/exhaustMap.ts b/src/internal/operators/exhaustMap.ts index 301153eba8..9d632e3fa4 100644 --- a/src/internal/operators/exhaustMap.ts +++ b/src/internal/operators/exhaustMap.ts @@ -9,7 +9,7 @@ import { createOperatorSubscriber } from './OperatorSubscriber'; * Observable only if the previous projected Observable has completed. * * Maps each value to an Observable, then flattens all of - * these inner Observables using {@link exhaust}. + * these inner Observables using {@link exhaustAll}. * * ![](exhaustMap.png) * @@ -37,7 +37,7 @@ import { createOperatorSubscriber } from './OperatorSubscriber'; * ``` * * @see {@link concatMap} - * @see {@link exhaust} + * @see {@link exhaustAll} * @see {@link mergeMap} * @see {@link switchMap} * diff --git a/src/internal/operators/flatMap.ts b/src/internal/operators/flatMap.ts deleted file mode 100644 index 817917cd76..0000000000 --- a/src/internal/operators/flatMap.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { mergeMap } from './mergeMap'; - -/** - * @deprecated Renamed to {@link mergeMap}. Will be removed in v8. - */ -export const flatMap = mergeMap; diff --git a/src/internal/operators/observeOn.ts b/src/internal/operators/observeOn.ts index bd37111fc9..21beb2a801 100644 --- a/src/internal/operators/observeOn.ts +++ b/src/internal/operators/observeOn.ts @@ -42,7 +42,7 @@ import { createOperatorSubscriber } from './OperatorSubscriber'; * const intervals = interval(10); // Intervals are scheduled * // with async scheduler by default... * intervals.pipe( - * observeOn(animationFrameScheduler) // ...but we will observe on animationFrame + * observeOn(animationFrameScheduler) // ...but we will observe on animationFrameScheduler * ) // scheduler to ensure smooth animation. * .subscribe(val => { * someDiv.style.height = val + 'px'; diff --git a/src/internal/operators/onErrorResumeNextWith.ts b/src/internal/operators/onErrorResumeNextWith.ts index c67d0a82f8..02eaceb581 100644 --- a/src/internal/operators/onErrorResumeNextWith.ts +++ b/src/internal/operators/onErrorResumeNextWith.ts @@ -92,8 +92,3 @@ export function onErrorResumeNextWith( return (source) => oERNCreate(source, ...nextSources); } - -/** - * @deprecated Renamed. Use {@link onErrorResumeNextWith} instead. Will be removed in v8. - */ -export const onErrorResumeNext = onErrorResumeNextWith; diff --git a/src/internal/operators/sampleTime.ts b/src/internal/operators/sampleTime.ts index 6558fa03ab..28ce5b3c96 100644 --- a/src/internal/operators/sampleTime.ts +++ b/src/internal/operators/sampleTime.ts @@ -40,7 +40,7 @@ import { interval } from '../observable/interval'; * * @param {number} period The sampling period expressed in milliseconds or the * time unit determined internally by the optional `scheduler`. - * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for + * @param {SchedulerLike} [scheduler=asyncScheduler] The {@link SchedulerLike} to use for * managing the timers that handle the sampling. * @return A function that returns an Observable that emits the results of * sampling the values emitted by the source Observable at the specified time diff --git a/src/internal/operators/timeoutWith.ts b/src/internal/operators/timeoutWith.ts index 1a4d0ca97e..85d77ff8df 100644 --- a/src/internal/operators/timeoutWith.ts +++ b/src/internal/operators/timeoutWith.ts @@ -1,4 +1,4 @@ -import { async } from '../scheduler/async'; +import { asyncScheduler } from '../scheduler/async'; import { isValidDate } from '../util/isDate'; import { ObservableInput, OperatorFunction, SchedulerLike } from '../types'; import { timeout } from './timeout'; @@ -88,7 +88,7 @@ export function timeoutWith( let first: number | Date | undefined; let each: number | undefined; let _with: () => ObservableInput; - scheduler = scheduler ?? async; + scheduler = scheduler ?? asyncScheduler; if (isValidDate(due)) { first = due; diff --git a/src/internal/scheduler/animationFrame.ts b/src/internal/scheduler/animationFrame.ts index 2ce033df43..aa7db49374 100644 --- a/src/internal/scheduler/animationFrame.ts +++ b/src/internal/scheduler/animationFrame.ts @@ -7,10 +7,10 @@ import { AnimationFrameScheduler } from './AnimationFrameScheduler'; * * Perform task when `window.requestAnimationFrame` would fire * - * When `animationFrame` scheduler is used with delay, it will fall back to {@link asyncScheduler} scheduler - * behaviour. + * When `animationFrameScheduler` scheduler is used with delay, it will fall back to {@link asyncScheduler} + * scheduler behaviour. * - * Without delay, `animationFrame` scheduler can be used to create smooth browser animations. + * 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. * @@ -34,8 +34,3 @@ import { AnimationFrameScheduler } from './AnimationFrameScheduler'; */ export const animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction); - -/** - * @deprecated Renamed to {@link animationFrameScheduler}. Will be removed in v8. - */ -export const animationFrame = animationFrameScheduler; diff --git a/src/internal/scheduler/asap.ts b/src/internal/scheduler/asap.ts index 5be1be4ea8..6c5e7b52e6 100644 --- a/src/internal/scheduler/asap.ts +++ b/src/internal/scheduler/asap.ts @@ -7,19 +7,19 @@ import { AsapScheduler } from './AsapScheduler'; * * Perform task as fast as it can be performed asynchronously * - * `asap` scheduler behaves the same as {@link asyncScheduler} scheduler when you use it to delay task + * `asapScheduler` scheduler behaves the same as {@link asyncScheduler} 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. * - * `asap` scheduler will do its best to minimize time between end of currently executing code + * `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 `asap` 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 `asap` before, + * 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, `asap` scheduler is your best bet. + * as soon as possible, `asapScheduler` scheduler is your best bet. * * ## Example * Compare async and asap scheduler< @@ -37,8 +37,3 @@ import { AsapScheduler } from './AsapScheduler'; */ export const asapScheduler = new AsapScheduler(AsapAction); - -/** - * @deprecated Renamed to {@link asapScheduler}. Will be removed in v8. - */ -export const asap = asapScheduler; diff --git a/src/internal/scheduler/async.ts b/src/internal/scheduler/async.ts index 76f9dc860d..5353c58d73 100644 --- a/src/internal/scheduler/async.ts +++ b/src/internal/scheduler/async.ts @@ -7,7 +7,7 @@ import { AsyncScheduler } from './AsyncScheduler'; * * Schedule task as if you used setTimeout(task, duration) * - * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript + * `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. * @@ -49,8 +49,3 @@ import { AsyncScheduler } from './AsyncScheduler'; */ export const asyncScheduler = new AsyncScheduler(AsyncAction); - -/** - * @deprecated Renamed to {@link asyncScheduler}. Will be removed in v8. - */ -export const async = asyncScheduler; diff --git a/src/internal/scheduler/queue.ts b/src/internal/scheduler/queue.ts index df4e2162cd..6931932a64 100644 --- a/src/internal/scheduler/queue.ts +++ b/src/internal/scheduler/queue.ts @@ -7,14 +7,14 @@ import { QueueScheduler } from './QueueScheduler'; * * Put every next task on a queue, instead of executing it immediately * - * `queue` scheduler, when used with delay, behaves the same as {@link asyncScheduler} scheduler. + * `queueScheduler` scheduler, when used with delay, behaves the same as {@link asyncScheduler} 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 `queue` scheduler, you are sure it will end + * 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 @@ -65,8 +65,3 @@ import { QueueScheduler } from './QueueScheduler'; */ export const queueScheduler = new QueueScheduler(QueueAction); - -/** - * @deprecated Renamed to {@link queueScheduler}. Will be removed in v8. - */ -export const queue = queueScheduler; diff --git a/src/internal/types.ts b/src/internal/types.ts index e640c1c994..5b7f8d42d0 100644 --- a/src/internal/types.ts +++ b/src/internal/types.ts @@ -91,11 +91,6 @@ export type ObservableInput = | Iterable | ReadableStreamLike; -/** - * @deprecated Renamed to {@link InteropObservable }. Will be removed in v8. - */ -export type ObservableLike = InteropObservable; - /** * An object that implements the `Symbol.observable` interface. */ @@ -214,11 +209,6 @@ export type ObservedValueOf = O extends ObservableInput ? T : never; */ export type ObservedValueUnionFromArray = X extends Array> ? T : never; -/** - * @deprecated Renamed to {@link ObservedValueUnionFromArray}. Will be removed in v8. - */ -export type ObservedValuesFromArray = ObservedValueUnionFromArray; - /** * Extracts a tuple of element types from an `ObservableInput[]`. * If you have `O extends ObservableInput[]` and you pass in diff --git a/src/operators/index.ts b/src/operators/index.ts index 61fcd831c9..1e95539e2c 100644 --- a/src/operators/index.ts +++ b/src/operators/index.ts @@ -7,7 +7,6 @@ export { bufferTime } from '../internal/operators/bufferTime'; export { bufferToggle } from '../internal/operators/bufferToggle'; export { bufferWhen } from '../internal/operators/bufferWhen'; export { catchError } from '../internal/operators/catchError'; -export { combineAll } from '../internal/operators/combineAll'; export { combineLatestAll } from '../internal/operators/combineLatestAll'; export { combineLatestWith } from '../internal/operators/combineLatestWith'; export { concatAll } from '../internal/operators/concatAll'; @@ -28,7 +27,6 @@ export { distinctUntilKeyChanged } from '../internal/operators/distinctUntilKeyC export { elementAt } from '../internal/operators/elementAt'; export { endWith } from '../internal/operators/endWith'; export { every } from '../internal/operators/every'; -export { exhaust } from '../internal/operators/exhaust'; export { exhaustAll } from '../internal/operators/exhaustAll'; export { exhaustMap } from '../internal/operators/exhaustMap'; export { expand } from '../internal/operators/expand'; @@ -47,7 +45,6 @@ export { materialize } from '../internal/operators/materialize'; export { max } from '../internal/operators/max'; export { merge } from '../internal/operators/merge'; export { mergeAll } from '../internal/operators/mergeAll'; -export { flatMap } from '../internal/operators/flatMap'; export { mergeMap } from '../internal/operators/mergeMap'; export { mergeMapTo } from '../internal/operators/mergeMapTo'; export { mergeScan } from '../internal/operators/mergeScan'; @@ -55,7 +52,7 @@ export { mergeWith } from '../internal/operators/mergeWith'; export { min } from '../internal/operators/min'; export { multicast } from '../internal/operators/multicast'; export { observeOn } from '../internal/operators/observeOn'; -export { onErrorResumeNext } from '../internal/operators/onErrorResumeNextWith'; +export { onErrorResumeNextWith } from '../internal/operators/onErrorResumeNextWith'; export { pairwise } from '../internal/operators/pairwise'; export { partition } from '../internal/operators/partition'; export { pluck } from '../internal/operators/pluck';