https://github.com/bendrucker/append-hook
virtual-dom hook for element append
https://github.com/bendrucker/append-hook
Last synced: 11 months ago
JSON representation
virtual-dom hook for element append
- Host: GitHub
- URL: https://github.com/bendrucker/append-hook
- Owner: bendrucker
- License: mit
- Created: 2015-08-26T15:49:35.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2019-08-19T21:51:24.000Z (almost 7 years ago)
- Last Synced: 2025-06-11T10:04:06.658Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# append-hook [](https://travis-ci.org/bendrucker/append-hook) [](https://greenkeeper.io/)
> virtual-dom hook for element append
## Install
```
$ npm install --save append-hook
```
## Usage
```js
var AppendHook = require('append-hook')
var h = require('virtual-dom/h')
var vtree = h('div', {
onAppend: AppendHook(callback)
})
function callback (node) {
//=> div appended to the DOM
}
```
## API
#### `AppendHook(callback)` -> `object`
##### callback
*Required*
Type: `function`
A callback to call when the virtual node is appended to the DOM as a real node.
## License
MIT © [Ben Drucker](http://bendrucker.me)