Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dux/custom_element
https://github.com/dux/custom_element
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dux/custom_element
- Owner: dux
- License: mit
- Created: 2019-05-27T01:08:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-03T22:14:34.000Z (over 5 years ago)
- Last Synced: 2024-03-26T17:21:24.584Z (10 months ago)
- Language: CoffeeScript
- Size: 5.86 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DOM window.createElement - polyfill
Polyfill for `window.customElements` with alternative approach
If window.createElement
* is suppoted - we use native `window.customElements` [DOM method](https://developer.mozilla.org/en-US/docs/Web/API/Window/customElements)
* is not supported - we register a node and a method, and we call it in interval to re-bind not binded nodes## Usage
to install
```
npm add '@dinoreic/custom_element'
```to use
```
import CustomElement from '@dinoreic/custom_element'
CustomElement.define('dom-node-name', function(dom_node, node_atts) { ... })
```