In order to define a hook on a slide, we need to define the hook type and a callback function. The callback function includes two parameters: a done function and an optional data parameter. The done function has to be called after the custom code has been executed, otherwise, the default flow will be interrupted. The data parameter contains contextual information related to the hook. The extension parameter is an internal parameter needed to define the hook.
- Question slide
- onSelect: Executed when an option is clicked. The data parameter contains the index of the selected option.
- onSkip: Executed when the Skip button is clicked.
- onNext: Executed when the Next button is clicked.
- Form slide
- onSend: Executed when the Next button is clicked.
- onSkip: Execute when the Skip button is clicked.