Skip to content

Commit

Permalink
feat(rxjs): move rxjs/create into rxjs (#3299)
Browse files Browse the repository at this point in the history
Moves all Observable creation functions under the `rxjs` namespace.

BREAKING CHANGE: `rxjs/create` items are now exported from `rxjs`
  • Loading branch information
benlesh authored Feb 6, 2018
1 parent ca5f661 commit 6711fe2
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 67 deletions.
31 changes: 0 additions & 31 deletions spec/create/index-spec.ts

This file was deleted.

27 changes: 27 additions & 0 deletions spec/index-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,31 @@ describe('index', () => {
it('should export constants', () => {
expect(index.EMPTY).to.exist;
});

it('should export static observable creator functions', () => {
expect(index.bindCallback).to.exist;
expect(index.bindNodeCallback).to.exist;
expect(index.combineLatest).to.exist;
expect(index.concat).to.exist;
expect(index.defer).to.exist;
expect(index.empty).to.exist;
expect(index.forkJoin).to.exist;
expect(index.from).to.exist;
expect(index.fromEvent).to.exist;
expect(index.fromEventPattern).to.exist;
expect(index.generate).to.exist;
expect(index.iif).to.exist;
expect(index.interval).to.exist;
expect(index.merge).to.exist;
expect(index.never).to.exist;
expect(index.of).to.exist;
expect(index.onErrorResumeNext).to.exist;
expect(index.pairs).to.exist;
expect(index.race).to.exist;
expect(index.range).to.exist;
expect(index.throwError).to.exist;
expect(index.timer).to.exist;
expect(index.using).to.exist;
expect(index.zip).to.exist;
});
});
2 changes: 1 addition & 1 deletion spec/observables/defer-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports
import { defer } from '../../src/create';
import { defer } from '../../src/';
import { Observable } from '../../src';

declare const asDiagram: any;
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/empty-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports
import { empty } from '../../src/create';
import { empty } from '../../src/';
import { EMPTY } from '../../src';
import { expect } from 'chai';

Expand Down
2 changes: 1 addition & 1 deletion spec/observables/from-spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'chai';
import { TestScheduler } from '../../src/testing';
import { Observable, asapScheduler, asyncScheduler, Observer } from '../../src';
import { of, from } from '../../src/create';
import { of, from } from '../../src/';

// tslint:disable:no-any
declare const asDiagram: any;
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/interval-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as sinon from 'sinon';
import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports
import { asapScheduler, Observable, animationFrameScheduler, queueScheduler } from '../../src';
import { TestScheduler } from '../../src/testing';
import { interval } from '../../src/create';
import { interval } from '../../src/';

declare const asDiagram: any;
declare const expectObservable: typeof marbleTestingSignature.expectObservable;
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/never-spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { never } from '../../src/create';
import { never } from '../../src/';
import { expect } from 'chai';
import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports

Expand Down
2 changes: 1 addition & 1 deletion spec/observables/onErrorResumeNext-spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { onErrorResumeNext } from '../../src/create';
import { onErrorResumeNext } from '../../src/';
import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports

declare const hot: typeof marbleTestingSignature.hot;
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/pairs-spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'chai';
import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports
import { TestScheduler } from '../../src/testing';
import { pairs } from '../../src/create';
import { pairs } from '../../src/';

declare const asDiagram: any;
declare const expectObservable: typeof marbleTestingSignature.expectObservable;
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/range-spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'chai';
import * as sinon from 'sinon';
import { Observable, asapScheduler as asap} from '../../src';
import { range } from '../../src/create';
import { range } from '../../src/';
import { TestScheduler } from '../../src/testing';
import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports
import { dispatch } from '../../src/internal/observable/range';
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/throwError-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 { throwError } from '../../src/create';
import { throwError } from '../../src/';
import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports

declare const asDiagram: any;
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/timer-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import marbleTestingSignature = require('../helpers/marble-testing'); // tslint:disable-line:no-require-imports
import { timer, never, merge } from '../../src/create';
import { timer, never, merge } from '../../src/';
import { TestScheduler } from '../../src/testing';
import { mergeMap } from '../../src/operators';

Expand Down
25 changes: 0 additions & 25 deletions src/create/index.ts

This file was deleted.

26 changes: 26 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,32 @@ export { pipe } from './internal/util/pipe';
export { noop } from './internal/util/noop';
export { identity } from './internal/util/identity';

/* Static observable creation exports */
export { bindCallback } from './internal/observable/bindCallback';
export { bindNodeCallback } from './internal/observable/bindNodeCallback';
export { combineLatest } from './internal/observable/combineLatest';
export { concat } from './internal/observable/concat';
export { defer } from './internal/observable/defer';
export { empty } from './internal/observable/empty';
export { forkJoin } from './internal/observable/forkJoin';
export { from } from './internal/observable/from';
export { fromEvent } from './internal/observable/fromEvent';
export { fromEventPattern } from './internal/observable/fromEventPattern';
export { generate } from './internal/observable/generate';
export { _if as iif } from './internal/observable/if';
export { interval } from './internal/observable/interval';
export { merge } from './internal/observable/merge';
export { never } from './internal/observable/never';
export { of } from './internal/observable/of';
export { onErrorResumeNext } from './internal/observable/onErrorResumeNext';
export { pairs } from './internal/observable/pairs';
export { race } from './internal/observable/race';
export { range } from './internal/observable/range';
export { throwError } from './internal/observable/throwError';
export { timer } from './internal/observable/timer';
export { using } from './internal/observable/using';
export { zip } from './internal/observable/zip';

/* Constants */
export { EMPTY } from './internal/observable/empty';

Expand Down
1 change: 0 additions & 1 deletion tsconfig/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"../dist/src/add/observable/of.ts",
"../dist/src/index.ts",
"../dist/src/operators/index.ts",
"../dist/src/create/index.ts",
"../dist/src/ajax/index.ts",
"../dist/src/websocket/index.ts",
"../dist/src/testing/index.ts"
Expand Down

0 comments on commit 6711fe2

Please sign in to comment.