UNPKG
swallowify
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
Stop propagation of the current event
github.com/jonhni/swallowify
jonhni/swallowify
swallowify
/
index.js
12 lines
(11 loc)
•
224 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
'use strict'
;
module
.
exports
=
function
(
fn
) {
return
typeof
fn ===
'function'
?
function
(
event
) { event.
stopPropagation
();
return
fn
(event); } :
function
(
) {
return
false
; }; };