Skip to content

Commit d729915

Browse files
author
James Hush
committed
Switch to an overload based on @mweststrate's comment
1 parent e91d823 commit d729915

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

flow-typed/mobx.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ declare module 'mobx' {
311311
declare function runInAction<T>(block: () => T, scope?: any): T;
312312
declare function isAction(thing: any): boolean;
313313
declare function autorun(nameOrFunction: string | (r: IReactionPublic) => any, viewOrScope?: any, scope?: any): any;
314-
declare function when(nameOrFunction: string | () => boolean, effect: Lambda, scope?: any): any
314+
declare function when(name: string, cond:() => boolean, effect: Lambda, scope?: any): any
315+
declare function when(cond:() => boolean, effect: Lambda, scope?: any): any
316+
315317
declare function autorunAsync(func: (r: IReactionPublic) => any, delay?: number, scope?: any): any
316318
declare function reaction<T>(
317319
expression: (r: IReactionPublic) => T, effect: (arg: T, r: IReactionPublic) => void, fireImmediately?: boolean, delay?: number, scope?: any

0 commit comments

Comments
 (0)