api.setNext()
Description
Allows adding some action into the Event Bus order
Usage
api.setNext(next: any): void;
Parameters
next
- (required) the action to be included into the Event Bus order
Example
const url = "https://some_backend_url";
const restProvider = new booking.RestDataProvider(url);
Promise.all([
restProvider.getCards(),
]).then(([cards]) => {
const booking = new booking.Booking("#root", {
cards,
cardShape
});
booking.api.setNext(restProvider);
});
info
You need to include RestDataProvider into the Event Bus order to perform operations with data (adding, deleting etc.) and send the corresponding requests to the server
Related articles: