diff --git a/benchmarks/bm.debounce.ts b/benchmarks/bm.debounce.ts index 4e00bca..611616d 100644 --- a/benchmarks/bm.debounce.ts +++ b/benchmarks/bm.debounce.ts @@ -11,6 +11,8 @@ export function bm_debounce(suite: Suite) { return suite.add( 'file -> debounce', (d: IDeferred) => run(debounce(100, fromArray(a)), d), - {defer: true} + { + defer: true + } ) } diff --git a/src/operators/Combine.ts b/src/operators/Combine.ts index cb7f31b..d798f07 100644 --- a/src/operators/Combine.ts +++ b/src/operators/Combine.ts @@ -81,6 +81,7 @@ class CombineObservable implements IObservable { export const combine = curry( (selector: TSelector, sources: IObservable[]) => new CombineObservable(selector, sources) -) as {(selector: TSelector, sources: TSource): TResult} & { +) as { + (selector: TSelector, sources: TSource): TResult (selector: TSelector): {(sources: TSource): TResult} } diff --git a/src/operators/Debounce.ts b/src/operators/Debounce.ts index fc3efa3..5948656 100644 --- a/src/operators/Debounce.ts +++ b/src/operators/Debounce.ts @@ -58,6 +58,6 @@ export const debounce = curry( (timeout: number, source: IObservable) => new Debounce(timeout, source) ) as { (timeout: number, source: IObservable): IObservable -} & { + (timeout: number): {(source: IObservable): IObservable} } diff --git a/src/operators/Delay.ts b/src/operators/Delay.ts index e00fe85..d028c38 100644 --- a/src/operators/Delay.ts +++ b/src/operators/Delay.ts @@ -54,6 +54,7 @@ class DelayObservable implements IObservable { export const delay = curry( (timeout: number, source: IObservable): IObservable => new DelayObservable(timeout, source) -) as {(timeout: number, source: IObservable): IObservable} & { +) as { + (timeout: number, source: IObservable): IObservable (timeout: number): {(source: IObservable): IObservable} } diff --git a/src/operators/Filter.ts b/src/operators/Filter.ts index c89ba53..2cefcba 100644 --- a/src/operators/Filter.ts +++ b/src/operators/Filter.ts @@ -43,6 +43,7 @@ export const filter = curry(function( source: TSource ) { return new FilterObservable(predicate, source) -}) as {(predicate: TPredicate, source: TSource): TResult} & { +}) as { + (predicate: TPredicate, source: TSource): TResult (predicate: TPredicate): {(source: TSource): TResult} } diff --git a/src/operators/MergeMap.ts b/src/operators/MergeMap.ts index 4e0de53..2f5ffef 100644 --- a/src/operators/MergeMap.ts +++ b/src/operators/MergeMap.ts @@ -13,21 +13,29 @@ import {just} from '../sources/Create' export type Project = (t: T) => IObservable -// prettier-ignore export type mergeMapFunctionWithConcurrency = { - (concurrency: IObservable, project: Project, source: IObservable): IObservable - (concurrency: IObservable): {(project: Project, source: IObservable): IObservable} - (concurrency: IObservable): {(project: Project): {(source: IObservable): IObservable}} + ( + concurrency: IObservable, + project: Project, + source: IObservable + ): IObservable + (concurrency: IObservable): { + (project: Project, source: IObservable): IObservable + } + (concurrency: IObservable): { + (project: Project): {(source: IObservable): IObservable} + } } -// prettier-ignore export type mergeMapFunction = { (project: Project, source: IObservable): IObservable (project: Project, source: IObservable): IObservable (project: Project): {(source: IObservable): IObservable} } -// prettier-ignore -export type joinFunction = (source: IObservable>) => IObservable + +export type joinFunction = ( + source: IObservable> +) => IObservable class ConcurrencyObserver extends ErrorMixin(Virgin) implements IObserver { diff --git a/src/operators/Reduce.ts b/src/operators/Reduce.ts index d2a5270..ffca51a 100644 --- a/src/operators/Reduce.ts +++ b/src/operators/Reduce.ts @@ -58,15 +58,15 @@ export const reduce = curry(function( (reducer: TReducer, seed: TSeed, source: TSource): TResult< R > -} & { + (reducer: TReducer): { (seed: TSeed, source: TSource): TResult } -} & { + (reducer: TReducer, seed: TSeed): { (source: TSource): TResult } -} & { + (reducer: TReducer): { (seed: TSeed): {(source: TSource): TResult} } diff --git a/src/operators/Sample.ts b/src/operators/Sample.ts index b816d52..9e3892e 100644 --- a/src/operators/Sample.ts +++ b/src/operators/Sample.ts @@ -101,15 +101,15 @@ export const sample = curry(function( return new SampleObservable(f, sampler, sources) }) as { (selector: TSelector, sampler: TSampler, source: TSources): TResult -} & { + (selector: TSelector): { (sampler: TSampler, source: TSources): TResult } -} & { + (selector: TSelector, sampler: TSampler): { (source: TSources): TResult } -} & { + (selector: TSelector): { (sampler: TSampler): {(source: TSources): TResult} } diff --git a/src/operators/Scan.ts b/src/operators/Scan.ts index 4459627..2d0ccd0 100644 --- a/src/operators/Scan.ts +++ b/src/operators/Scan.ts @@ -54,15 +54,15 @@ export const scan = curry(function( (reducer: TReducer, seed: TSeed, source: TSource): TResult< R > -} & { + (reducer: TReducer): { (seed: TSeed, source: TSource): TResult } -} & { + (reducer: TReducer, seed: TSeed): { (source: TSource): TResult } -} & { + (reducer: TReducer): { (seed: TSeed): {(source: TSource): TResult} } diff --git a/src/operators/SkipRepeats.ts b/src/operators/SkipRepeats.ts index 81d6439..7fbbd46 100644 --- a/src/operators/SkipRepeats.ts +++ b/src/operators/SkipRepeats.ts @@ -49,6 +49,7 @@ export const skipRepeats = curry(function( source: IObservable ) { return new SkipRepeatsObservable(hashFunction, source) -}) as {(cmp: TComparator, source: TSource): TResult} & { +}) as { + (cmp: TComparator, source: TSource): TResult (cmp: TComparator): {(source: TSource): TResult} } diff --git a/src/operators/Slice.ts b/src/operators/Slice.ts index a434932..6d14f9a 100644 --- a/src/operators/Slice.ts +++ b/src/operators/Slice.ts @@ -74,13 +74,13 @@ export const slice = curry(function( return new SliceObservable(start, count, source) }) as { (start: number, count: number, source: IObservable): IObservable -} & { + (start: number): {(count: number, source: IObservable): IObservable} -} & { + (start: number, count: number): { (source: IObservable): IObservable } -} & { + (start: number): { (count: number): {(source: IObservable): IObservable} } diff --git a/src/operators/Switch.ts b/src/operators/Switch.ts index ff40ee5..3c05a57 100644 --- a/src/operators/Switch.ts +++ b/src/operators/Switch.ts @@ -66,7 +66,7 @@ export const switchMap = curry( (mapper: (t: K) => IObservable, source: IObservable): IObservable< T > -} & { + (mapper: (t: K) => IObservable): { (source: IObservable): IObservable } diff --git a/src/sources/FromDOM.ts b/src/sources/FromDOM.ts index a699089..5fa1637 100644 --- a/src/sources/FromDOM.ts +++ b/src/sources/FromDOM.ts @@ -37,6 +37,7 @@ class DOMObservable implements TResult { export const fromDOM = curry(function(element: EventTarget, name: string) { return new DOMObservable(name, element) -}) as {(element: EventTarget, name: string): TResult} & { +}) as { + (element: EventTarget, name: string): TResult (element: EventTarget): {(name: string): TResult} }