From b1f8bfe9e09be736a098392d0b67050030311438 Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Thu, 11 Jan 2018 21:13:37 -0800 Subject: [PATCH] feat(reorganize): operators all exported from `rxjs/operators` BREAKING CHANGE: THIS NEGATES THE PREVIOUS BREAKING CHANGES TO OPERATOR MOVE TO `rxjs`, UPDATE CHANGELOG ON RELEASE --- spec/index-spec.ts | 98 --------------------------------- spec/operators/index-spec.ts | 102 ++++++++++++++++++++++++++++++++++ src/index.ts | 104 ----------------------------------- src/operators/index.ts | 104 +++++++++++++++++++++++++++++++++++ 4 files changed, 206 insertions(+), 202 deletions(-) create mode 100644 spec/operators/index-spec.ts create mode 100644 src/operators/index.ts diff --git a/spec/index-spec.ts b/spec/index-spec.ts index 89a08e295e..197157cefa 100644 --- a/spec/index-spec.ts +++ b/spec/index-spec.ts @@ -29,104 +29,6 @@ describe('index', () => { expect(index.zip).to.exist; }); - it('should export operators', () => { - expect(index.audit).to.exist; - expect(index.auditTime).to.exist; - expect(index.buffer).to.exist; - expect(index.bufferCount).to.exist; - expect(index.bufferTime).to.exist; - expect(index.bufferToggle).to.exist; - expect(index.bufferWhen).to.exist; - expect(index.catchError).to.exist; - expect(index.combineAll).to.exist; - expect(index.concatAll).to.exist; - expect(index.concatMap).to.exist; - expect(index.concatMapTo).to.exist; - expect(index.count).to.exist; - expect(index.debounce).to.exist; - expect(index.debounceTime).to.exist; - expect(index.defaultIfEmpty).to.exist; - expect(index.delay).to.exist; - expect(index.delayWhen).to.exist; - expect(index.dematerialize).to.exist; - expect(index.distinct).to.exist; - expect(index.distinctUntilChanged).to.exist; - expect(index.distinctUntilKeyChanged).to.exist; - expect(index.elementAt).to.exist; - expect(index.every).to.exist; - expect(index.exhaust).to.exist; - expect(index.exhaustMap).to.exist; - expect(index.expand).to.exist; - expect(index.filter).to.exist; - expect(index.finalize).to.exist; - expect(index.find).to.exist; - expect(index.findIndex).to.exist; - expect(index.first).to.exist; - expect(index.groupBy).to.exist; - expect(index.ignoreElements).to.exist; - expect(index.isEmpty).to.exist; - expect(index.last).to.exist; - expect(index.map).to.exist; - expect(index.mapTo).to.exist; - expect(index.materialize).to.exist; - expect(index.max).to.exist; - expect(index.mergeAll).to.exist; - expect(index.mergeMap).to.exist; - expect(index.mergeMap).to.exist; - expect(index.mergeMapTo).to.exist; - expect(index.mergeScan).to.exist; - expect(index.min).to.exist; - expect(index.multicast).to.exist; - expect(index.observeOn).to.exist; - expect(index.pairwise).to.exist; - expect(index.partition).to.exist; - expect(index.pluck).to.exist; - expect(index.publish).to.exist; - expect(index.publishBehavior).to.exist; - expect(index.publishLast).to.exist; - expect(index.publishReplay).to.exist; - expect(index.reduce).to.exist; - expect(index.repeat).to.exist; - expect(index.repeatWhen).to.exist; - expect(index.retry).to.exist; - expect(index.retryWhen).to.exist; - expect(index.refCount).to.exist; - expect(index.sample).to.exist; - expect(index.sampleTime).to.exist; - expect(index.scan).to.exist; - expect(index.sequenceEqual).to.exist; - expect(index.share).to.exist; - expect(index.shareReplay).to.exist; - expect(index.single).to.exist; - expect(index.skip).to.exist; - expect(index.skipLast).to.exist; - expect(index.skipUntil).to.exist; - expect(index.skipWhile).to.exist; - expect(index.startWith).to.exist; - expect(index.switchAll).to.exist; - expect(index.switchMap).to.exist; - expect(index.switchMapTo).to.exist; - expect(index.take).to.exist; - expect(index.takeLast).to.exist; - expect(index.takeUntil).to.exist; - expect(index.takeWhile).to.exist; - expect(index.tap).to.exist; - expect(index.throttle).to.exist; - expect(index.throttleTime).to.exist; - expect(index.timeInterval).to.exist; - expect(index.timeout).to.exist; - expect(index.timeoutWith).to.exist; - expect(index.timestamp).to.exist; - expect(index.toArray).to.exist; - expect(index.window).to.exist; - expect(index.windowCount).to.exist; - expect(index.windowTime).to.exist; - expect(index.windowToggle).to.exist; - expect(index.windowWhen).to.exist; - expect(index.withLatestFrom).to.exist; - expect(index.zipAll).to.exist; - }); - it('should export the Subject types', () => { expect(index.Subject).to.exist; expect(index.BehaviorSubject).to.exist; diff --git a/spec/operators/index-spec.ts b/spec/operators/index-spec.ts new file mode 100644 index 0000000000..cd84628a9f --- /dev/null +++ b/spec/operators/index-spec.ts @@ -0,0 +1,102 @@ +import * as index from '../../src/operators/index'; +import { expect } from 'chai'; + +describe('operators/index', () => { + it('should export operators', () => { + expect(index.audit).to.exist; + expect(index.auditTime).to.exist; + expect(index.buffer).to.exist; + expect(index.bufferCount).to.exist; + expect(index.bufferTime).to.exist; + expect(index.bufferToggle).to.exist; + expect(index.bufferWhen).to.exist; + expect(index.catchError).to.exist; + expect(index.combineAll).to.exist; + expect(index.concatAll).to.exist; + expect(index.concatMap).to.exist; + expect(index.concatMapTo).to.exist; + expect(index.count).to.exist; + expect(index.debounce).to.exist; + expect(index.debounceTime).to.exist; + expect(index.defaultIfEmpty).to.exist; + expect(index.delay).to.exist; + expect(index.delayWhen).to.exist; + expect(index.dematerialize).to.exist; + expect(index.distinct).to.exist; + expect(index.distinctUntilChanged).to.exist; + expect(index.distinctUntilKeyChanged).to.exist; + expect(index.elementAt).to.exist; + expect(index.every).to.exist; + expect(index.exhaust).to.exist; + expect(index.exhaustMap).to.exist; + expect(index.expand).to.exist; + expect(index.filter).to.exist; + expect(index.finalize).to.exist; + expect(index.find).to.exist; + expect(index.findIndex).to.exist; + expect(index.first).to.exist; + expect(index.groupBy).to.exist; + expect(index.ignoreElements).to.exist; + expect(index.isEmpty).to.exist; + expect(index.last).to.exist; + expect(index.map).to.exist; + expect(index.mapTo).to.exist; + expect(index.materialize).to.exist; + expect(index.max).to.exist; + expect(index.mergeAll).to.exist; + expect(index.mergeMap).to.exist; + expect(index.mergeMap).to.exist; + expect(index.mergeMapTo).to.exist; + expect(index.mergeScan).to.exist; + expect(index.min).to.exist; + expect(index.multicast).to.exist; + expect(index.observeOn).to.exist; + expect(index.pairwise).to.exist; + expect(index.partition).to.exist; + expect(index.pluck).to.exist; + expect(index.publish).to.exist; + expect(index.publishBehavior).to.exist; + expect(index.publishLast).to.exist; + expect(index.publishReplay).to.exist; + expect(index.reduce).to.exist; + expect(index.repeat).to.exist; + expect(index.repeatWhen).to.exist; + expect(index.retry).to.exist; + expect(index.retryWhen).to.exist; + expect(index.refCount).to.exist; + expect(index.sample).to.exist; + expect(index.sampleTime).to.exist; + expect(index.scan).to.exist; + expect(index.sequenceEqual).to.exist; + expect(index.share).to.exist; + expect(index.shareReplay).to.exist; + expect(index.single).to.exist; + expect(index.skip).to.exist; + expect(index.skipLast).to.exist; + expect(index.skipUntil).to.exist; + expect(index.skipWhile).to.exist; + expect(index.startWith).to.exist; + expect(index.switchAll).to.exist; + expect(index.switchMap).to.exist; + expect(index.switchMapTo).to.exist; + expect(index.take).to.exist; + expect(index.takeLast).to.exist; + expect(index.takeUntil).to.exist; + expect(index.takeWhile).to.exist; + expect(index.tap).to.exist; + expect(index.throttle).to.exist; + expect(index.throttleTime).to.exist; + expect(index.timeInterval).to.exist; + expect(index.timeout).to.exist; + expect(index.timeoutWith).to.exist; + expect(index.timestamp).to.exist; + expect(index.toArray).to.exist; + expect(index.window).to.exist; + expect(index.windowCount).to.exist; + expect(index.windowTime).to.exist; + expect(index.windowToggle).to.exist; + expect(index.windowWhen).to.exist; + expect(index.withLatestFrom).to.exist; + expect(index.zipAll).to.exist; + }); +}); diff --git a/src/index.ts b/src/index.ts index fffb338037..fd913e075b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -24,110 +24,6 @@ export { timer } from './internal/observable/timer'; export { using } from './internal/observable/using'; export { zip } from './internal/observable/zip'; -/* Operator exports */ -export { audit } from './internal/operators/audit'; -export { auditTime } from './internal/operators/auditTime'; -export { buffer } from './internal/operators/buffer'; -export { bufferCount } from './internal/operators/bufferCount'; -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 { concatAll } from './internal/operators/concatAll'; -export { concatMap } from './internal/operators/concatMap'; -export { concatMapTo } from './internal/operators/concatMapTo'; -export { count } from './internal/operators/count'; -export { debounce } from './internal/operators/debounce'; -export { debounceTime } from './internal/operators/debounceTime'; -export { defaultIfEmpty } from './internal/operators/defaultIfEmpty'; -export { delay } from './internal/operators/delay'; -export { delayWhen } from './internal/operators/delayWhen'; -export { dematerialize } from './internal/operators/dematerialize'; -export { distinct } from './internal/operators/distinct'; -export { distinctUntilChanged } from './internal/operators/distinctUntilChanged'; -export { distinctUntilKeyChanged } from './internal/operators/distinctUntilKeyChanged'; -export { elementAt } from './internal/operators/elementAt'; -export { every } from './internal/operators/every'; -export { exhaust } from './internal/operators/exhaust'; -export { exhaustMap } from './internal/operators/exhaustMap'; -export { expand } from './internal/operators/expand'; -export { filter } from './internal/operators/filter'; -export { finalize } from './internal/operators/finalize'; -export { find } from './internal/operators/find'; -export { findIndex } from './internal/operators/findIndex'; -export { first } from './internal/operators/first'; -export { groupBy } from './internal/operators/groupBy'; -export { ignoreElements } from './internal/operators/ignoreElements'; -export { isEmpty } from './internal/operators/isEmpty'; -export { last } from './internal/operators/last'; -export { map } from './internal/operators/map'; -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 { mergeMap } from './internal/operators/mergeMap'; -export { mergeMap as flatMap } from './internal/operators/mergeMap'; -export { mergeMapTo } from './internal/operators/mergeMapTo'; -export { mergeScan } from './internal/operators/mergeScan'; -export { min } from './internal/operators/min'; -export { multicast } from './internal/operators/multicast'; -export { observeOn } from './internal/operators/observeOn'; -export { pairwise } from './internal/operators/pairwise'; -export { partition } from './internal/operators/partition'; -export { pluck } from './internal/operators/pluck'; -export { publish } from './internal/operators/publish'; -export { publishBehavior } from './internal/operators/publishBehavior'; -export { publishLast } from './internal/operators/publishLast'; -export { publishReplay } from './internal/operators/publishReplay'; -export { reduce } from './internal/operators/reduce'; -export { repeat } from './internal/operators/repeat'; -export { repeatWhen } from './internal/operators/repeatWhen'; -export { retry } from './internal/operators/retry'; -export { retryWhen } from './internal/operators/retryWhen'; -export { refCount } from './internal/operators/refCount'; -export { sample } from './internal/operators/sample'; -export { sampleTime } from './internal/operators/sampleTime'; -export { scan } from './internal/operators/scan'; -export { sequenceEqual } from './internal/operators/sequenceEqual'; -export { share } from './internal/operators/share'; -export { shareReplay } from './internal/operators/shareReplay'; -export { single } from './internal/operators/single'; -export { skip } from './internal/operators/skip'; -export { skipLast } from './internal/operators/skipLast'; -export { skipUntil } from './internal/operators/skipUntil'; -export { skipWhile } from './internal/operators/skipWhile'; -export { startWith } from './internal/operators/startWith'; -/** - * TODO(https://github.com/ReactiveX/rxjs/issues/2900): Add back subscribeOn once it can be - * treeshaken. Currently if this export is added back, it - * forces apps to bring in asap scheduler along with - * Immediate, root, and other supporting code. - */ -// export { subscribeOn } from './internal/operators/subscribeOn'; -export { switchAll } from './internal/operators/switchAll'; -export { switchMap } from './internal/operators/switchMap'; -export { switchMapTo } from './internal/operators/switchMapTo'; -export { take } from './internal/operators/take'; -export { takeLast } from './internal/operators/takeLast'; -export { takeUntil } from './internal/operators/takeUntil'; -export { takeWhile } from './internal/operators/takeWhile'; -export { tap } from './internal/operators/tap'; -export { throttle } from './internal/operators/throttle'; -export { throttleTime } from './internal/operators/throttleTime'; -export { timeInterval } from './internal/operators/timeInterval'; -export { timeout } from './internal/operators/timeout'; -export { timeoutWith } from './internal/operators/timeoutWith'; -export { timestamp } from './internal/operators/timestamp'; -export { toArray } from './internal/operators/toArray'; -export { window } from './internal/operators/window'; -export { windowCount } from './internal/operators/windowCount'; -export { windowTime } from './internal/operators/windowTime'; -export { windowToggle } from './internal/operators/windowToggle'; -export { windowWhen } from './internal/operators/windowWhen'; -export { withLatestFrom } from './internal/operators/withLatestFrom'; -export { zipAll } from './internal/operators/zipAll'; - /* Subjects */ export { Subject } from './internal/Subject'; export { BehaviorSubject } from './internal/BehaviorSubject'; diff --git a/src/operators/index.ts b/src/operators/index.ts new file mode 100644 index 0000000000..4f5dacbdec --- /dev/null +++ b/src/operators/index.ts @@ -0,0 +1,104 @@ + +/* Operator exports */ +export { audit } from '../internal/operators/audit'; +export { auditTime } from '../internal/operators/auditTime'; +export { buffer } from '../internal/operators/buffer'; +export { bufferCount } from '../internal/operators/bufferCount'; +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 { concatAll } from '../internal/operators/concatAll'; +export { concatMap } from '../internal/operators/concatMap'; +export { concatMapTo } from '../internal/operators/concatMapTo'; +export { count } from '../internal/operators/count'; +export { debounce } from '../internal/operators/debounce'; +export { debounceTime } from '../internal/operators/debounceTime'; +export { defaultIfEmpty } from '../internal/operators/defaultIfEmpty'; +export { delay } from '../internal/operators/delay'; +export { delayWhen } from '../internal/operators/delayWhen'; +export { dematerialize } from '../internal/operators/dematerialize'; +export { distinct } from '../internal/operators/distinct'; +export { distinctUntilChanged } from '../internal/operators/distinctUntilChanged'; +export { distinctUntilKeyChanged } from '../internal/operators/distinctUntilKeyChanged'; +export { elementAt } from '../internal/operators/elementAt'; +export { every } from '../internal/operators/every'; +export { exhaust } from '../internal/operators/exhaust'; +export { exhaustMap } from '../internal/operators/exhaustMap'; +export { expand } from '../internal/operators/expand'; +export { filter } from '../internal/operators/filter'; +export { finalize } from '../internal/operators/finalize'; +export { find } from '../internal/operators/find'; +export { findIndex } from '../internal/operators/findIndex'; +export { first } from '../internal/operators/first'; +export { groupBy } from '../internal/operators/groupBy'; +export { ignoreElements } from '../internal/operators/ignoreElements'; +export { isEmpty } from '../internal/operators/isEmpty'; +export { last } from '../internal/operators/last'; +export { map } from '../internal/operators/map'; +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 { mergeMap } from '../internal/operators/mergeMap'; +export { mergeMap as flatMap } from '../internal/operators/mergeMap'; +export { mergeMapTo } from '../internal/operators/mergeMapTo'; +export { mergeScan } from '../internal/operators/mergeScan'; +export { min } from '../internal/operators/min'; +export { multicast } from '../internal/operators/multicast'; +export { observeOn } from '../internal/operators/observeOn'; +export { pairwise } from '../internal/operators/pairwise'; +export { partition } from '../internal/operators/partition'; +export { pluck } from '../internal/operators/pluck'; +export { publish } from '../internal/operators/publish'; +export { publishBehavior } from '../internal/operators/publishBehavior'; +export { publishLast } from '../internal/operators/publishLast'; +export { publishReplay } from '../internal/operators/publishReplay'; +export { reduce } from '../internal/operators/reduce'; +export { repeat } from '../internal/operators/repeat'; +export { repeatWhen } from '../internal/operators/repeatWhen'; +export { retry } from '../internal/operators/retry'; +export { retryWhen } from '../internal/operators/retryWhen'; +export { refCount } from '../internal/operators/refCount'; +export { sample } from '../internal/operators/sample'; +export { sampleTime } from '../internal/operators/sampleTime'; +export { scan } from '../internal/operators/scan'; +export { sequenceEqual } from '../internal/operators/sequenceEqual'; +export { share } from '../internal/operators/share'; +export { shareReplay } from '../internal/operators/shareReplay'; +export { single } from '../internal/operators/single'; +export { skip } from '../internal/operators/skip'; +export { skipLast } from '../internal/operators/skipLast'; +export { skipUntil } from '../internal/operators/skipUntil'; +export { skipWhile } from '../internal/operators/skipWhile'; +export { startWith } from '../internal/operators/startWith'; +/** + * TODO(https://github.com/ReactiveX/rxjs/issues/2900): Add back subscribeOn once it can be + * treeshaken. Currently if this export is added back, it + * forces apps to bring in asap scheduler along with + * Immediate, root, and other supporting code. + */ +// export { subscribeOn } from '../internal/operators/subscribeOn'; +export { switchAll } from '../internal/operators/switchAll'; +export { switchMap } from '../internal/operators/switchMap'; +export { switchMapTo } from '../internal/operators/switchMapTo'; +export { take } from '../internal/operators/take'; +export { takeLast } from '../internal/operators/takeLast'; +export { takeUntil } from '../internal/operators/takeUntil'; +export { takeWhile } from '../internal/operators/takeWhile'; +export { tap } from '../internal/operators/tap'; +export { throttle } from '../internal/operators/throttle'; +export { throttleTime } from '../internal/operators/throttleTime'; +export { timeInterval } from '../internal/operators/timeInterval'; +export { timeout } from '../internal/operators/timeout'; +export { timeoutWith } from '../internal/operators/timeoutWith'; +export { timestamp } from '../internal/operators/timestamp'; +export { toArray } from '../internal/operators/toArray'; +export { window } from '../internal/operators/window'; +export { windowCount } from '../internal/operators/windowCount'; +export { windowTime } from '../internal/operators/windowTime'; +export { windowToggle } from '../internal/operators/windowToggle'; +export { windowWhen } from '../internal/operators/windowWhen'; +export { withLatestFrom } from '../internal/operators/withLatestFrom'; +export { zipAll } from '../internal/operators/zipAll';