0

i have question there is some way, how to detect if page was rendered. I mean after all async calls. Is there some method isfinalyrendered ??

Thx

3
  • No, there isn't Commented Aug 3, 2018 at 12:52
  • @MatthiasS maybe something in future ?? Commented Aug 3, 2018 at 12:54
  • I don't see how this would directly correlate to vue.js. What async calls do you mean exactly? The only way I could think of right now is that you use your own ajax wrapper function and reset a timer each time it is called and once that timer ends you call your isFinallyRendered function. Maybe somebody else has a better idea :-) Commented Aug 3, 2018 at 13:33

1 Answer 1

1

First of all, have a logic to count the number of async calls in your component. As due to particular condition they might be more in one case and lesser in another case.

Then you just have to pass a callback in your async function, which increases the counter on promise resolve/reject. When counter's value==totalAsyncCalls. Then you can call your isfinalyrendered method

var count = totalAsyncCalls
    callback = function () {
        count--;
        if (0==count){
          isfinalyrendered();
         }

        // do stuff
    };
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.