https://github.com/jongacnik/preact-lively
Preact onload/onunload component abstraction
https://github.com/jongacnik/preact-lively
Last synced: about 1 year ago
JSON representation
Preact onload/onunload component abstraction
- Host: GitHub
- URL: https://github.com/jongacnik/preact-lively
- Owner: jongacnik
- Created: 2017-05-03T19:43:35.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-05T01:01:15.000Z (about 9 years ago)
- Last Synced: 2025-02-12T18:18:53.385Z (over 1 year ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# preact-lively
Small wrapper around preact component which provides onload/onunload callbacks similar to [bel](https://github.com/shama/bel#lifecycle-events) because sometimes you don't need to be fancy.
**In progress... Not published yet!**
```
npm i ???
```
## Usage
```js
var Lively = require('preact-lively')
var h = require('preact').h
h(Lively, {
onload: el => console.log('Here I am!'),
onunload: el => console.log('There I go!')
}, children)
```
jsx
```js
{}} onunload={el => {}}>
Hello
```