1.0.20
https://jsfiddle.net/ardoramor/zjx57L55/
Open console and execute the fiddle.
I would expect to see the following output in the console:
new state idle
new state opening
new state buffering
new state playing
new state stopping
new state idle
I only see the initial state setting because watch is debounced:
new state idle
I am using reactiveness in conjunction with a non-reactive player that emits events. I then rely upon state changes to facilitate UX features (hiding panels, switching streams). In one case, when one stream buffers for too long, I switch to the next one. Yet, because events of change (stop, open, buffer) are fired off so fast, Vue acts like nothing happened (because it stopped on buffer, where it started). It would be great if an option was available for advanced users to specify so that changes were propagated without debouncing.
The immediate flag is for triggering the change callback right after the initial watch call. It's not about synchronous callbacks. You can pass sync: true to get synchronous callbacks, but that's not part of the official API and it's better not to rely on it.
Most helpful comment
The
immediateflag is for triggering the change callback right after the initial watch call. It's not about synchronous callbacks. You can passsync: trueto get synchronous callbacks, but that's not part of the official API and it's better not to rely on it.