Skip to content

Commit

Permalink
Use Index Type for property name in intercept
Browse files Browse the repository at this point in the history
Use an index type for the property name argument when using intercept for better type checking.
  • Loading branch information
smithgeek authored Jul 29, 2017
1 parent aa412a9 commit e8abf1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/intercept.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function intercept<T>(observableArray: IObservableArray<T>, handler: IInt
export function intercept<T>(observableMap: ObservableMap<T>, handler: IInterceptor<IMapWillChange<T>>): Lambda;
export function intercept<T>(observableMap: ObservableMap<T>, property: string, handler: IInterceptor<IValueWillChange<T>>): Lambda;
export function intercept(object: Object, handler: IInterceptor<IObjectWillChange>): Lambda;
export function intercept(object: Object, property: string, handler: IInterceptor<IValueWillChange<any>>): Lambda;
export function intercept<T extends Object, K extends keyof T>(object: T, property: K, handler: IInterceptor<IValueWillChange<any>>): Lambda;
export function intercept(thing, propOrHandler?, handler?): Lambda {
if (typeof handler === "function")
return interceptProperty(thing, propOrHandler, handler);
Expand Down

0 comments on commit e8abf1c

Please sign in to comment.