Skip to content

Commit

Permalink
Merge branch 'master' into refactor-generate
Browse files Browse the repository at this point in the history
  • Loading branch information
benlesh authored Mar 8, 2018
2 parents 90a1d6c + d231053 commit f7174f6
Show file tree
Hide file tree
Showing 188 changed files with 1,133 additions and 3,048 deletions.
4 changes: 2 additions & 2 deletions doc/pipeable-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Problems with the patched operators for dot-chaining are:

## What?

What is a pipeable operator? Simply put, a function that can be used with the current `let` operator. It's the origin of the name, for better or worse. A pipeable operator is basically any function that returns a function with the signature: `<T, R>(source: Observable<T>) => Observable<R>`.
What is a pipeable operator? Simply put, a function that can be used with the current `let` operator. It used to be the origin of the name ("lettable"), but that was confusing and we call them "pipeable" now because they're intended to be used with the `pipe` utility. A pipeable operator is basically any function that returns a function with the signature: `<T, R>(source: Observable<T>) => Observable<R>`.

There is a `pipe` method built into `Observable` now at `Observable.prototype.pipe` that сan be used to compose the operators in similar manner to what you're used to with dot-chaining (shown below).

Expand Down Expand Up @@ -116,7 +116,7 @@ interval(1000).pipe(
toArray()
)
.subscribe(x => console.log(x));
// [0, 12, 24]
// [0, 2304, 9216]
```

## Known Issues
Expand Down
2 changes: 1 addition & 1 deletion doc/subject.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Below is an example:
var source = Rx.Observable.interval(500);
var subject = new Rx.Subject();
var refCounted = source.multicast(subject).refCount();
var subscription1, subscription2, subscriptionConnect;
var subscription1, subscription2;

// This calls `connect()`, because
// it is the first subscriber to `refCounted`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"compile_dist_cjs": "tsc -p ./tsconfig/tsconfig.cjs.json",
"compile_dist_esm5": "tsc -p ./tsconfig/tsconfig.esm5.json",
"compile_dist_esm2015": "tsc -p ./tsconfig/tsconfig.esm2015.json",
"compile_dist_esm2015_for_docs": "tsc ./dist/src/Rx.ts ./dist/src/add/observable/of.ts ./dist/src/MiscJSDoc.ts -m es2015 --sourceMap --outDir ./dist/es6 --target es2015 -d --diagnostics --pretty --noImplicitAny --noImplicitReturns --noImplicitThis --suppressImplicitAnyIndexErrors --moduleResolution node",
"compile_dist_esm2015_for_docs": "tsc ./dist/src/internal/Rx.ts ./dist/src/add/observable/of.ts ./dist/src/MiscJSDoc.ts -m es2015 --sourceMap --outDir ./dist/es6 --target es2015 -d --diagnostics --pretty --noImplicitAny --noImplicitReturns --noImplicitThis --suppressImplicitAnyIndexErrors --moduleResolution node",
"compile_dist_esm5_for_rollup": "tsc -p ./tsconfig/tsconfig.esm5.rollup.json",
"copy_sources": "mkdirp dist && shx cp -r ./src/ ./dist/src",
"decision_tree_widget": "cd doc/decision-tree-widget && npm run build && cd ../..",
Expand Down
2 changes: 1 addition & 1 deletion spec/Notification-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import * as Rx from '../src/Rx';
import * as Rx from '../src/internal/Rx';
import { expectObservable } from './helpers/marble-testing';

const Notification = Rx.Notification;
Expand Down
2 changes: 1 addition & 1 deletion spec/Observable-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import * as sinon from 'sinon';
import * as Rx from '../src/Rx';
import * as Rx from '../src/internal/Rx';
import { Observer, TeardownLogic } from '../src/internal/types';
import { cold, expectObservable, expectSubscriptions } from './helpers/marble-testing';
import { map } from '../src/internal/operators/map';
Expand Down
2 changes: 1 addition & 1 deletion spec/Scheduler-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import * as Rx from '../src/Rx';
import * as Rx from '../src/internal/Rx';

const Scheduler = Rx.Scheduler;

Expand Down
2 changes: 1 addition & 1 deletion spec/Subject-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import * as Rx from '../src/Rx';
import * as Rx from '../src/internal/Rx';
import { hot, expectObservable } from './helpers/marble-testing';

const Subject = Rx.Subject;
Expand Down
2 changes: 1 addition & 1 deletion spec/Subscriber-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import * as Rx from '../src/Rx';
import * as Rx from '../src/internal/Rx';

const Subscriber = Rx.Subscriber;

Expand Down
2 changes: 1 addition & 1 deletion spec/Subscription-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import * as Rx from '../src/Rx';
import * as Rx from '../src/internal/Rx';

const Observable = Rx.Observable;
const Subscription = Rx.Subscription;
Expand Down
8 changes: 8 additions & 0 deletions spec/ajax/index-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,12 @@ describe('index', () => {
it('should export static ajax observable creator functions', () => {
expect(index.ajax).to.exist;
});

it('should export Ajax data classes', () => {
expect(index.AjaxResponse).to.exist;
expect(index.AjaxError).to.exist;
expect(index.AjaxTimeoutError).to.exist;
// Interfaces can be checked by creating a variable of that type
let ajaxRequest: index.AjaxRequest;
});
});
8 changes: 4 additions & 4 deletions spec/exports-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { from } from '../src/internal/observable/from';
import { fromEvent } from '../src/internal/observable/fromEvent';
import { fromEventPattern } from '../src/internal/observable/fromEventPattern';
import { fromPromise } from '../src/internal/observable/fromPromise';
import { _if } from '../src/internal/observable/if';
import { iif } from '../src/internal/observable/iif';
import { interval } from '../src/internal/observable/interval';
import { merge } from '../src/internal/observable/merge';
import { never } from '../src/internal/observable/never';
Expand All @@ -23,7 +23,7 @@ import { throwError } from '../src/internal/observable/throwError';
import { timer } from '../src/internal/observable/timer';
import { using } from '../src/internal/observable/using';
import { zip } from '../src/internal/observable/zip';
import * as Rx from '../src/Rx';
import * as Rx from '../src/internal/Rx';

describe('exports', () => {
it('should have rxjs/observable/bindCallback', () => {
Expand Down Expand Up @@ -70,8 +70,8 @@ describe('exports', () => {
expect(fromPromise).to.equal(Rx.Observable.fromPromise);
});

it('should have rxjs/observable/if', () => {
expect(_if).to.equal(Rx.Observable.if);
it('should have rxjs/observable/iif', () => {
expect(iif).to.equal(Rx.Observable.if);
});

it('should have rxjs/observable/interval', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/test-helper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
declare const global: any;

import * as Rx from '../../src/Rx';
import * as Rx from '../../src/internal/Rx';
import { ObservableInput } from '../../src/internal/types';
import { root } from '../../src/internal/util/root';
import { $$iterator } from '../../src/internal/symbol/iterator';
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/testScheduler-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as _ from 'lodash';
import * as chai from 'chai';
import * as sinonChai from 'sinon-chai';

import * as Rx from '../../src/Rx';
import * as Rx from '../../src/internal/Rx';
import * as marble from './marble-testing';

//tslint:disable:no-var-requires no-require-imports
Expand Down
15 changes: 15 additions & 0 deletions spec/index-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,30 @@ import { expect } from 'chai';
describe('index', () => {
it('should export Observable', () => {
expect(index.Observable).to.exist;
expect(index.ConnectableObservable).to.exist;
// Interfaces can be checked by creating a variable of that type
let operator: index.Operator<any, any>;
});

it('should export the Subject types', () => {
expect(index.Subject).to.exist;
expect(index.BehaviorSubject).to.exist;
expect(index.ReplaySubject).to.exist;
expect(index.AsyncSubject).to.exist;
});

it('should export the schedulers', () => {
expect(index.asapScheduler).to.exist;
expect(index.asyncScheduler).to.exist;
expect(index.queueScheduler).to.exist;
expect(index.animationFrameScheduler).to.exist;
expect(index.VirtualTimeScheduler).to.exist;
expect(index.VirtualAction).to.exist;
});

it('should export Subscription', () => {
expect(index.Subscription).to.exist;
expect(index.Subscriber).to.exist;
});

it('should export Notification', () => {
Expand All @@ -33,6 +40,14 @@ describe('index', () => {
expect(index.identity).to.exist;
});

it('should export error types', () => {
expect(index.ArgumentOutOfRangeError).to.exist;
expect(index.EmptyError).to.exist;
expect(index.ObjectUnsubscribedError).to.exist;
expect(index.UnsubscriptionError).to.exist;
expect(index.TimeoutError).to.exist;
});

it('should export constants', () => {
expect(index.EMPTY).to.exist;
});
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/IteratorObservable-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import * as Rx from '../../src/Rx';
import * as Rx from '../../src/internal/Rx';
import { queue } from '../../src/internal/scheduler/queue';
import { fromIterable } from '../../src/internal/observable/fromIterable';

Expand Down
2 changes: 1 addition & 1 deletion spec/observables/ScalarObservable-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import * as Rx from '../../src/Rx';
import * as Rx from '../../src/internal/Rx';
import { scalar } from '../../src/internal/observable/scalar';

declare const rxTestScheduler: Rx.TestScheduler;
Expand Down
2 changes: 1 addition & 1 deletion spec/observables/SubscribeOnObservable-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import * as sinon from 'sinon';
import * as Rx from '../../src/Rx';
import * as Rx from '../../src/internal/Rx';
import { SubscribeOnObservable } from '../../src/internal/observable/SubscribeOnObservable';
import { hot, expectObservable, expectSubscriptions } from '../helpers/marble-testing';

Expand Down
2 changes: 1 addition & 1 deletion spec/observables/bindCallback-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import * as sinon from 'sinon';
import * as Rx from '../../src/Rx';
import * as Rx from '../../src/internal/Rx';

declare const rxTestScheduler: Rx.TestScheduler;
const Observable = Rx.Observable;
Expand Down
Loading

0 comments on commit f7174f6

Please sign in to comment.