iTwin / viewer

Monorepo that contains the iTwin Viewer npm packages and their related packages
MIT License
25 stars 16 forks source link

Add additional initialization callback #138

Open kckst8 opened 2 years ago

kckst8 commented 2 years ago

Weigh pros/cons of moving onIModelAppInit to after total initialization. Failing that, add another callback when all deps are initialized.

From @Ali Aslam

"We want to do all our initializations in onIModelAppInit, but it seems the event is called very early before the ui/presentation initialization. Some of our initialization that depends on presentation being initialized fails in this callback.

Is it possible to introduce a third event or to change the location of onIModelAppInit firing position to end of BaseInitializer.initialize (here)? Or maybe you can notify using a new ‘onImodelJsInitialized’ prop which gets set when initialization is finished (like here)."