MCPcopy Index your code
hub / github.com/mobxjs/mobx / when

Function when

packages/mobx/src/api/when.ts:29–34  ·  view source on GitHub ↗
(predicate: any, arg1?: any, arg2?: any)

Source from the content-addressed store, hash-verified

27 opts?: IWhenOptions
28): IReactionDisposer
29export function when(predicate: any, arg1?: any, arg2?: any): any {
30 if (arguments.length === 1 || (arg1 && typeof arg1 === "object")) {
31 return whenPromise(predicate, arg1)
32 }
33 return _when(predicate, arg1, arg2 || {})
34}
35
36function _when(predicate: () => boolean, effect: Lambda, opts: IWhenOptions): IReactionDisposer {
37 let timeoutHandle: any

Callers 5

map.jsFile · 0.90
object-api.jsFile · 0.50
array.jsFile · 0.50
object-api.jsFile · 0.50

Calls 2

whenPromiseFunction · 0.85
_whenFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…