Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/netzo/deps/usehooks-ts.ts>useBoolean

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
function useBoolean
import { useBoolean } from "https://deno.land/x/netzo@0.5.67/deps/usehooks-ts.ts";

Custom hook for handling boolean state with useful utility functions.

Examples

const { value, setTrue, setFalse, toggle } = useBoolean(true);

console.log(value); // true setFalse(); console.log(value); // false toggle(); console.log(value); // true

Parameters

optional
defaultValue: boolean
  • The initial value for the boolean state (default is false).

Returns

UseBooleanOutput

An object containing the boolean state value and utility functions to manipulate the state.