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

x/netzo/plugins/api/hooks/mod.ts>hooks

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

Returns a new function that wraps an existing async function with hooks.

Type Parameters

F
optional
T = any

Parameters

fn: F & (() => void)

The async function to add hooks to.

optional
manager: HookManager

An array of middleware or hook settings (middleware([]).params() etc.)

Returns

WrappedFunction<F, T>

Add hooks to one or more methods on an object or class.

Parameters

obj: O | (new (...args: any[]) => O)

The object to add hooks to

hookMap: HookMap<O> | AsyncMiddleware[]

A map of middleware settings where the key is the method name.

Decorate a class method with hooks.

Type Parameters

optional
T = any

Parameters

optional
manager: HookOptions

The hooks settings