@openfin/ui-library 0.1.12 → 0.1.13-alpha.1621206567
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function usePrevious<T>(value: T): T | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePrevious = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function usePrevious(value) {
|
|
6
|
+
const ref = react_1.useRef();
|
|
7
|
+
react_1.useEffect(() => {
|
|
8
|
+
ref.current = value;
|
|
9
|
+
}, [value]);
|
|
10
|
+
return ref.current;
|
|
11
|
+
}
|
|
12
|
+
exports.usePrevious = usePrevious;
|
package/package.json
CHANGED