cookies:complete
is 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:complete
event is sent with a payload containing the user's choicesindex
which 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.)event
parameter 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.handler
parameter is a function that gets called when the event emitter dispatches an event matching the event
parameter pattern. The handler function will receive two arguments: options
optional parameter is an object composed of the flags:replay
is 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.once
is set to true
, the handler will only be called once. After it's been called, a matching event won't call it again.off
method will unsubscribe the specified handler
for the specified event
, if it is specified as the second parameter of the function. If handler
is unspecified, every handler function listening to the exact event
pattern will be removed of the handlers array. payload
parameter.