Skip to content

Commit

Permalink
fix(Subject): lift signature is now appropriate for strictor TS 2.4 c…
Browse files Browse the repository at this point in the history
…hecks

Type safety wasn't really gauranteed with lift before because we survived for a long time with an incorrect type signature, TypeScript 2.4 introduces stricter type-checking, and all of a sudden `lift` on `Subject` was breaking builds for those that are riding the wave of the latest-and-greatest.

BREAKING CHANGES: It is possible that the type signature change to `Subject.prototype.lift` will break someone's build, but it seems unlikely given that TS 2.3 and lower didn't seem to give the proper type-safety guarantees with that method. Because this particular issue is blocking people wanting to use TS 2.4, and because it is very unlikely to cause any issues to anyone, we are not going to increment a major version for this particular possibly breaking change. Apologies to anyone this breaks.
  • Loading branch information
benlesh committed Jul 4, 2017
1 parent 3bb6240 commit c53782e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Subject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class Subject<T> extends Observable<T> implements ISubscription {
return new AnonymousSubject<T>(destination, source);
}

lift<R>(operator: Operator<T, R>): Observable<T> {
lift<R>(operator: Operator<T, R>): Observable<R> {
const subject = new AnonymousSubject(this, this);
subject.operator = <any>operator;
return <any>subject;
Expand Down

0 comments on commit c53782e

Please sign in to comment.