Skip to content

Commit

Permalink
fix: use correct list variable in useList (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich authored Jun 25, 2019
2 parents 733f532 + 7ff5475 commit b937296
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/useList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const useList = <T>(initialList: T[] = []): [T[], Actions<T>] => {
{
set,
clear: () => set([]),
updateAt: (index, entry) => set(currentList => [...currentList.slice(0, index), entry, ...list.slice(index + 1)]),
remove: index => set(currentList => [...currentList.slice(0, index), ...list.slice(index + 1)]),
updateAt: (index, entry) => set(currentList => [...currentList.slice(0, index), entry, ...currentList.slice(index + 1)]),
remove: index => set(currentList => [...currentList.slice(0, index), ...currentList.slice(index + 1)]),
push: entry => set(currentList => [...currentList, entry]),
filter: fn => set(currentList => currentList.filter(fn)),
sort: (fn?) => set(currentList => [...currentList].sort(fn)),
Expand Down

0 comments on commit b937296

Please sign in to comment.