Skip to content

callable

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

Usage

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

Installation

Terminal window
npx atmx add helper callable