-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show loading before load and hide after load #47
Comments
Hey, so because you have your own If you send a repro I can help you over the finish line, but tough to provide a generic solution without seeing |
Hi, This is what i do.
|
But it doesnt work. Because it dont show the bar while load the component. Example: https://util123.com |
Sorry, I was asking to see the But yes, this doesn't work because I'm going to assume your function run(thunk, obj) {
const target = uri;
thunk.then(m => {
if (target !== uri) return;
// HAVE UNIQUE ROUTE TO FETCH
// inline: beforeLoadRoute
pageLoadingBar.update(() => true);
params = obj || {};
if (m.preload) {
m.preload({ params }).then(() => {
if (target !== uri) return;
Route = m.default;
window.scrollTo(0, 0);
// DONE LOADING
// inline: afterLoadRoute
pageLoadingBar.update(() => false);
});
} else {
Route = m.default;
window.scrollTo(0, 0);
// DONE LOADING
// inline: afterLoadRoute
pageLoadingBar.update(() => false);
}
});
} Hope that helps! |
Hi,
How i can receive a generic event before load component and after load it?
My components .js file are loaded dynamically, so it still on home until the .js file is loaded. So i want show a loading toast and hide after it was loaded.
Can you help me?
Thanks.
The text was updated successfully, but these errors were encountered: