@tamagui/use-previous
Advanced tools
@@ -1,30 +0,9 @@ | ||
| "use strict"; | ||
| var __defProp = Object.defineProperty; | ||
| var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
| var __getOwnPropNames = Object.getOwnPropertyNames; | ||
| var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
| var __export = (target, all) => { | ||
| for (var name in all) | ||
| __defProp(target, name, { get: all[name], enumerable: !0 }); | ||
| }, __copyProps = (to, from, except, desc) => { | ||
| if (from && typeof from == "object" || typeof from == "function") | ||
| for (let key of __getOwnPropNames(from)) | ||
| !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
| return to; | ||
| }; | ||
| var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); | ||
| var src_exports = {}; | ||
| __export(src_exports, { | ||
| usePrevious: () => usePrevious | ||
| }); | ||
| module.exports = __toCommonJS(src_exports); | ||
| var import_react = require("react"); | ||
| import { useMemo, useRef } from "react"; | ||
| function usePrevious(value) { | ||
| const ref = (0, import_react.useRef)({ value, previous: value }); | ||
| return (0, import_react.useMemo)(() => (ref.current.value !== value && (ref.current.previous = ref.current.value, ref.current.value = value), ref.current.previous), [value]); | ||
| const ref = useRef({ value, previous: value }); | ||
| return useMemo(() => (ref.current.value !== value && (ref.current.previous = ref.current.value, ref.current.value = value), ref.current.previous), [value]); | ||
| } | ||
| // Annotate the CommonJS export names for ESM import in node: | ||
| 0 && (module.exports = { | ||
| export { | ||
| usePrevious | ||
| }); | ||
| }; | ||
| //# sourceMappingURL=index.js.map |
| { | ||
| "version": 3, | ||
| "sources": ["../../src/index.ts"], | ||
| "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAgC;AAEzB,SAAS,YAAe,OAAU;AACvC,QAAM,UAAM,qBAAO,EAAE,OAAO,UAAU,MAAM,CAAC;AAK7C,aAAO,sBAAQ,OACT,IAAI,QAAQ,UAAU,UACxB,IAAI,QAAQ,WAAW,IAAI,QAAQ,OACnC,IAAI,QAAQ,QAAQ,QAEf,IAAI,QAAQ,WAClB,CAAC,KAAK,CAAC;AACZ;", | ||
| "mappings": "AAEA,SAAS,SAAS,cAAc;AAEzB,SAAS,YAAe,OAAU;AACvC,QAAM,MAAM,OAAO,EAAE,OAAO,UAAU,MAAM,CAAC;AAK7C,SAAO,QAAQ,OACT,IAAI,QAAQ,UAAU,UACxB,IAAI,QAAQ,WAAW,IAAI,QAAQ,OACnC,IAAI,QAAQ,QAAQ,QAEf,IAAI,QAAQ,WAClB,CAAC,KAAK,CAAC;AACZ;", | ||
| "names": [] | ||
| } |
+2
-2
| { | ||
| "name": "@tamagui/use-previous", | ||
| "version": "1.89.0-1706483140977", | ||
| "version": "1.89.0", | ||
| "types": "./types/index.d.ts", | ||
@@ -21,3 +21,3 @@ "main": "dist/cjs", | ||
| "devDependencies": { | ||
| "@tamagui/build": "1.89.0-1706483140977" | ||
| "@tamagui/build": "1.89.0" | ||
| }, | ||
@@ -24,0 +24,0 @@ "exports": { |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
-50%7585
-12.39%97
-17.8%