https://github.com/component/inserted
Invoke a callback when a DOM element is inserted into the document
https://github.com/component/inserted
Last synced: about 1 year ago
JSON representation
Invoke a callback when a DOM element is inserted into the document
- Host: GitHub
- URL: https://github.com/component/inserted
- Owner: component
- Created: 2012-09-13T20:15:32.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2017-04-29T19:30:36.000Z (about 9 years ago)
- Last Synced: 2025-06-06T02:41:28.035Z (about 1 year ago)
- Language: JavaScript
- Size: 173 KB
- Stars: 13
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# inserted
Invoke a callback when a DOM element is inserted.
## Installation
$ component install component/inserted
## Example
```js
var inserted = require('inserted');
inserted(el, function(){
console.log('element was inserted!');
});
```
## API
### inserted(el, fn)
Invokes `fn` when `el` is inserted from the DOM.
### .interval
The `setInterval` fallback uses `inserted.interval`, defaulting to 200ms.
# License
MIT