@leanchuck/core - v0.1.1
    Preparing search index...

    Type Alias NumberAccessor<T>

    NumberAccessor: keyof T | ((item: T) => number)

    Resolves to a numeric value for a given item. Either the key of a numeric property, or a function that derives the number.

    Type Parameters

    • T
    const byRevenue: NumberAccessor<Row> = 'revenue';
    const byProfit: NumberAccessor<Row> = (r) => r.revenue - r.cost;