@accurat/event-utils
Advanced tools
Comparing version 1.0.0 to 1.0.1
12
index.js
function preventingDefault(fn) { | ||
// react supports passing null to event bindings | ||
if (fn === null) return null | ||
return e => { | ||
e.preventDefault() | ||
// react supports passing null to event bindings | ||
if (fn === null) return null | ||
return fn(e) | ||
@@ -12,6 +13,7 @@ } | ||
function stoppingPropagation(fn) { | ||
if (fn === null) return null | ||
return e => { | ||
e.stopPropagation() | ||
if (fn === null) return null | ||
return fn(e) | ||
@@ -18,0 +20,0 @@ } |
{ | ||
"name": "@accurat/event-utils", | ||
"private": false, | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "High order functions to use in React's JSX when working with events", | ||
@@ -32,5 +31,5 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"node": ">=6" | ||
}, | ||
"sideEffects": false | ||
} |
@@ -52,3 +52,3 @@ # @accurat/event-utils | ||
Those functions use the powers of **functional programming** 🌪, so you can combine them! | ||
Also those functions use the powers of **functional programming** 🌪, so you can combine them! | ||
@@ -74,3 +74,5 @@ ```js | ||
This way you don't have to use anymore the **build pattern** in react, and you can get rid of all those boilerplate methods in the component! | ||
## API | ||
@@ -77,0 +79,0 @@ |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
5221
97