Skip to content

Commit

Permalink
rename state parameter for statefulFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
srijs committed May 20, 2016
1 parent 630cb7a commit 97f540c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/compat/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class IntoOutputStreamState {
}
}

export function intoOutputStream<F>(output: () => NodeJS.WritableStream): Sink<Buffer, IntoOutputStreamState, void> {
export function intoOutputStream(output: () => NodeJS.WritableStream): Sink<Buffer, IntoOutputStreamState, void> {
return new Sink<Buffer, IntoOutputStreamState, void>({
onStart: () => Promise.resolve(new IntoOutputStreamState(output())),
onData: (state, buf) => state.write(buf),
Expand Down
6 changes: 3 additions & 3 deletions src/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ export class Source<Output> {
return this.statefulFilter(null, (state, output) => [state, pred(output)]);
}

statefulFilter<S>(init: S, pred: (state: S, output: Output) => [S, boolean]): Source<Output> {
return new Source(<State, Result>(sink: SinkInterface<Output, State, Result>) => {
return this.pipe<[S, State], Result>({
statefulFilter<State>(init: State, pred: (state: State, output: Output) => [State, boolean]): Source<Output> {
return new Source(<SinkState, Result>(sink: SinkInterface<Output, SinkState, Result>) => {
return this.pipe<[State, SinkState], Result>({
onStart: () => sink.onStart().then(state => [init, state]),
onData: (state, output) => {
const res = pred(state[0], output);
Expand Down

0 comments on commit 97f540c

Please sign in to comment.