Comparing version 2.10.12 to 2.10.14
@@ -8,3 +8,3 @@ export interface IFuncUpdater<T> { | ||
export declare type StorageStateResult<T> = [T | undefined, (value?: T | IFuncUpdater<T>) => void]; | ||
export declare type StorageStateResultHasDefaultValue<T> = [T, (value: T | IFuncUpdater<T>) => void]; | ||
export declare type StorageStateResultHasDefaultValue<T> = [T, (value?: T | IFuncUpdater<T>) => void]; | ||
export declare function createUseStorageState(nullishStorage: Storage | null): { | ||
@@ -11,0 +11,0 @@ <T = undefined>(key: string): StorageStateResult<T>; |
@@ -1,6 +0,6 @@ | ||
export interface OptionType { | ||
itemHeight: number | ((index: number) => number); | ||
export interface OptionType<T> { | ||
itemHeight: number | ((index: number, data?: T) => number); | ||
overscan?: number; | ||
} | ||
declare const _default: <T = any>(list: T[], options: OptionType) => { | ||
declare const _default: <T = any>(list: T[], options: OptionType<T>) => { | ||
list: { | ||
@@ -7,0 +7,0 @@ data: T; |
@@ -61,3 +61,3 @@ var __read = this && this.__read || function (o, n) { | ||
for (var i = start; i < list.length; i++) { | ||
var height = itemHeight(i); | ||
var height = itemHeight(i, list[i]); | ||
sum += height; | ||
@@ -83,3 +83,3 @@ | ||
for (var i = 0; i < list.length; i++) { | ||
var height = itemHeight(i); | ||
var height = itemHeight(i, list[i]); | ||
sum += height; | ||
@@ -120,3 +120,3 @@ | ||
return list.reduce(function (sum, _, index) { | ||
return sum + itemHeight(index); | ||
return sum + itemHeight(index, list[index]); | ||
}, 0); | ||
@@ -139,3 +139,3 @@ }, [list.length]); | ||
var height = list.slice(0, index).reduce(function (sum, _, i) { | ||
return sum + itemHeight(i); | ||
return sum + itemHeight(i, list[i]); | ||
}, 0); // if (enableCache) { | ||
@@ -142,0 +142,0 @@ // distanceCache.current[index] = height; |
@@ -8,3 +8,3 @@ export interface IFuncUpdater<T> { | ||
export declare type StorageStateResult<T> = [T | undefined, (value?: T | IFuncUpdater<T>) => void]; | ||
export declare type StorageStateResultHasDefaultValue<T> = [T, (value: T | IFuncUpdater<T>) => void]; | ||
export declare type StorageStateResultHasDefaultValue<T> = [T, (value?: T | IFuncUpdater<T>) => void]; | ||
export declare function createUseStorageState(nullishStorage: Storage | null): { | ||
@@ -11,0 +11,0 @@ <T = undefined>(key: string): StorageStateResult<T>; |
@@ -1,6 +0,6 @@ | ||
export interface OptionType { | ||
itemHeight: number | ((index: number) => number); | ||
export interface OptionType<T> { | ||
itemHeight: number | ((index: number, data?: T) => number); | ||
overscan?: number; | ||
} | ||
declare const _default: <T = any>(list: T[], options: OptionType) => { | ||
declare const _default: <T = any>(list: T[], options: OptionType<T>) => { | ||
list: { | ||
@@ -7,0 +7,0 @@ data: T; |
@@ -75,3 +75,3 @@ "use strict"; | ||
for (var i = start; i < list.length; i++) { | ||
var height = itemHeight(i); | ||
var height = itemHeight(i, list[i]); | ||
sum += height; | ||
@@ -97,3 +97,3 @@ | ||
for (var i = 0; i < list.length; i++) { | ||
var height = itemHeight(i); | ||
var height = itemHeight(i, list[i]); | ||
sum += height; | ||
@@ -134,3 +134,3 @@ | ||
return list.reduce(function (sum, _, index) { | ||
return sum + itemHeight(index); | ||
return sum + itemHeight(index, list[index]); | ||
}, 0); | ||
@@ -153,3 +153,3 @@ }, [list.length]); | ||
var height = list.slice(0, index).reduce(function (sum, _, i) { | ||
return sum + itemHeight(i); | ||
return sum + itemHeight(i, list[i]); | ||
}, 0); // if (enableCache) { | ||
@@ -156,0 +156,0 @@ // distanceCache.current[index] = height; |
{ | ||
"name": "ahooks", | ||
"version": "2.10.12", | ||
"version": "2.10.14", | ||
"description": "react hooks library", | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@ahooksjs/use-request": "^2.8.13", | ||
"@ahooksjs/use-request": "^2.8.14", | ||
"@types/js-cookie": "^2.2.6", | ||
@@ -64,3 +64,3 @@ "dayjs": "^1.9.1", | ||
"license": "MIT", | ||
"gitHead": "9285107e858e38d6042c76b7a9780ac5040cf657" | ||
"gitHead": "43088d001013c2c078b9f84fffb6f482cacec8c7" | ||
} |
@@ -9,2 +9,4 @@ English | [简体中文](https://github.com/alibaba/hooks/blob/master/README.zh-CN.md) | ||
> :warning: ahooks 3.0 is comming! welcome to try it <a href="https://ahooks-next.surge.sh/" target="_blank">https://ahooks-next.surge.sh/</a> | ||
## 📚 Documentation | ||
@@ -90,3 +92,3 @@ | ||
<img src="https://raw.githubusercontent.com/alibaba/hooks/master/dingtalk.jpg" width="300" /> | ||
<img src="https://user-images.githubusercontent.com/12526493/141303172-68f25577-c7b7-4ff7-bdff-25fd0f4d5214.JPG" width="300" /> | ||
@@ -93,0 +95,0 @@ ## ✅ License |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
424555
101