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

@hscmap/inertial-mouse

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hscmap/inertial-mouse - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

.npmignore

5

lib/inertial_mouse.d.ts

@@ -9,2 +9,3 @@ import { V2 } from "./v2";

moveend?(e: MoveEndEvent): void;
setNextTick?(tick: () => void): void;
}

@@ -21,5 +22,3 @@ export declare class InertialMouse {

private mouseup;
private rafId?;
private setNextTick();
private tick();
protected tick(): void;
private coord(e);

@@ -26,0 +25,0 @@ }

27

lib/inertial_mouse.js

@@ -21,3 +21,3 @@ "use strict";

_this.physics.hook(_this.coord(e));
_this.setNextTick();
_this.cb.setNextTick(function () { return _this.tick(); });
};

@@ -30,2 +30,4 @@ this.mouseup = function (e) {

};
if (cb.setNextTick == undefined)
cb.setNextTick = defaultSetNextTick();
target.addEventListener('mousedown', this.mousedown);

@@ -40,12 +42,4 @@ }

};
InertialMouse.prototype.setNextTick = function () {
InertialMouse.prototype.tick = function () {
var _this = this;
if (this.rafId == undefined) {
this.rafId = requestAnimationFrame(function () {
_this.rafId = undefined;
_this.tick();
});
}
};
InertialMouse.prototype.tick = function () {
var _a = this.physics.tick(performance.now()), r = _a.r, dr = _a.dr, movestart = _a.movestart, moveend = _a.moveend;

@@ -55,3 +49,3 @@ movestart && this.cb.movestart && this.cb.movestart(new MoveStartEvent());

moveend && this.cb.moveend && this.cb.moveend(new MoveEndEvent());
moveend || this.setNextTick();
moveend || this.cb.setNextTick(function () { return _this.tick(); });
};

@@ -65,2 +59,13 @@ InertialMouse.prototype.coord = function (e) {

exports.InertialMouse = InertialMouse;
function defaultSetNextTick() {
var rafId;
return function (tick) {
if (rafId == undefined) {
rafId = requestAnimationFrame(function () {
rafId = undefined;
tick();
});
}
};
}
var DownEvent = (function () {

@@ -67,0 +72,0 @@ function DownEvent(r, originalEvent) {

{
"name": "@hscmap/inertial-mouse",
"version": "3.0.1",
"version": "3.1.0",
"main": "./lib/index.js",

@@ -5,0 +5,0 @@ "types": "./lib/index.d.ts",

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