No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Quasar preFetch return value unclear

    Help
    2
    2
    267
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      gman last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • H
        hexillion last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post