MCPcopy
hub / github.com/kitze/react-hanger / useArray

Function useArray

src/useArray.ts:7–16  ·  view source on GitHub ↗
(initial: T[])

Source from the content-addressed store, hash-verified

5export type UseArray<T> = UseStateful<T[]> & UseArrayActions<T>;
6
7export function useArray<T = any>(initial: T[]): UseArray<T> {
8 const [value, actions] = useArrayArray(initial);
9 return useMemo(
10 () => ({
11 value,
12 ...actions,
13 }),
14 [actions, value],
15 );
16}
17
18export default useArray;

Callers 1

index.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected