i have created two function as follows:
1. to create basemap and view
2. to add sketch widget or some other widgets to it
i am calling both the function from a separate js file in order as follows:
loadbasemap();
addwidget()
the problem is before completely executing loadbasemap().it try executing addwidget() and throwing error that "view not created".
what could be the reson or how to handle it.