Socket
Socket
Sign inDemoInstall

bel

Package Overview
Dependencies
Maintainers
3
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bel - npm Package Compare versions

Comparing version 4.3.2 to 4.4.0

14

index.js
var document = require('global/document')
var hyperx = require('hyperx')
var onload = require('on-load')

@@ -56,2 +57,15 @@ var SVGNS = 'http://www.w3.org/2000/svg'

// If adding onload events
if (props.onload || props.onunload) {
var load = props.onload
var unload = props.onunload
onload(el, function bel_onload () {
load(el)
}, function bel_onunload () {
unload(el)
})
delete props.onload
delete props.onunload
}
// Create the properties

@@ -58,0 +72,0 @@ for (var p in props) {

9

package.json
{
"name": "bel",
"version": "4.3.2",
"version": "4.4.0",
"description": "A simple extension to native elements",

@@ -32,3 +32,4 @@ "main": "index.js",

"global": "^4.3.0",
"hyperx": "^2.0.2"
"hyperx": "^2.0.2",
"on-load": "^3.0.0"
},

@@ -40,6 +41,6 @@ "devDependencies": {

"standard": "^6.0.7",
"tape": "^4.5.0",
"tape": "^4.6.0",
"testron": "^1.2.0",
"wzrd": "^1.3.1"
"wzrd": "^1.4.0"
}
}

@@ -99,2 +99,20 @@ # [bel](https://en.wikipedia.org/wiki/Bel_(mythology))

### lifecycle events
Use the `onload` and `onunload` properties to call a function when the element
is inserted and removed from the DOM respectively.
```js
var bel = require('bel')
var modal = bel`<div onload=${function (element) {
console.log('Hello DOM!')
}} onunload=${function (element) {
console.log('Goodbye DOM!')
}}>hello!</div>`
document.body.appendChild(modal)
document.body.removeChild(modal)
```
### use with/without [hyperx](https://www.npmjs.com/package/hyperx)

@@ -101,0 +119,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc