Module

x/live/hooks/useScript.ts>useScript

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