As title suggest, is resizeobzerver a synchronous function? I suppose It's synchronous because it waits for changes.
Edit: I asked this question because I face with following problem and I think that is because the resizeObzerver is an asynchronous function:
Here is my snippet. container is the name of a scrollable element.
let resizeObserver = new ResizeObserver((entries) => {
for (entry of entries) {
//......
resizeObserver.observe(container);
Function myFun() {//do something}
console.log (//....);
I'm wondering why every function like myFun and other functions and codes are executed before it. I know ResizeObserver is an asynchronous function and waits to end and then, we can execute the rest of codes, but when I put ResizeObserver.unobserve(container) after resizeObserver.observe(container);, function mFun and console.log (//....); is executed first again. Why? How to modify it to run those after resizeObzerver?