Skip to content

Commit

Permalink
Merge pull request #84 from teh/master
Browse files Browse the repository at this point in the history
Introduce preventDefault and stopPropagation. See #83.
  • Loading branch information
paf31 authored Sep 11, 2016
2 parents 7de839d + ea0df6e commit 3cf32f0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/React.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,13 @@ function createFactory(class_) {
return React.createFactory(class_);
}
exports.createFactory = createFactory;

function preventDefault(event) {
return function() { return event.preventDefault();}
};
exports.preventDefault = preventDefault;

function stopPropagation(event) {
return function() { return event.stopPropagation();}
};
exports.stopPropagation = stopPropagation;
6 changes: 6 additions & 0 deletions src/React.purs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ module React
, transformState

, handle
, preventDefault
, stopPropagation

, createClass
, createClassStateless
Expand Down Expand Up @@ -362,3 +364,7 @@ foreign import data Children :: *

-- | Internal conversion function from children elements to an array of React elements
foreign import childrenToArray :: Children -> Array ReactElement

foreign import preventDefault :: forall eff a. Event -> Eff eff a

foreign import stopPropagation :: forall eff a. Event -> Eff eff a

0 comments on commit 3cf32f0

Please sign in to comment.