JSPM

element-viewer

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 33
  • Score
    100M100P100Q59581F
  • License MIT

Know if some element is being viewed and trigger to anything you want.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (element-viewer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    INSTALLATION

    SCRIPT

    <script src="https://unpkg.com/element-viewer@1.0.1/dist/element-viewer.min.js"></script>

    NPM

    npm i element-viewer

    YARN

    yarn add element-viewer

    USAGE:

    elementViewer({
      elementSelector: '.stamped-io', // the element selector to observe if being visualized
      visualizationTimer: 3000 // time to consider the visualization
    }, () => {
      sendToAnalytics('review_viewed') // send to analytics with the event name (example method)
    })

    DEVELOPMENT

    • Light Weight on Bundlephobia