Skip to content

Commit

Permalink
feat: add never and empty <T = any> param
Browse files Browse the repository at this point in the history
PR #307
  • Loading branch information
wclr authored Jul 22, 2020
1 parent b382101 commit f448148
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1281,8 +1281,8 @@ export class Stream<T> implements InternalListener<T> {
* @factory true
* @return {Stream}
*/
static never(): Stream<any> {
return new Stream<any>({ _start: noop, _stop: noop });
static never<T = any>(): Stream<T> {
return new Stream<T>({ _start: noop, _stop: noop });
}

/**
Expand All @@ -1299,8 +1299,8 @@ export class Stream<T> implements InternalListener<T> {
* @factory true
* @return {Stream}
*/
static empty(): Stream<any> {
return new Stream<any>({
static empty<T = any>(): Stream<T> {
return new Stream<T>({
_start(il: InternalListener<any>) { il._c(); },
_stop: noop,
});
Expand Down

0 comments on commit f448148

Please sign in to comment.