@nosto/preact

    Function waitForElement

    • Wait for element to appear in DOM using MutationObserver

      Parameters

      Returns Promise<void | Element>

      First element it finds

      import { waitForElement } from '@nosto/preact'

      init({
      serpRenderDelay: () => {
      return waitForElement({
      selector: 'script[type="text/x-magento-init"]',
      timeout: 1000 //1 second
      })
      },
      })
    MMNEPVFCICPMFPCPTTAAATR