Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/blocks/hooks/useScript.ts>useScript

Git-based Visual CMS for Deno, </> htmx and Tailwind apps. Deploy on any Deno-compatible host.
Go to Latest
function useScript
import { useScript } from "https://deno.land/x/blocks@1.102.1/hooks/useScript.ts";

Hook to create a minified script tag from a function.

Type Parameters

T extends (...args: any[]) => any
  • Type of the function to be used as script

Parameters

fn: T
  • The function to be included as a script.
...params: Parameters<T>
  • Parameters to be passed to the function.

Returns

string

The minified script tag content.