ensure
Last updated
Last updated
Returns a new event definition whose events will first go through the validator before being passed to their target. Events that don't pass the validator won't reach their targets.
validator
:
The function used to validate the event.
eventDef
:
The event you want to validate.
Accepts an event or array of events as its sole argument.
Returns true
if the event is valid.
Returns false
if the event is not valid.