Socket
Socket
Sign inDemoInstall

use-animation-frame

Package Overview
Dependencies
8
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

4

index.js

@@ -7,2 +7,6 @@ // Based off a tweet and codesandbox:

export default (cb, deps) => {
if( typeof performance === 'undefined' || typeof window === 'undefined' ) {
return
}
const frame = useRef();

@@ -9,0 +13,0 @@ const last = useRef(performance.now());

2

index.min.js

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("use-animation-frame",["React"],t):"object"==typeof exports?exports["use-animation-frame"]=t(require("react")):e["use-animation-frame"]=t(e.React)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=r(0);t.default=(e,t)=>{const r=Object(n.useRef)(),o=Object(n.useRef)(performance.now()),u=Object(n.useRef)(performance.now()),c=()=>{const t=performance.now(),n=(t-u.current)/1e3,i=(t-o.current)/1e3;e({time:n,delta:i}),o.current=t,r.current=requestAnimationFrame(c)};Object(n.useEffect)(()=>(r.current=requestAnimationFrame(c),()=>cancelAnimationFrame(r.current)),t)}}])}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("use-animation-frame",["React"],t):"object"==typeof exports?exports["use-animation-frame"]=t(require("react")):e["use-animation-frame"]=t(e.React)}(this,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=r(0);t.default=(e,t)=>{if("undefined"==typeof performance||"undefined"==typeof window)return;const r=Object(n.useRef)(),o=Object(n.useRef)(performance.now()),u=Object(n.useRef)(performance.now()),f=()=>{const t=performance.now(),n=(t-u.current)/1e3,i=(t-o.current)/1e3;e({time:n,delta:i}),o.current=t,r.current=requestAnimationFrame(f)};Object(n.useEffect)(()=>(r.current=requestAnimationFrame(f),()=>cancelAnimationFrame(r.current)),t)}}])}));
{
"name": "use-animation-frame",
"version": "0.1.0",
"version": "0.1.1",
"description": "A React hook to run requestAnimationFrame seamlessly",
"main": "index.min.js",
"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"
},
"author": "Francisco Presencia <public@francisco.io> (https://francisco.io/)",
"license": "MIT",
"scripts": {
"build": "webpack -c"
},
"repository": {
"type": "git",
"url": "git+https://github.com/franciscop/use-animation-frame.git"
},
"keywords": [],
"author": "Francisco Presencia <public@francisco.io> (https://francisco.io/)",
"license": "MIT",
"homepage": "https://github.com/franciscop/use-animation-frame#readme",
"main": "index.min.js",
"dependencies": {},

@@ -18,0 +18,0 @@ "peerDependencies": {

@@ -13,3 +13,4 @@ const path = require("path");

libraryTarget: "umd",
umdNamedDefine: true
umdNamedDefine: true,
globalObject: 'this'
},

@@ -16,0 +17,0 @@ module: {

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