mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-01 18:22:41 -08:00
refactor: extract main runtime lifecycle helper builders
This commit is contained in:
21
src/main/runtime/ipc-bridge-actions.ts
Normal file
21
src/main/runtime/ipc-bridge-actions.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { MpvCommandFromIpcRuntimeDeps } from '../ipc-mpv-command';
|
||||
|
||||
export function createHandleMpvCommandFromIpcHandler(deps: {
|
||||
handleMpvCommandFromIpcRuntime: (
|
||||
command: (string | number)[],
|
||||
options: MpvCommandFromIpcRuntimeDeps,
|
||||
) => void;
|
||||
buildMpvCommandDeps: () => MpvCommandFromIpcRuntimeDeps;
|
||||
}) {
|
||||
return (command: (string | number)[]): void => {
|
||||
deps.handleMpvCommandFromIpcRuntime(command, deps.buildMpvCommandDeps());
|
||||
};
|
||||
}
|
||||
|
||||
export function createRunSubsyncManualFromIpcHandler<TRequest, TResult>(deps: {
|
||||
runManualFromIpc: (request: TRequest) => Promise<TResult>;
|
||||
}) {
|
||||
return async (request: TRequest): Promise<TResult> => {
|
||||
return deps.runManualFromIpc(request);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user