Open spyderdsn opened 6 months ago
How to know when page blocks are done and DOM is fully updated? Is there any callback function?
const { data: blockMap } = useAsyncData('page_nuxt', () => $notion.getPageBlocks(pageUrl))
at the moment I'm using timeout but it is not always reliable:
await nextTick(() => { setTimeout(() => { document.body.scrollTop = 0 // For Safari document.documentElement.scrollTop = 0 animations.apply('.notion', 'animated fade-in-right') isLoading.value = false }, 1500) })
Hmm, I assume as soon as the Promise resolves (the await finishes) all blocks are in the response. The helper (API call collects all the blocks). Maybe I’m missing something… 🤔
How to know when page blocks are done and DOM is fully updated? Is there any callback function?
const { data: blockMap } = useAsyncData('page_nuxt', () => $notion.getPageBlocks(pageUrl))
at the moment I'm using timeout but it is not always reliable: