A Svelte 3 action to use the resize observer for a specific element.
npm install svelte-observe-resize --save-dev
<script>
import observeResize from 'svelte-observe-resize';
function handleResize() {
// called when element is resized
}
</script>
<main>
<div use:observeResize on:resize={handleResize}></div>
</main>