Skip to content

Commit

Permalink
feat(reorganize): move operator impls under internal directory
Browse files Browse the repository at this point in the history
- moves operators directory under `internal`.
- moves `operators.ts` to `internal/operators/index.ts`
  • Loading branch information
benlesh committed Jan 12, 2018
1 parent 4574310 commit 207976f
Show file tree
Hide file tree
Showing 209 changed files with 1,077 additions and 916 deletions.
2 changes: 1 addition & 1 deletion spec/Observable-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sinon from 'sinon';
import * as Rx from '../src/Rx';
import { TeardownLogic } from '../src/Subscription';
import marbleTestingSignature = require('./helpers/marble-testing'); // tslint:disable-line:no-require-imports
import { map } from '../src/operators/map';
import { map } from '../src/internal/operators/map';
//tslint:disable-next-line
require('./helpers/test-helper');

Expand Down
2 changes: 1 addition & 1 deletion spec/operators/groupBy-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import * as Rx from '../../src/Rx';
import { GroupedObservable } from '../../src/operators/groupBy';
import { GroupedObservable } from '../../src/internal/operators/groupBy';
import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports

declare const { asDiagram };
Expand Down
2 changes: 1 addition & 1 deletion src/Observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export class Observable<T> implements Subscribable<T> {
*
* @example
*
* import { map, filter, scan } from 'rxjs/operators';
* import { map, filter, scan } from 'rxjs/internal/operators';
*
* Rx.Observable.interval(1000)
* .pipe(
Expand Down
2 changes: 1 addition & 1 deletion src/ReplaySubject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { IScheduler } from './Scheduler';
import { queue } from './scheduler/queue';
import { Subscriber } from './Subscriber';
import { Subscription } from './Subscription';
import { ObserveOnSubscriber } from './operators/observeOn';
import { ObserveOnSubscriber } from './internal/operators/observeOn';
import { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';
import { SubjectSubscription } from './SubjectSubscription';
/**
Expand Down
6 changes: 3 additions & 3 deletions src/Rx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import './add/observable/zip';
import './add/observable/dom/ajax';
import './add/observable/dom/webSocket';

//operators
//internal/operators
import './add/operator/buffer';
import './add/operator/bufferCount';
import './add/operator/bufferTime';
Expand Down Expand Up @@ -158,7 +158,7 @@ export {ObjectUnsubscribedError} from './util/ObjectUnsubscribedError';
export {TimeoutError} from './util/TimeoutError';
export {UnsubscriptionError} from './util/UnsubscriptionError';
export {TimeInterval} from './internal/patching/operator/timeInterval';
export {Timestamp} from './operators/timestamp';
export {Timestamp} from './internal/operators/timestamp';
export {TestScheduler} from './testing/TestScheduler';
export {VirtualTimeScheduler} from './scheduler/VirtualTimeScheduler';
export {AjaxRequest, AjaxResponse, AjaxError, AjaxTimeoutError} from './internal/observable/dom/AjaxObservable';
Expand All @@ -176,7 +176,7 @@ import { rxSubscriber } from './symbol/rxSubscriber';
import { iterator } from './symbol/iterator';
import { observable } from './symbol/observable';

import * as _operators from './operators';
import * as _operators from './internal/operators';

export const operators = _operators;

Expand Down
192 changes: 96 additions & 96 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,108 +25,108 @@ export { using } from './internal/observable/using';
export { zip } from './internal/observable/zip';

/* Operator exports */
export { audit } from './operators/audit';
export { auditTime } from './operators/auditTime';
export { buffer } from './operators/buffer';
export { bufferCount } from './operators/bufferCount';
export { bufferTime } from './operators/bufferTime';
export { bufferToggle } from './operators/bufferToggle';
export { bufferWhen } from './operators/bufferWhen';
export { catchError } from './operators/catchError';
export { combineAll } from './operators/combineAll';
export { concatAll } from './operators/concatAll';
export { concatMap } from './operators/concatMap';
export { concatMapTo } from './operators/concatMapTo';
export { count } from './operators/count';
export { debounce } from './operators/debounce';
export { debounceTime } from './operators/debounceTime';
export { defaultIfEmpty } from './operators/defaultIfEmpty';
export { delay } from './operators/delay';
export { delayWhen } from './operators/delayWhen';
export { dematerialize } from './operators/dematerialize';
export { distinct } from './operators/distinct';
export { distinctUntilChanged } from './operators/distinctUntilChanged';
export { distinctUntilKeyChanged } from './operators/distinctUntilKeyChanged';
export { elementAt } from './operators/elementAt';
export { every } from './operators/every';
export { exhaust } from './operators/exhaust';
export { exhaustMap } from './operators/exhaustMap';
export { expand } from './operators/expand';
export { filter } from './operators/filter';
export { finalize } from './operators/finalize';
export { find } from './operators/find';
export { findIndex } from './operators/findIndex';
export { first } from './operators/first';
export { groupBy } from './operators/groupBy';
export { ignoreElements } from './operators/ignoreElements';
export { isEmpty } from './operators/isEmpty';
export { last } from './operators/last';
export { map } from './operators/map';
export { mapTo } from './operators/mapTo';
export { materialize } from './operators/materialize';
export { max } from './operators/max';
export { mergeAll } from './operators/mergeAll';
export { mergeMap } from './operators/mergeMap';
export { mergeMap as flatMap } from './operators/mergeMap';
export { mergeMapTo } from './operators/mergeMapTo';
export { mergeScan } from './operators/mergeScan';
export { min } from './operators/min';
export { multicast } from './operators/multicast';
export { observeOn } from './operators/observeOn';
export { pairwise } from './operators/pairwise';
export { partition } from './operators/partition';
export { pluck } from './operators/pluck';
export { publish } from './operators/publish';
export { publishBehavior } from './operators/publishBehavior';
export { publishLast } from './operators/publishLast';
export { publishReplay } from './operators/publishReplay';
export { reduce } from './operators/reduce';
export { repeat } from './operators/repeat';
export { repeatWhen } from './operators/repeatWhen';
export { retry } from './operators/retry';
export { retryWhen } from './operators/retryWhen';
export { refCount } from './operators/refCount';
export { sample } from './operators/sample';
export { sampleTime } from './operators/sampleTime';
export { scan } from './operators/scan';
export { sequenceEqual } from './operators/sequenceEqual';
export { share } from './operators/share';
export { shareReplay } from './operators/shareReplay';
export { single } from './operators/single';
export { skip } from './operators/skip';
export { skipLast } from './operators/skipLast';
export { skipUntil } from './operators/skipUntil';
export { skipWhile } from './operators/skipWhile';
export { startWith } from './operators/startWith';
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 './operators/subscribeOn';
export { switchAll } from './operators/switchAll';
export { switchMap } from './operators/switchMap';
export { switchMapTo } from './operators/switchMapTo';
export { take } from './operators/take';
export { takeLast } from './operators/takeLast';
export { takeUntil } from './operators/takeUntil';
export { takeWhile } from './operators/takeWhile';
export { tap } from './operators/tap';
export { throttle } from './operators/throttle';
export { throttleTime } from './operators/throttleTime';
export { timeInterval } from './operators/timeInterval';
export { timeout } from './operators/timeout';
export { timeoutWith } from './operators/timeoutWith';
export { timestamp } from './operators/timestamp';
export { toArray } from './operators/toArray';
export { window } from './operators/window';
export { windowCount } from './operators/windowCount';
export { windowTime } from './operators/windowTime';
export { windowToggle } from './operators/windowToggle';
export { windowWhen } from './operators/windowWhen';
export { withLatestFrom } from './operators/withLatestFrom';
export { zipAll } from './operators/zipAll';
// 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 './Subject';
Expand Down
2 changes: 1 addition & 1 deletion src/internal/observable/ConnectableObservable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Operator } from '../../Operator';
import { Observable } from '../../Observable';
import { Subscriber } from '../../Subscriber';
import { Subscription, TeardownLogic } from '../../Subscription';
import { refCount as higherOrderRefCount } from '../../operators/refCount';
import { refCount as higherOrderRefCount } from '../../internal/operators/refCount';

/**
* @class ConnectableObservable<T>
Expand Down
2 changes: 1 addition & 1 deletion src/internal/observable/FromObservable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { IScheduler } from '../../Scheduler';
import { iterator as Symbol_iterator } from '../../symbol/iterator';
import { Observable, ObservableInput } from '../../Observable';
import { Subscriber } from '../../Subscriber';
import { ObserveOnSubscriber } from '../../operators/observeOn';
import { ObserveOnSubscriber } from '../../internal/operators/observeOn';
import { observable as Symbol_observable } from '../../symbol/observable';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/internal/observable/concat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { IScheduler } from '../../Scheduler';
import { isScheduler } from '../../util/isScheduler';
import { of } from './of';
import { from } from './from';
import { concatAll } from '../../operators/concatAll';
import { concatAll } from '../../internal/operators/concatAll';

/* tslint:disable:max-line-length */
export function concat<T>(v1: ObservableInput<T>, scheduler?: IScheduler): Observable<T>;
Expand Down
2 changes: 1 addition & 1 deletion src/internal/observable/dom/AjaxObservable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { errorObject } from '../../../util/errorObject';
import { Observable } from '../../../Observable';
import { Subscriber } from '../../../Subscriber';
import { TeardownLogic } from '../../../Subscription';
import { map } from '../../../operators/map';
import { map } from '../../../internal/operators/map';

export interface AjaxRequest {
url?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/internal/observable/merge.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Observable, ObservableInput } from '../../Observable';
import { IScheduler } from '../../Scheduler';
import { isScheduler } from '../../util/isScheduler';
import { mergeAll } from '../../operators/mergeAll';
import { mergeAll } from '../../internal/operators/mergeAll';
import { ArrayObservable } from './ArrayObservable';

/* tslint:disable:max-line-length */
Expand Down
18 changes: 9 additions & 9 deletions src/operators/audit.ts → src/internal/operators/audit.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Operator } from '../Operator';
import { Subscriber } from '../Subscriber';
import { Observable, SubscribableOrPromise } from '../Observable';
import { Subscription, TeardownLogic } from '../Subscription';
import { Operator } from '../../Operator';
import { Subscriber } from '../../Subscriber';
import { Observable, SubscribableOrPromise } from '../../Observable';
import { Subscription, TeardownLogic } from '../../Subscription';

import { tryCatch } from '../util/tryCatch';
import { errorObject } from '../util/errorObject';
import { OuterSubscriber } from '../OuterSubscriber';
import { subscribeToResult } from '../util/subscribeToResult';
import { MonoTypeOperatorFunction } from '../interfaces';
import { tryCatch } from '../../util/tryCatch';
import { errorObject } from '../../util/errorObject';
import { OuterSubscriber } from '../../OuterSubscriber';
import { subscribeToResult } from '../../util/subscribeToResult';
import { MonoTypeOperatorFunction } from '../../interfaces';

/**
* Ignores source values for a duration determined by another Observable, then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { async } from '../scheduler/async';
import { IScheduler } from '../Scheduler';
import { async } from '../../scheduler/async';
import { IScheduler } from '../../Scheduler';
import { audit } from './audit';
import { timer } from '../internal/observable/timer';
import { MonoTypeOperatorFunction } from '../interfaces';
import { timer } from '../../internal/observable/timer';
import { MonoTypeOperatorFunction } from '../../interfaces';

/**
* Ignores source values for `duration` milliseconds, then emits the most recent
Expand Down
14 changes: 7 additions & 7 deletions src/operators/buffer.ts → src/internal/operators/buffer.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Operator } from '../Operator';
import { Subscriber } from '../Subscriber';
import { Observable } from '../Observable';
import { OuterSubscriber } from '../OuterSubscriber';
import { InnerSubscriber } from '../InnerSubscriber';
import { subscribeToResult } from '../util/subscribeToResult';
import { OperatorFunction } from '../interfaces';
import { Operator } from '../../Operator';
import { Subscriber } from '../../Subscriber';
import { Observable } from '../../Observable';
import { OuterSubscriber } from '../../OuterSubscriber';
import { InnerSubscriber } from '../../InnerSubscriber';
import { subscribeToResult } from '../../util/subscribeToResult';
import { OperatorFunction } from '../../interfaces';

/**
* Buffers the source Observable values until `closingNotifier` emits.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Operator } from '../Operator';
import { Subscriber } from '../Subscriber';
import { Observable } from '../Observable';
import { TeardownLogic } from '../Subscription';
import { OperatorFunction } from '../interfaces';
import { Operator } from '../../Operator';
import { Subscriber } from '../../Subscriber';
import { Observable } from '../../Observable';
import { TeardownLogic } from '../../Subscription';
import { OperatorFunction } from '../../interfaces';

/**
* Buffers the source Observable values until the size hits the maximum
Expand Down
Loading

0 comments on commit 207976f

Please sign in to comment.