Quasar preFetch return value unclear



  • Hello,

    I think the docs are not very clear on what the preFetch function should return, and what action Quasar takes depending on the returned value. It only has an example that suggests we should return a promise, but doesn’t explain what happens if the promise is not fulfilled. Does Quasar stop loading the component? Does it redirect to the previous page? What if I don’t return a promise?
    https://quasar.dev/quasar-cli/prefetch-feature

    Can I get a description of the expected return value from the preFetch hook, and how it affects page loading?

    Thanks.



  • if you have async methods, you can return a promise which resolves once your methods are run. as you can see in the redirect example, i believe that prefetch does not require any return value and still works.


Log in to reply