Skip to content

Commit

Permalink
feat(reorganize): moved symbols to be internal
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Symbols are no longer exported directly from modules such as `rxjs/symbol/observable` please use `Symbol.observable` and `Symbol.iterator` (polyfills may be required)
  • Loading branch information
benlesh committed Jan 12, 2018
1 parent fd3ee3a commit 80783ab
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion spec/helpers/test-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ declare const global: any;
import * as Rx from '../../src/Rx';
import { ObservableInput } from '../../src/Observable';
import { root } from '../../src/util/root';
import { $$iterator } from '../../src/symbol/iterator';
import { $$iterator } from '../../src/internal/symbol/iterator';
import $$symbolObservable from 'symbol-observable';

export function lowerCaseO<T>(...args: Array<any>): Rx.Observable<T> {
Expand Down
4 changes: 2 additions & 2 deletions spec/symbol/iterator-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import { $$iterator, symbolIteratorPonyfill } from '../../src/symbol/iterator';
import { $$iterator, symbolIteratorPonyfill } from '../../src/internal/symbol/iterator';

describe('iterator symbol', () => {
it('should exist', () => {
Expand Down Expand Up @@ -97,4 +97,4 @@ describe('symbolIteratorPonyfill', () => {
});
});
});
});
});
2 changes: 1 addition & 1 deletion spec/symbol/observable-polyfilled-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';

import { getSymbolObservable } from '../../src/symbol/observable';
import { getSymbolObservable } from '../../src/internal/symbol/observable';

