Skip to content

Commit 7aed62e

Browse files
committed
change the return type of a function parameter of autorunAsync to any
1 parent 12a9c2c commit 7aed62e

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎flow-typed/mobx.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,9 @@ declare module 'mobx' {
307307
declare function runInAction<T>(name: string, block: () => T, scope?: any): T;
308308
declare function runInAction<T>(block: () => T, scope?: any): T;
309309
declare function isAction(thing: any): boolean;
310-
declare function autorun(nameOrFunction: string | (r: IReactionPublic) => void, viewOrScope?: any, scope?: any): any;
310+
declare function autorun(nameOrFunction: string | (r: IReactionPublic) => any, viewOrScope?: any, scope?: any): any;
311311
declare function when(predicate: () => boolean, effect: Lambda, scope?: any): any
312-
declare function autorunAsync(func: (r: IReactionPublic) => void, delay?: number, scope?: any): any
312+
declare function autorunAsync(func: (r: IReactionPublic) => any, delay?: number, scope?: any): any
313313
declare function reaction<T>(
314314
expression: (r: IReactionPublic) => T, effect: (arg: T, r: IReactionPublic) => void, fireImmediately?: boolean, delay?: number, scope?: any
315315
): any

‎src/api/autorun.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {getMessage} from "../utils/messages";
1212
* @param scope (optional)
1313
* @returns disposer function, which can be used to stop the view from being updated in the future.
1414
*/
15-
export function autorun(view: (r: IReactionPublic) => void, scope?: any): IReactionDisposer;
15+
export function autorun(view: (r: IReactionPublic) => any, scope?: any): IReactionDisposer;
1616

1717
/**
1818
* Creates a named reactive view and keeps it alive, so that the view is always
@@ -22,10 +22,10 @@ export function autorun(view: (r: IReactionPublic) => void, scope?: any): IReact
2222
* @param scope (optional)
2323
* @returns disposer function, which can be used to stop the view from being updated in the future.
2424
*/
25-
export function autorun(name: string, view: (r: IReactionPublic) => void, scope?: any): IReactionDisposer;
25+
export function autorun(name: string, view: (r: IReactionPublic) => any, scope?: any): IReactionDisposer;
2626
export function autorun(arg1: any, arg2: any, arg3?: any) {
2727
let name: string,
28-
view: (r: IReactionPublic) => void,
28+
view: (r: IReactionPublic) => any,
2929
scope: any;
3030

3131
if (typeof arg1 === "string") {
@@ -105,10 +105,10 @@ export function when(arg1: any, arg2: any, arg3?: any, arg4?: any) {
105105
return disposer;
106106
}
107107

108-
export function autorunAsync(name: string, func: (r: IReactionPublic) => void, delay?: number, scope?: any): IReactionDisposer;
109-
export function autorunAsync(func: (r: IReactionPublic) => void, delay?: number, scope?: any): IReactionDisposer;
108+
export function autorunAsync(name: string, func: (r: IReactionPublic) => any, delay?: number, scope?: any): IReactionDisposer;
109+
export function autorunAsync(func: (r: IReactionPublic) => any, delay?: number, scope?: any): IReactionDisposer;
110110
export function autorunAsync(arg1: any, arg2: any, arg3?: any, arg4?: any) {
111-
let name: string, func: (r: IReactionPublic) => void, delay: number, scope: any;
111+
let name: string, func: (r: IReactionPublic) => any, delay: number, scope: any;
112112
if (typeof arg1 === "string") {
113113
name = arg1;
114114
func = arg2;

0 commit comments

Comments
 (0)