@pleisto/active-support
    Preparing search index...

    Variable callableConst

    callable: <
        TValue,
        TObj extends Record<string | number | symbol, TValue>,
        TFunc extends (...args: any) => any,
    >(
        obj: TObj,
        fn: (self: TObj) => TFunc,
    ) => TObj & TFunc

    Make an object callable. Given an object and a function the returned object will be a function with all the objects properties.

    Type declaration

      • <
            TValue,
            TObj extends Record<string | number | symbol, TValue>,
            TFunc extends (...args: any) => any,
        >(
            obj: TObj,
            fn: (self: TObj) => TFunc,
        ): TObj & TFunc
      • Type Parameters

        • TValue
        • TObj extends Record<string | number | symbol, TValue>
        • TFunc extends (...args: any) => any

        Parameters

        Returns TObj & TFunc

    const car = callable({
    wheels: 2
    }, self => () => {
    return 'driving'
    })

    car.wheels // => 2
    car() // => 'driving'