Skip to main content
Module

x/live/hooks/useScript.ts>useScript

Git-based Visual CMS for Deno, </> htmx and Tailwind apps. Deploy on any Deno-compatible host.
Very Popular
Go to Latest
function useScript
import { useScript } from "https://deno.land/x/live@1.100.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.