describe('observable symbol', () => {
it('should exist in the proper form when Symbol does not exist', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/symbol/observable-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai';
import $$symbolObservable from 'symbol-observable';

import { root } from '../../src/util/root';
import { getSymbolObservable } from '../../src/symbol/observable';
import { getSymbolObservable } from '../../src/internal/symbol/observable';

describe('observable symbol', () => {
it('should exist in the proper form', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/symbol/rxSubscriber-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import { root } from '../../src/util/root';
import {$$rxSubscriber} from '../../src/symbol/rxSubscriber';
import {$$rxSubscriber} from '../../src/internal/symbol/rxSubscriber';

describe('rxSubscriber symbol', () => {
it('should exist in the proper form', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/util/subscribeToResult-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai';
import * as Rx from '../../src/Rx';
import { subscribeToResult } from '../../src/util/subscribeToResult';
import { OuterSubscriber } from '../../src/internal/OuterSubscriber';
import { $$iterator } from '../../src/symbol/iterator';
import { $$iterator } from '../../src/internal/symbol/iterator';
import $$symbolObservable from 'symbol-observable';

describe('subscribeToResult', () => {
Expand Down
6 changes: 3 additions & 3 deletions src/Rx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ import { AsapScheduler } from './internal/scheduler/AsapScheduler';
import { AsyncScheduler } from './internal/scheduler/AsyncScheduler';
import { QueueScheduler } from './internal/scheduler/QueueScheduler';
import { AnimationFrameScheduler } from './internal/scheduler/AnimationFrameScheduler';
import { rxSubscriber } from './symbol/rxSubscriber';
import { iterator } from './symbol/iterator';
import { observable } from './symbol/observable';
import { rxSubscriber } from './internal/symbol/rxSubscriber';
import { iterator } from './internal/symbol/iterator';
import { observable } from './internal/symbol/observable';

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

Expand Down
2 changes: 1 addition & 1 deletion src/internal/Observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { root } from '../util/root';
import { toSubscriber } from '../util/toSubscriber';
import { IfObservable } from './observable/IfObservable';
import { ErrorObservable } from './observable/ErrorObservable';
import { observable as Symbol_observable } from '../symbol/observable';
import { observable as Symbol_observable } from '../internal/symbol/observable';
import { OperatorFunction } from '../interfaces';
import { pipeFromArray } from '../util/pipe';

Expand Down
2 changes: 1 addition & 1 deletion src/internal/Subject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Subscriber } from './Subscriber';
import { ISubscription, Subscription, TeardownLogic } from './Subscription';
import { ObjectUnsubscribedError } from '../util/ObjectUnsubscribedError';
import { SubjectSubscription } from './SubjectSubscription';
import { rxSubscriber as rxSubscriberSymbol } from '../symbol/rxSubscriber';
import { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';

/**
* @class SubjectSubscriber<T>
Expand Down
2 changes: 1 addition & 1 deletion src/internal/Subscriber.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isFunction } from '../util/isFunction';
import { Observer, PartialObserver, empty as emptyObserver } from './Observer';
import { Subscription } from './Subscription';
import { rxSubscriber as rxSubscriberSymbol } from '../symbol/rxSubscriber';
import { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';

/**
* Implements the {@link Observer} interface and extends the
Expand Down
4 changes: 2 additions & 2 deletions src/internal/observable/FromObservable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { ArrayObservable } from './ArrayObservable';
import { ArrayLikeObservable } from './ArrayLikeObservable';

import { IScheduler } from '../Scheduler';
import { iterator as Symbol_iterator } from '../../symbol/iterator';
import { iterator as Symbol_iterator } from '../../internal/symbol/iterator';
import { Observable, ObservableInput } from '../Observable';
import { Subscriber } from '../Subscriber';
import { ObserveOnSubscriber } from '../../internal/operators/observeOn';
import { observable as Symbol_observable } from '../../symbol/observable';
import { observable as Symbol_observable } from '../../internal/symbol/observable';

/**
* We need this JSDoc comment for affecting ESDoc.
Expand Down
2 changes: 1 addition & 1 deletion src/internal/observable/IteratorObservable.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { root } from '../../util/root';
import { IScheduler } from '../Scheduler';
import { Observable } from '../Observable';
import { iterator as Symbol_iterator } from '../../symbol/iterator';
import { iterator as Symbol_iterator } from '../../internal/symbol/iterator';
import { TeardownLogic } from '../Subscription';
import { Subscriber } from '../Subscriber';

Expand Down
2 changes: 1 addition & 1 deletion src/internal/observable/zip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Subscriber } from '../Subscriber';
import { OuterSubscriber } from '../OuterSubscriber';
import { InnerSubscriber } from '../InnerSubscriber';
import { subscribeToResult } from '../../util/subscribeToResult';
import { iterator as Symbol_iterator } from '../../symbol/iterator';
import { iterator as Symbol_iterator } from '../../internal/symbol/iterator';

/* tslint:disable:max-line-length */
export function zip<T, R>(v1: ObservableInput<T>, project: (v1: T) => R): Observable<R>;
Expand Down
2 changes: 1 addition & 1 deletion src/symbol/iterator.ts → src/internal/symbol/iterator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { root } from '../util/root';
import { root } from '../../util/root';

export function symbolIteratorPonyfill(root: any) {
const Symbol: any = root.Symbol;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { root } from '../util/root';
import { root } from '../../util/root';

export function getSymbolObservable(context: any) {
let $$observable: any;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { root } from '../util/root';
import { root } from '../../util/root';

const Symbol: any = root.Symbol;

Expand Down
4 changes: 2 additions & 2 deletions src/util/subscribeToResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { isPromise } from './isPromise';
import { isObject } from './isObject';
import { Subscriber } from '../internal/Subscriber';
import { Observable, ObservableInput } from '../internal/Observable';
import { iterator as Symbol_iterator } from '../symbol/iterator';
import { iterator as Symbol_iterator } from '../internal/symbol/iterator';
import { Subscription } from '../internal/Subscription';
import { InnerSubscriber } from '../internal/InnerSubscriber';
import { OuterSubscriber } from '../internal/OuterSubscriber';
import { observable as Symbol_observable } from '../symbol/observable';
import { observable as Symbol_observable } from '../internal/symbol/observable';

export function subscribeToResult<T, R>(outerSubscriber: OuterSubscriber<T, R>,
result: any,
Expand Down
2 changes: 1 addition & 1 deletion src/util/toSubscriber.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Subscriber } from '../internal/Subscriber';
import { rxSubscriber as rxSubscriberSymbol } from '../symbol/rxSubscriber';
import { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';
import { PartialObserver, empty as emptyObserver } from '../internal/Observer';

export function toSubscriber<T>(
Expand Down

0 comments on commit 80783ab

Please sign in to comment.