r-custom-hooks
Advanced tools
Comparing version 0.1.17 to 0.1.19
import { ReturnValue } from './types'; | ||
export declare const useHistoricalState: <T extends unknown>(defaultValue: T, { capacity }?: { | ||
capacity?: number | undefined; | ||
}) => ReturnValue<T>; | ||
export declare const useHistoricalState: <T extends unknown>(defaultValue: T, capacity?: number) => ReturnValue<T>; | ||
export default useHistoricalState; |
@@ -6,3 +6,3 @@ "use strict"; | ||
const react_1 = require("react"); | ||
const useHistoricalState = (defaultValue, { capacity = 10 } = {}) => { | ||
const useHistoricalState = (defaultValue, capacity = Number.POSITIVE_INFINITY) => { | ||
const [value, setValue] = (0, react_1.useState)(defaultValue); | ||
@@ -9,0 +9,0 @@ const historyRef = (0, react_1.useRef)([value]); |
{ | ||
"name": "r-custom-hooks", | ||
"version": "0.1.17", | ||
"version": "0.1.19", | ||
"description": "Predefined custom react hooks", | ||
@@ -5,0 +5,0 @@ "files": [ |
10235
172