UNPKG

computed-async-mobx

Version:

Define a computed by returning a Promise

11 lines (10 loc) 470 B
/** * Closely based on autorunAsync but with difference that the first execution * happens synchronously. This allows `delayedComputed` to have a simpler * type signature: the value is never `undefined`. * * @param func The function to execute in reaction * @param delay The minimum delay between executions * @param name (optional) For MobX debug purposes */ export declare function autorunThrottled(func: () => void, delay: number, name?: string): () => void;