move composeNum into getNumKeyBindings

This commit is contained in:
Peter Fajdiga
2024-09-06 11:25:06 +02:00
parent b6a5080d5d
commit e3979d94f7

View File

@@ -185,6 +185,15 @@ function getKeyBindings(world: World, actions: Actions): KeyBinding[] {
}
function getNumKeyBindings(world: World, actions: Actions): NumKeyBinding[] {
function composeNum<T extends any[]>(
f1: (f: (...args: T) => void) => void,
f2: (i: number, ...args: T) => void
) {
return (i: number) => {
f1((...args: T) => f2(i, ...args));
};
}
return [
{
name: "focus-",
@@ -226,12 +235,3 @@ function getNumKeyBindings(world: World, actions: Actions): NumKeyBinding[] {
},
];
}
function composeNum<T extends any[]>(
f1: (f: (...args: T) => void) => void,
f2: (i: number, ...args: T) => void
) {
return (i: number) => {
f1((...args: T) => f2(i, ...args));
};
}