Sometimes I'm coding in a wrong way my polymer 1.0 web app and stuff stops to work properly. Like setting data to some custom element and then immediately trying to read some data out of it (that depends on the data just set) (because I don't know better). Sometimes this doesn't work. Most of the time this.async
will help me out, but sometimes it will not. However, setTimeout
has never ever failed me in these kind of situations. Most of the time calling setTimeout
without providing wait time will work just as well.
For a long time I thought that this.async(function(){...})
is the same as setTimeout(function(){...})
. Because sometimes code inside this.async
will fail to see changes in custom element's data while code inside setTimeout
will not.
Are these two methods are implemented in different way?