mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
11 lines
366 B
TypeScript
11 lines
366 B
TypeScript
export interface Actions<T> {
|
|
set: (list: T[]) => void;
|
|
updateAt: (index: number, item: T) => void;
|
|
remove: (index: number) => void;
|
|
push: (item: T) => void;
|
|
filter: (fn: (value: T) => boolean) => void;
|
|
sort: (fn?: (a: T, b: T) => number) => void;
|
|
}
|
|
declare const useList: <T>(initialList?: T[]) => [T[], Actions<T>];
|
|
export default useList;
|