Closed alro5 closed 7 years ago
@alro5 I had the same problem here using react and I was able to solve it using the "timeout,0 solution"
window.setTimeout(() => {
Macy.init(macyProps);
return true;
}, 0);
Here's some explanation about the concept behind of it.
https://stackoverflow.com/questions/779379/why-is-settimeoutfn-0-sometimes-useful/779785#779785
After looking into the reason why this happens, I feel like this is more the issue on how javascript works. Closing due to a successful workaround.
Hello,
I'm having trouble initialising Macy. I'm working on an angular app, and I'm building a blog system. The blog page is requesting an endpoint and displaying the blogposts in an ng-repeat.
The data is being loaded, and then we're trying to init Macy after this request.
So in our success call, we're firing Macy after the data is loaded
I can solve this by a timeout, but this is not a bulletproof solution.
Hope you can help!