hoxa
Version:
A comprehensive collection of 100+ production-ready React hooks for state management, UI effects, forms, animations, and more. Carefully curated and optimized for performance and developer experience.
14 lines (13 loc) • 437 B
TypeScript
export declare function useArray<T>(initialValue?: T[]): {
value: T[];
length: number;
push: (item: T) => void;
pop: () => void;
shift: () => void;
unshift: (item: T) => void;
update: (index: number, item: T) => void;
remove: (index: number) => void;
filter: (predicate: (value: T) => boolean) => void;
clear: () => void;
set: import("react").Dispatch<import("react").SetStateAction<T[]>>;
};