mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
fix: lint fixes via lint:fix
This commit is contained in:
parent
3554f79449
commit
7ce8e4f962
@ -18,7 +18,8 @@ const useList = <T>(initialList: T[] = []): [T[], Actions<T>] => {
|
||||
{
|
||||
set,
|
||||
clear: () => set([]),
|
||||
updateAt: (index, entry) => set(currentList => [...currentList.slice(0, index), entry, ...currentList.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)),
|
||||
|
||||
@ -15,7 +15,7 @@ const useMap = <T extends object = any>(initialMap: T = {} as T): [T, Actions<T>
|
||||
{
|
||||
get: (key: keyof T) => map[key as string],
|
||||
set: <K extends keyof T>(key: K, entry: T[K]) => {
|
||||
set((prevMap)=>({
|
||||
set(prevMap => ({
|
||||
...prevMap,
|
||||
[key]: entry,
|
||||
}));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user