Title: Message Title
|
|
|
|
I found this google group page having discussion about this: https://groups.google.com/forum/#!topic/requirejs/JX-9bHP1BBo.
I think in generic case we can't know the total set of modules to load from the very start, again each loaded module could unearth more dependencies. So, I am not sure how we are going to find out the percentage of total number of modules already loaded, then only we could update the value of progress bar accordingly.
So, Here are the two approaches I think could work in this case:
1. Create a separate file containing an array of the names of all the resources we are going to use in our app, in this way we can have the value of total number of resources to be added(this file will have to be updated manually with every new newly added resource). After that we can use something like an "onload" event as given on: http://requirejs.org/docs/plugins.html#apiload. Now with every onload event we can check whether that resource is defined using parentRequire.defined(moduleName), given in last link and then update the progress bar with each loaded resource. (This is something I could think of theoretically, hopefully someone will look out for the feasibility of the same).
2. Simply use an indeterminate spinner until the dom is ready and then remove it with DOMready event: http://requirejs.org/docs/api.html#pageload. (I guess this would be a better approach, since we will move to lazy loading anyways).
Still I think implementing this will need quite a work. Anyone having a clear idea about the best possible approach for this issue?
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues