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

use-state-with-callback

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-state-with-callback - npm Package Compare versions

Comparing version 2.0.5 to 3.0.0

2

lib/index.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports["use-state-with-callback"]=e(require("react")):t["use-state-with-callback"]=e(t.react)}(window,function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var u=e[n]={i:n,l:!1,exports:{}};return t[n].call(u.exports,u,u.exports,r),u.l=!0,u.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var u in t)r.d(n,u,function(e){return t[e]}.bind(null,u));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(e,r){e.exports=t},function(t,e,r){"use strict";r.r(e),r.d(e,"useStateWithCallbackInstant",function(){return o}),r.d(e,"useStateWithCallbackLazy",function(){return c});var n=r(0);function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,u=!1,o=void 0;try{for(var c,i=t[Symbol.iterator]();!(n=(c=i.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){u=!0,o=t}finally{try{n||null==i.return||i.return()}finally{if(u)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var o=function(t,e){var r=u(n.useState(t),2),o=r[0],c=r[1];return n.useLayoutEffect(function(){return e(o)},[o,e]),[o,c]},c=function(t){var e=n.useRef(null),r=u(n.useState(t),2),o=r[0],c=r[1];n.useEffect(function(){e.current&&(e.current(o),e.current=null)},[o]);return[o,function(t,r){return e.current=r,c(t)}]};e.default=function(t,e){var r=u(n.useState(t),2),o=r[0],c=r[1];return n.useEffect(function(){return e(o)},[o,e]),[o,c]}}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports["use-state-with-callback"]=e(require("react")):t["use-state-with-callback"]=e(t.react)}(window,function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var u=e[n]={i:n,l:!1,exports:{}};return t[n].call(u.exports,u,u.exports,r),u.l=!0,u.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var u in t)r.d(n,u,function(e){return t[e]}.bind(null,u));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(e,r){e.exports=t},function(t,e,r){"use strict";r.r(e),r.d(e,"useStateWithCallbackInstant",function(){return o}),r.d(e,"useStateWithCallbackLazy",function(){return c});var n=r(0);function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,u=!1,o=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(r.push(c.value),!e||r.length!==e);n=!0);}catch(t){u=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(u)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var o=function(t,e){var r=u(n.useState(t),2),o=r[0],c=r[1];return n.useLayoutEffect(function(){return e(o)},[e,o]),[o,c]},c=function(t){var e=n.useRef(null),r=u(n.useState(t),2),o=r[0],c=r[1];n.useEffect(function(){e.current&&(e.current(o),e.current=null)},[o]);var a=n.useCallback(function(t,r){return e.current=r,c(t)},[]);return[o,a]};e.default=function(t,e){var r=u(n.useState(t),2),o=r[0],c=r[1];return n.useEffect(function(){return e(o)},[e,o]),[o,c]}}])});
{
"name": "use-state-with-callback",
"version": "2.0.5",
"version": "3.0.0",
"description": "",

@@ -35,3 +35,3 @@ "main": "lib/index.js",

"eslint-plugin-react": "^7.14.2",
"eslint-plugin-react-hooks": "^1.6.1",
"eslint-plugin-react-hooks": "^4.4.0",
"prettier": "^1.18.2",

@@ -38,0 +38,0 @@ "react": "^16.8.6",

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