Best way for binding and sync'ing under an asynchronous world

In order to create data binds or sync’ing data, both objects (master-slave, source-destination) must be instanced in advanced. The way I found to guarantee that precondition -at startup time of my app- is implementing a sort of “app.init” or “app.onReady”. So my model can be loaded synchronously via <“script src”> then, during webix.onReady I create a promiz that waits until all view models are loaded via webix.require, and finally fire an app.init where binds and syncs take place. Is this approach correct or is there a simpler way to accomplish this task considering webix async nature? Thanks. Greetings and prosper 2016.

Hello,

please take a look at the article about Data Binding and Syncing. If you are using sync(), the slave collection will get its data after master data are loaded. However, if a view can not be initialized without data or requires data from different sources, your solution with promises is correct.

Best regards

Thank you Maria. I’ll take into account the tip over sync().