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