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

@clayui/shared

Package Overview
Dependencies
Maintainers
13
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clayui/shared - npm Package Compare versions

Comparing version 3.101.0 to 3.103.1

lib/throttle.d.ts

1

lib/index.d.ts

@@ -30,4 +30,5 @@ /**

export { isMac, isIPhone, isIPad, isIOS, isAppleDevice } from './platform';
export { throttle } from './throttle';
export type { AlignPoints } from './useOverlayPositon';
export type { IBaseProps as IPortalBaseProps } from './Portal';
export type { InternalDispatch } from './useControlledState';

@@ -127,2 +127,8 @@ "use strict";

});
Object.defineProperty(exports, "throttle", {
enumerable: true,
get: function get() {
return _throttle.throttle;
}
});
Object.defineProperty(exports, "useControlledState", {

@@ -249,2 +255,4 @@ enumerable: true,

var _throttle = require("./throttle");
/**

@@ -251,0 +259,0 @@ * SPDX-FileCopyrightText: © 2019 Liferay, Inc. <https://liferay.com>

18

lib/useMousePosition.js

@@ -10,2 +10,4 @@ "use strict";

var _throttle = require("./throttle");
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

@@ -23,19 +25,5 @@

function throttle(callback, limit) {
var waiting = false;
return function () {
if (!waiting) {
callback.apply(void 0, arguments);
waiting = true;
setTimeout(function () {
waiting = false;
}, limit);
}
};
}
/**
* Hook to get the current mouse position
*/
var useMousePosition = function useMousePosition() {

@@ -50,3 +38,3 @@ var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 200;

(0, _react.useEffect)(function () {
var handleMousePosition = throttle(function (event) {
var handleMousePosition = (0, _throttle.throttle)(function (event) {
return setMousePosition([event.clientX, event.clientY]);

@@ -53,0 +41,0 @@ }, delay);

{
"name": "@clayui/shared",
"version": "3.101.0",
"version": "3.103.1",
"description": "ClayShared component",

@@ -45,3 +45,3 @@ "license": "BSD-3-Clause",

],
"gitHead": "55f8b720047b2aa4764d5de1302f715db62ed902"
"gitHead": "cd95e9b9561858fb6832a524a2a0b0304a500d3f"
}

@@ -8,19 +8,6 @@ /**

import {throttle} from './throttle';
type MousePosition = [number, number];
function throttle<T>(callback: Function, limit: number) {
var waiting = false;
return (...args: Array<T>) => {
if (!waiting) {
callback(...args);
waiting = true;
setTimeout(() => {
waiting = false;
}, limit);
}
};
}
/**

@@ -27,0 +14,0 @@ * Hook to get the current mouse position

Sorry, the diff of this file is not supported yet

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