Prefer arrow functions (#2344)
This commit is contained in:
@ -23,11 +23,11 @@ const enableActionGroup = (
|
||||
appState: AppState,
|
||||
) => getSelectedElements(getNonDeletedElements(elements), appState).length > 1;
|
||||
|
||||
function alignSelectedElements(
|
||||
const alignSelectedElements = (
|
||||
elements: readonly ExcalidrawElement[],
|
||||
appState: Readonly<AppState>,
|
||||
alignment: Alignment,
|
||||
) {
|
||||
) => {
|
||||
const selectedElements = getSelectedElements(
|
||||
getNonDeletedElements(elements),
|
||||
appState,
|
||||
@ -38,7 +38,7 @@ function alignSelectedElements(
|
||||
const updatedElementsMap = getElementMap(updatedElements);
|
||||
|
||||
return elements.map((element) => updatedElementsMap[element.id] || element);
|
||||
}
|
||||
};
|
||||
|
||||
export const actionAlignTop = register({
|
||||
name: "alignTop",
|
||||
|
@ -31,10 +31,10 @@ const deleteSelectedElements = (
|
||||
};
|
||||
};
|
||||
|
||||
function handleGroupEditingState(
|
||||
const handleGroupEditingState = (
|
||||
appState: AppState,
|
||||
elements: readonly ExcalidrawElement[],
|
||||
): AppState {
|
||||
): AppState => {
|
||||
if (appState.editingGroupId) {
|
||||
const siblingElements = getElementsInGroup(
|
||||
getNonDeletedElements(elements),
|
||||
@ -48,7 +48,7 @@ function handleGroupEditingState(
|
||||
}
|
||||
}
|
||||
return appState;
|
||||
}
|
||||
};
|
||||
|
||||
export const actionDeleteSelected = register({
|
||||
name: "deleteSelectedElements",
|
||||
|
Reference in New Issue
Block a user