api.intercept()
Description
Allows intercepting and preventing the inner events
Usage
api.intercept(
event: string,
callback: function
): void;
Parameters
event
- (required) an event to be firedcallback
- (required) a callback to be performed (the callback arguments will depend on the event to be fired)
info
Example
// create Booking
const booking = new booking.Booking("#root", {
data,
// other configuration parameters
});
// every time the filter-data event is triggered, slots will be shown only for the morning time
booking.api.intercept("filter-data", data => {
data.time = [{ from: 9, to: 12 }];
});