Function: dub()

Assigns the name to the given function. Note that this is a mutating operation!

dub is curried.

Example

import {dub} from "@longlast/dub";
import {curry} from "@longlast/curry";
import {getFunctionName} from "@longlast/function-name";

const add = dub(
    "add",
    curry((a: number, b: number) => a + b),
);

getFunctionName(add); // => "add"

Call Signature

dub<F>(name: string, f: F): F

Defined in: pkg/dub/src/index.ts:9

Type Parameters

Type Parameter
F extends AnyFunction

Parameters

Parameter Type
name string
f F

Returns

F

Call Signature

dub(name: string): <F>(f: F) => F

Defined in: pkg/dub/src/index.ts:10

Parameters

Parameter Type
name string

Returns

<F>(f: F): F

Type Parameters

Type Parameter
F extends AnyFunction

Parameters

Parameter Type
f F

Returns

F