Git Product home page Git Product logo

Comments (4)

jpillora avatar jpillora commented on September 26, 2024

xhook.after handlers cannot be asynchronous, can you use xhook.before instead?

from xhook.

jasonzhuang avatar jasonzhuang commented on September 26, 2024

How? Or does it possible to make ajax call later, so the asyncData can be received before xhook.after

from xhook.

jasonzhuang avatar jasonzhuang commented on September 26, 2024

How to use xhook.before asynchronous. Does it means in xhook.before we can wait for remote data and change response? Could you show a snippet code? thanks

from xhook.

morsdyce avatar morsdyce commented on September 26, 2024

hi @jasonzhuang

xhook.before will hold your request until you call xhook callback, so you can do anything in the meantime and xhook will hold the request until you're ready to give it data by providing it to the callback.

Please see the examples at:
http://jpillora.com/xhook/

And specifically the fake response example:
http://jpillora.com/xhook/#fake-response

from xhook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.