Hooks
Appmaker Hooks: Functions and Filters
Appmaker Hooks are functions that can be used to modify the behavior of the Appmaker platform. They are used to add new features to the platform, modify existing features, and remove features that are not needed.
Adding a function hook
To add a function hook, you need to use the appmakerFunctions.registerAppmakerFn
function. This function takes three parameters:
trigger
- The name of the function that you want to modify.namespace
- The name of the package that is adding the hook.function
- The function that will be called when the trigger is called.
`appmakerFunctions.registerAppmakerFn({ trigger, namespace, function })`
The function that is passed to the appmakerFunctions.registerAppmakerFn
takes the parameters that are passed to the trigger function. The function should return the modified parameters.
function myFunctionHook(params) {
// Modify the params
return params;
}
You can refer to the Functions section for a list of available functions.
Adding a filter hook
To add a filter hook, you need to use the appmaker.addFilter
function. This function takes three parameters:
trigger
- The name of the function that you want to modify.namespace
- The name of the package that is adding the hook.function
- The function that will be called when the trigger is called.
`appmaker.addFilter({trigger,namespace,function})`
You can refer to the Filters section for a list of available filters.