cookies:completeis dispatched even if the cookie widget doest not pop. If we find preferences inside the browser's cookies, we dispatch the event and discard the widget opening.
cookies:completeevent is sent with a payload containing the user's choices
indexwhich is the integer index of the step in the array of steps. It also contains the Step definition (identifier, title, description, list of vendors, etc.)
eventparameter accepts wildcards
*in order to listen to several events at once. For example, you could pass
cookies:*and subsequentely receive every event related to our Cookie Widget.
handlerparameter is a function that gets called when the event emitter dispatches an event matching the
eventparameter pattern. The handler function will receive two arguments:
optionsoptional parameter is an object composed of the flags:
replayis set to
true, past events that have been dispatched before the event handler is set will result in calling the handler function right away. If set to
false, only subsequent events will trigger a call to the handler.
onceis set to
true, the handler will only be called once. After it's been called, a matching event won't call it again.
offmethod will unsubscribe the specified
handlerfor the specified
event, if it is specified as the second parameter of the function. If
handleris unspecified, every handler function listening to the exact
eventpattern will be removed of the handlers array.