Home > widget-integration > FilterHelper > createHandler
FilterHelper.createHandler() method
Wraps a callback function to handle customization logic. Checks if custom handler functions are defined for the callback name and block type, and wraps the original callback to call them before/after. Allows overriding default handlers or injecting logic before/after calls.
Signature:
createHandler<T extends (...args: any[]) => any>(callback: T, handlerName?: string): (...args: Parameters<T>) => Promise<ReturnType<T>>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
callback |
T |
The original callback function to wrap |
|
handlerName |
string |
(Optional) Optional custom name for the handler (defaults to callback.name) |
Returns:
(...args: Parameters<T>) => Promise<ReturnType<T>>
Wrapped async function that executes with customization hooks