Skip to content

Commit

Permalink
feat(Stream): add mapTo to Stream prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
TylorS authored and Andre Medeiros committed Mar 28, 2016
1 parent f73bc8e commit 58c83f9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {Producer} from './Producer';
import {InternalListener} from './InternalListener';
import {InternalProducer} from './InternalProducer';
import {MapOperator} from './operator/MapOperator';
import {MapToOperator} from './operator/MapToOperator';
import {FilterOperator} from './operator/FilterOperator';
import {TakeOperator} from './operator/TakeOperator';
import {DropOperator} from './operator/DropOperator';
Expand Down Expand Up @@ -171,6 +172,10 @@ export class Stream<T> implements InternalListener<T> {
return new Stream<U>(new MapOperator(project, this));
}

mapTo<U>(projectedValue: U): Stream<U> {
return new Stream<U>(new MapToOperator(projectedValue, this));
}

filter(predicate: (t: T) => boolean): Stream<T> {
return new Stream<T>(new FilterOperator(predicate, this));
}
Expand Down

0 comments on commit 58c83f9

Please sign in to comment.