- when(predicate: ((info: IStatInfo, entity: default<unknown, number, unknown>) => boolean), handler: ((matched: boolean, statElement: default<HTMLElement>, entity: default<unknown, number, unknown>, info: IStatInfo) => any)): ((statElement: default<HTMLElement>, entity: default<unknown, number, unknown>, stat: IStat, oldValue?: number) => void)
-
Parameters
-
predicate: ((info: IStatInfo, entity: default<unknown, number, unknown>) => boolean)
-
- (info: IStatInfo, entity: default<unknown, number, unknown>): boolean
-
Parameters
-
-
entity: default<unknown, number, unknown>
Returns boolean
-
handler: ((matched: boolean, statElement: default<HTMLElement>, entity: default<unknown, number, unknown>, info: IStatInfo) => any)
-
- (matched: boolean, statElement: default<HTMLElement>, entity: default<unknown, number, unknown>, info: IStatInfo): any
-
Parameters
-
matched: boolean
-
statElement: default<HTMLElement>
-
entity: default<unknown, number, unknown>
-
Returns any
Returns ((statElement: default<HTMLElement>, entity: default<unknown, number, unknown>, stat: IStat, oldValue?: number) => void)
-
- (statElement: default<HTMLElement>, entity: default<unknown, number, unknown>, stat: IStat, oldValue?: number): void
-
Parameters
-
statElement: default<HTMLElement>
-
entity: default<unknown, number, unknown>
-
-
Optional
oldValue: number
Returns void
Returns a
IStatDescription["onChange"]
handler that will check a predicate and run the handler with the result of that predicate.