Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-hammerjs

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-hammerjs - npm Package Compare versions

Comparing version 0.6.7 to 0.6.8

5

es/Hammer.js

@@ -11,4 +11,5 @@ import _classCallCheck from 'babel-runtime/helpers/classCallCheck';

// https://github.com/JedWatson/react-hammerjs/issues/14
// wait to see if we need the condition require hack for ssr
import Hammer from 'hammerjs';
// require('hammerjs') when in a browser. This is safe because Hammer is only
// invoked in componentDidMount, which is not executed on the server.
var Hammer = typeof window !== 'undefined' ? require('hammerjs') : undefined;

@@ -15,0 +16,0 @@ var privateProps = {

19

lib/Hammer.js

@@ -35,8 +35,10 @@ 'use strict';

var _hammerjs = require('hammerjs');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _hammerjs2 = _interopRequireDefault(_hammerjs);
// https://github.com/hammerjs/hammer.js/issues/930
// https://github.com/JedWatson/react-hammerjs/issues/14
// require('hammerjs') when in a browser. This is safe because Hammer is only
// invoked in componentDidMount, which is not executed on the server.
var Hammer = typeof window !== 'undefined' ? require('hammerjs') : undefined;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var privateProps = {

@@ -55,5 +57,2 @@ children: true,

// https://github.com/hammerjs/hammer.js/issues/930
// https://github.com/JedWatson/react-hammerjs/issues/14
// wait to see if we need the condition require hack for ssr
var handlerToEvent = {

@@ -101,4 +100,4 @@ action: 'tap press',

var direction = directionProp ? directionProp : props.vertical ? 'DIRECTION_ALL' : 'DIRECTION_HORIZONTAL';
hammer.get('pan').set({ direction: _hammerjs2['default'][direction] });
hammer.get('swipe').set({ direction: _hammerjs2['default'][direction] });
hammer.get('pan').set({ direction: Hammer[direction] });
hammer.get('swipe').set({ direction: Hammer[direction] });
}

@@ -152,3 +151,3 @@

value: function componentDidMount() {
this.hammer = new _hammerjs2['default'](_reactDom2['default'].findDOMNode(this));
this.hammer = new Hammer(_reactDom2['default'].findDOMNode(this));
updateHammer(this.hammer, this.props);

@@ -155,0 +154,0 @@ }

{
"name": "rc-hammerjs",
"version": "0.6.7",
"version": "0.6.8",
"description": "ReactJS / HammerJS integration. Support touch events in your React app.",

@@ -5,0 +5,0 @@ "main": "./lib/index",

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