Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(subscribable): make subscribe() signature match Observable #4050

Merged
merged 3 commits into from Aug 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions spec/operators/zipAll-spec.ts
Expand Up @@ -39,7 +39,7 @@ describe('zipAll operator', () => {
of('a', 'b', 'c'),
of(1, 2, 3)
)
.pipe(zipAll((a, b) => a + b))
.pipe(zipAll((a, b) => String(a) + String(b)))
.subscribe((x) => {
expect(x).to.equal(expected[i++]);
}, null, done);
Expand Down Expand Up @@ -231,7 +231,7 @@ describe('zipAll operator', () => {
const b = [4, 5, 6];
const expected = '---x--#';

const selector = function (x: number, y: number) {
const selector = function (x: string, y: number) {
if (y === 5) {
throw new Error('too bad');
} else {
Expand Down Expand Up @@ -378,7 +378,7 @@ describe('zipAll operator', () => {
of('a', 'b', 'c'),
of(1, 2)
)
.pipe(zipAll((a, b) => a + b))
.pipe(zipAll((a, b) => String(a) + String(b)))
.subscribe((x) => {
expect(x).to.equal(expected[i++]);
}, null, done);
Expand Down
5 changes: 2 additions & 3 deletions src/internal/types.ts
Expand Up @@ -39,9 +39,8 @@ export type SubscribableOrPromise<T> = Subscribable<T> | Subscribable<never> | P
/** OBSERVABLE INTERFACES */

export interface Subscribable<T> {
subscribe(observerOrNext?: PartialObserver<T> | ((value: T) => void),
error?: (error: any) => void,
complete?: () => void): Unsubscribable;
subscribe(observer?: PartialObserver<T>): Unsubscribable;
subscribe(next?: (value: T) => void, error?: (error: any) => void, complete?: () => void): Unsubscribable;
}

export type ObservableInput<T> = SubscribableOrPromise<T> | ArrayLike<T> | Iterable<T>;
Expand Down