hook

fun <C, R, P> C.hook(h: Hook<C, R, P>, payload: P): Unit?

This hook method applies a Hook's encapsulated behaviour to the calling context and passes a given payload.

Parameters

h

The hook implementation

payload

some additional data

See also


fun <C, R> C.hook(h: Hook<C, R, Unit>): Unit?

This hook method applies a Hook's encapsulated behaviour to the calling context.

Parameters

h

The hook implementation

See also


fun <C, R> C.hook(vararg h: Hook<C, R, Unit>)

This hook method applies multiple Hook's encapsulated behaviour to the calling context with the payload of type Unit.

This is a shortcut for situation where lots of hooks needs to be applied at the same location:

// instead of this...
hook(a)
hook(b)
hook(c)

// ... the application of this variant shortens the code:
hook(a, b, c)

Parameters

h

some hook implementations

See also


fun <C, R, P> C.hook(h: Hook<C, R, TagPayload<P>>, classes: String?, id: String?, payload: P): Unit?

This hook method applies a Hook's encapsulated behaviour to the calling context with a specific payload TagPayload, which is tailored to Tag creation, as it offers parameters for the id and a styling parameter classes on top to the generic payload P.

As implementor of the Hook the creation of the value property simply requires to unpack the TagPayload.

Parameters

h

The hook implementation

classes

some optional styling information

id

an optional id for applying to the hook's content

payload

some additional data

See also