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.

See also

Parameters

h

The hook implementation

payload

some additional data


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

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

See also

Parameters

h

The hook implementation


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)

See also

Parameters

h

some hook implementations


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.

See also

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