Partially lazy defineLoader #382
-
Is it possible to define a loader that is partially lazy? I mean that the loader would be blocking for a period of time then switch to lazy in the middle of the loading. The use case is that lazy can sometimes be too quick to change the current route. You might get a flash of a loading screen between the route changing and the loader finishing. The partially lazy loader doesn't solve the problem but it would improve the user experience in some scenarios I believe. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is something I thought about too (https://uvr.esm.is/rfcs/data-loaders/#other-alternatives) but I don't think it's worth it because it's not a reliable solution to avoid the flashing: you will still be able to see flashing if the data takes just a little bit more than the timeout. The real issue here is the unreliable API, although in some cases, it's tied to the call itself and that cannot be changed. The way I would solve this is by only displaying the loading state after a delay or displaying a skeleton to reduce the flash. |
Beta Was this translation helpful? Give feedback.
This is something I thought about too (https://uvr.esm.is/rfcs/data-loaders/#other-alternatives) but I don't think it's worth it because it's not a reliable solution to avoid the flashing: you will still be able to see flashing if the data takes just a little bit more than the timeout. The real issue here is the unreliable API, although in some cases, it's tied to the call itself and that cannot be changed.
The way I would solve this is by only displaying the loading state after a delay or displaying a skeleton to reduce the flash.