mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-29 19:21:33 -07:00
Sync Stats & History window, headless --sync-cli, and Windows remote support (#160)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import {
|
||||
readSyncHostsState,
|
||||
writeSyncHostsState,
|
||||
type SyncHostsState,
|
||||
} from '../../shared/sync/sync-hosts-store';
|
||||
|
||||
interface SyncUiHostsStateDeps {
|
||||
hostsFilePath: string;
|
||||
broadcastStateChanged: () => void;
|
||||
}
|
||||
|
||||
export function createSyncUiHostsState(deps: SyncUiHostsStateDeps) {
|
||||
function readState(): SyncHostsState {
|
||||
return readSyncHostsState(deps.hostsFilePath);
|
||||
}
|
||||
|
||||
function writeState(state: SyncHostsState): void {
|
||||
writeSyncHostsState(deps.hostsFilePath, state);
|
||||
deps.broadcastStateChanged();
|
||||
}
|
||||
|
||||
return { readState, writeState };
|
||||
}
|
||||
Reference in New Issue
Block a user