The linked resize-observer-polyfill package actually recommends using it as a ponyfill and has deprecated the polyfill behavior (leaving the name of the package questionable lol)
I believe this library should be able to take the ResizeObserver instance as an optional argument.