Skip to content
This repository was archived by the owner on Apr 25, 2019. It is now read-only.

Commit

Permalink
refactor(ofType): Remove any from typings.
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Nov 7, 2017
1 parent 6afb3c2 commit a5a8a6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions source/ofType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { filter } from "rxjs/operators/filter";
import { Action, ActionCreator } from "ts-action";

export function ofType<T extends string, A extends Action<string>>(creator: ActionCreator<T, A>): (source: Observable<Action<string>>) => Observable<A>;
export function ofType<T extends string>(...creators: ActionCreator<any, any>[]): (source: Observable<Action<string>>) => Observable<Action<string>>;
export function ofType<T extends string>(...creators: ActionCreator<any, any>[]): (source: Observable<Action<string>>) => Observable<Action<string>> {
export function ofType(...creators: ActionCreator<string, Action<string>>[]): (source: Observable<Action<string>>) => Observable<Action<string>>;
export function ofType(...creators: ActionCreator<string, Action<string>>[]): (source: Observable<Action<string>>) => Observable<Action<string>> {
return filter<Action<string>>(action => creators.some(creator => action.type === creator.type));
}
6 changes: 3 additions & 3 deletions source/operator/ofType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Action, ActionCreator } from "ts-action";
import { ofType as higherOrder } from "../ofType";

export function ofType<T extends string, A extends Action<string>>(this: Observable<Action<string>>, creator: ActionCreator<T, A>): Observable<A>;
export function ofType<T extends string>(this: Observable<Action<string>>, ...creators: ActionCreator<any, any>[]): Observable<Action<string>>;
export function ofType<T extends string>(this: Observable<Action<string>>, ...creators: ActionCreator<any, any>[]): Observable<Action<string>> {
return higherOrder<T>(...creators)(this);
export function ofType(this: Observable<Action<string>>, ...creators: ActionCreator<string, Action<string>>[]): Observable<Action<string>>;
export function ofType(this: Observable<Action<string>>, ...creators: ActionCreator<string, Action<string>>[]): Observable<Action<string>> {
return higherOrder(...creators)(this);
}

0 comments on commit a5a8a6e

Please sign in to comment.