@gustavofsantos/defn
v1.0.1
Published
Utilitary function to define functions with multiple implementations.
Downloads
5
Readme
defn
Utilitary function to define functions with multiple implementations.
Getting Started
Install this package using your favorite package manager:
$ npm i @gustavofsantos/defnThen define your first variadic function.
const greet = defn(
() => "Hello you",
(name) => `Hello, ${name}`
)
greet() // Hello you
greet('Gustavo') // Hello, Gustavo