Comparing version 0.0.2 to 0.0.3
@@ -1,1 +0,1 @@ | ||
var b={},e={},f=(e.on=function(a,d){b[a]||(b[a]=[]);b[a].push(d)},e.off=function(a,d){for(var c=0;c<b[a].length;c++)d===b[a][c]&&b[a].splice(c,1)},e.emit=function(a,d){for(var c=0;c<b[a].length;c++)b[a][c](d)},e);'undefined'!==typeof module?module.exports=f:window.busa=f; | ||
var b={},e={},f=(e.on=function(a,d){b[a]||(b[a]=[]);b[a].push(d)},e.off=function(a,d){for(var c=0;c<(b[a]||[]).length;c++)d===b[a][c]&&b[a].splice(c,1)},e.emit=function(a,d){for(var c=0;c<(b[a]||[]).length;c++)b[a][c](d)},e);'undefined'!==typeof module?module.exports=f:window.busa=f; |
{ | ||
"name": "busa", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "dist/bus.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
A Busa is a silly mustache that makes its wearer especially opinionated and unreasonable. | ||
#### Example | ||
```javascript | ||
/** | ||
* This will fire handle off on window load. | ||
* If an error is encountered before the handle | ||
* is removed and will not fire. | ||
*/ | ||
import bus from "busa"; | ||
function handle(props) { | ||
console.log(props.msg); | ||
} | ||
bus.on("window:load", handle); | ||
window.addEventListener("load", function(event) { | ||
bus.emit("window:load", { msg: "Done loading", event }); | ||
}); | ||
window.addEventListener("error", function(event) { | ||
bus.off("window:load", handle); | ||
}); | ||
``` |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
27
2456
4
2
1