Skip to content

Commit

Permalink
Merge pull request #51 from tusharmath/fix-foreach
Browse files Browse the repository at this point in the history
fix(forEach): fix type signature
  • Loading branch information
tusharmath authored Nov 1, 2016
2 parents ad52802 + 239ea9d commit f19c373
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib/ForEach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {Curry2} from './Curry'
import {ICurriedFunction2} from '../types/ICurriedFunction'
import {Observer} from './Observer'

export const forEach = Curry2(function <T> (onNext: {(value: T): void} | IObserver<T>, observable: IObservable<any>) {
const observer: IObserver<T> = typeof onNext === 'function' ? Observer.of(onNext) : onNext
return observable.subscribe(observer, DefaultScheduler.of())
}) as ICurriedFunction2<IObservable<any>, IObserver<any>, ISubscription>
export const forEach = Curry2(function <T> (onNext: {(value: T): void}, observable: IObservable<any>) {
return observable.subscribe(Observer.of(onNext), DefaultScheduler.of())
}) as ICurriedFunction2<{(value: any): void}, IObservable<any>, ISubscription>

0 comments on commit f19c373

Please sign in to comment.