refactor(general): cleanup

This commit is contained in:
moklick
2021-12-09 09:17:36 +01:00
parent 38308781ee
commit 81585dbff5
17 changed files with 70 additions and 137 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ type ApplyChanges<ItemType, ChangesType> = (changes: ChangesType[], items: ItemT
type OnChange<ChangesType> = (changes: ChangesType[]) => void;
// returns a hook that can be used liked this:
// const [nodes, setNodes, onNodesChange] = useNodesState(intialNodes);
// const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
function createUseItemsState<ItemType, ChangesType>(
applyChangesFunction: ApplyChanges<ItemType, ChangesType>
): (initialItems: ItemType[]) => [ItemType[], Dispatch<SetStateAction<ItemType[]>>, OnChange<ChangesType>] {