Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

brage-andreas/tag-functions

Repository files navigation

Tag Functions Logo

Install

npm i @drango/tag-functions

About

Why would you want a tag?

Normally a function works like this:

const greet = (name: string) => `Hello, ${name}`;

greet("Kevin"); // Works 👍
greet`Kevin`; // Errors 👎

But using createTag, the same function will also work as a tag with minimum effort:

import createTag from "@drango/tag-functions";

const greetFn = (name: string) => `Hello, ${name}`;
const greet = createTag(greetFn);

greet("Kevin"); // Works 👍
greet`Kevin`; // Works 👍

About

A way to easily create tag functions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published