small medium large xlarge

Generic-user-small
23 Apr 2016, 14:31
Saraf (2 posts)

Thanks for the good book!

In the example on page 78 - we save the getCurrentPosition function in var original, then - stub out navigator.geolocation.getCurrentPosition, then call locate() and then revert navigator.geolocation.getCurrentPosition back to the original.

Suppose locate() does something asynchronously - is a scenario possible where we revert navigator.geolocation.getCurrentPosition back to original before locate() uses it?

Venkatsubramaniam_pragsmall
23 Apr 2016, 15:37
Venkat Subramaniam (99 posts)

Hi Saraf,

Thank you.

If locate does something in addition to calling getCurrentPosition and responds eventually and asynchronously, then we’ll have to revert the getCurrentPosition after that response arrives (in this case we’ll mix some of the techniques we discussed in the Async chapter).

Regards,

Venkat

You must be logged in to comment