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

use-spring-transition

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-spring-transition - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

15

lib/useSpringTransitions.js

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

const useSpringTransitions = (value, options = {}, values = { from: 0, to: 1 }) => {
const transitionIdRef = (0, react_1.useRef)(null);
const transitionIdRef = (0, react_1.useRef)(-1);
const [inst, setState] = (0, react_1.useState)({

@@ -63,5 +63,2 @@ transitions: [

const transitionId = transitionIdRef.current;
if (!transitionId) {
return;
}
const isOpenClosePending = !timeoutMapRef.current[transitionId] &&

@@ -98,7 +95,7 @@ transitions.some((transition) => ['open', 'close'].includes(transition.stage) && transition._transitionId === transitionId);

}
const springValuesByValueMap = transitions.reduce((res, transition) => {
res.set(transition.value, transition.springValue);
return res;
}, new Map());
const openClose = ({ open, close }, openCloseOptions) => {
const springValuesByValueMap = transitions.reduce((res, transition) => {
res.set(transition.value, transition.springValue);
return res;
}, new Map());
const cleanup = (0, spring_1.spring)({

@@ -194,3 +191,3 @@ options: openCloseOptions,

(0, react_1.useEffect)(() => () => {
transitionIdRef.current = null;
transitionIdRef.current = -1;
Object.keys(timeoutMapRef.current).forEach((key) => {

@@ -197,0 +194,0 @@ clearTimeout(timeoutMapRef.current[key]);

2

package.json
{
"name": "use-spring-transition",
"sideEffects": false,
"version": "0.1.3",
"version": "0.1.4",
"description": "Hooks for spring transition",

@@ -6,0 +6,0 @@ "keywords": [

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