• Returns a IStatDescription["onChange"] handler that will check a predicate and run the handler with the result of that predicate.

    Parameters

    • predicate: ((info: IStatInfo, entity: default<unknown, number, unknown>) => boolean)

      A function that takes an IStatInfo object and returns whether it "matches".

    • handler: ((matched: boolean, statElement: default<HTMLElement>, entity: default<unknown, number, unknown>, info: IStatInfo) => any)

      A function that takes whether the info matches, the statElement, the entity, and the IStatInfo object and "handles" it.

        • (matched: boolean, statElement: default<HTMLElement>, entity: default<unknown, number, unknown>, info: IStatInfo): any
        • Parameters

          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>
        • stat: IStat
        • Optional oldValue: number

        Returns void

Generated using TypeDoc