Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

Latest commit

 

History

History
42 lines (30 loc) · 1.06 KB

README.md

File metadata and controls

42 lines (30 loc) · 1.06 KB

DEPRECATED

Developement moved back to Drupal.org, please see https://www.drupal.org/project/once.

once-dom

Select and filter DOM elements to process them only once.

Documentation and examples

Example (Use as a module)

<script type="module">
  import once from 'https://unpkg.com/once-dom@latest/dist/once.esm.js';
  const elements = once('my-once-id', 'div');
  // Initialize elements.
  elements.forEach(el => el.innerHTML = 'processed');
</script>

Example (Use as a regular script)

<script src="https://unpkg.com/once-dom@latest/dist/once.min.js"></script>
<script>
  const elements = once('my-once-id', 'div');
  // Initialize elements.
  elements.forEach(el => el.innerHTML = 'processed');
</script>

Full API documentation and examples in the API docs.

Contributors

These amazing people have contributed code to this project: