diff --git a/src/useList.ts b/src/useList.ts index 46b4e0a4..6658a3c0 100644 --- a/src/useList.ts +++ b/src/useList.ts @@ -18,6 +18,10 @@ const useList = (initialList: T[] = []): [T[], Actions] => { entry, ...list.slice(index + 1) ]), + remove: (index) => set([ + ...list.slice(0, index), + ...list.slice(index + 1) + ]), push: (entry) => set([...list, entry]), filter: (fn) => set(list.filter(fn)), sort: (fn?) => set([...list].sort(fn)),