Socket
Socket
Sign inDemoInstall

use-animation-frame

Package Overview
Dependencies
3
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.4 to 0.1.5

2

index.min.js

@@ -1,1 +0,1 @@

!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react")):"function"==typeof define&&define.amd?define("use-animation-frame",["React"],r):"object"==typeof exports?exports["use-animation-frame"]=r(require("react")):e["use-animation-frame"]=r(e.React)}(this,(e=>(()=>{"use strict";var r={639:r=>{r.exports=e}},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var u=t[e]={exports:{}};return r[e](u,u.exports,n),u.exports}n.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return n.d(r,{a:r}),r},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{default:()=>r});var e=n(639);const r=function(r){if("undefined"!=typeof performance&&"undefined"!=typeof window){var t=(0,e.useRef)(),n=(0,e.useRef)(),o=(0,e.useRef)(performance.now()),u=(0,e.useRef)(performance.now());t.current=r;var a=function e(r){t.current({time:(r-o.current)/1e3,delta:(r-u.current)/1e3}),u.current=r,n.current=requestAnimationFrame(e)};(0,e.useLayoutEffect)((function(){return n.current=requestAnimationFrame(a),function(){return n.current&&cancelAnimationFrame(n.current)}}),[])}}})(),o})()));
import{useRef as e,useLayoutEffect as r}from"react";export default n=>{if("undefined"==typeof performance||"undefined"==typeof window)return;const t=e(),c=e(),o=e(performance.now()),u=e(performance.now());t.current=n;const a=e=>{t.current({time:(e-o.current)/1e3,delta:(e-u.current)/1e3}),u.current=e,c.current=requestAnimationFrame(a)};r(()=>(c.current=requestAnimationFrame(a),()=>c.current&&cancelAnimationFrame(c.current)),[])};
{
"name": "use-animation-frame",
"version": "0.1.4",
"version": "0.1.5",
"description": "A React hook to run requestAnimationFrame seamlessly",
"homepage": "https://github.com/franciscop/use-animation-frame#readme",
"repository": "https://github.com/franciscop/use-animation-frame.git",
"funding": {
"url": "https://www.paypal.me/franciscopresencia/19"
},
"bugs": "https://github.com/franciscop/use-animation-frame/issues",
"funding": "https://www.paypal.me/franciscopresencia/19",
"author": "Francisco Presencia <public@francisco.io> (https://francisco.io/)",
"license": "MIT",
"scripts": {
"build": "webpack -c",
"test": "npx jest --coverage",
"start": "npx jest --watch"
"build": "rollup -c",
"size": "echo $(gzip -c index.min.js | wc -c) bytes",
"start": "jest --watch",
"test": "jest --coverage"
},
"keywords": [],
"keywords": [
"react",
"use-animation-frame",
"hooks",
"animation",
"interval"
],
"main": "index.min.js",
"peerDependencies": {
"react": ">=16.8.0"
},
"type": "module",
"files": [],
"devDependencies": {
"@babel/core": "^7.1.5",
"@babel/core": "^7.15.0",
"@babel/preset-env": "^7.15.0",
"@babel/preset-react": "^7.14.5",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.4",
"babel-loader": "^8.2.2",
"babel-polyfill": "^6.26.0",
"jest": "^27.5.1",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
"react-test": "^0.13.1",
"regenerator-runtime": "^0.12.1",
"uglify-es": "^3.1.3",
"webpack": "^5.72.0",
"webpack-cli": "^3.1.2"
"jest": "^28.1.0",
"jest-environment-jsdom": "^28.1.0",
"react": "^18.2.0",
"react-test": "^0.19.0",
"rollup": "^1.32.1",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-terser": "^5.2.0"
},
"peerDependencies": {
"react": ">=16.8.0"
},
"babel": {

@@ -44,3 +49,6 @@ "presets": [

]
},
"jest": {
"testEnvironment": "jsdom"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc