feat: mutate canonical drafts from workbench
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useOutletContext } from "react-router-dom";
|
||||
import type { ConnectionState, EvidenceRecord } from "../app/state.js";
|
||||
import { initialState, type ConnectionState, type EvidenceRecord } from "../app/state.js";
|
||||
import type { ConsoleReadExecutor } from "./domain/read-executor.js";
|
||||
import type { ConsoleWriteExecutor } from "./domain/write-executor.js";
|
||||
|
||||
@@ -11,5 +11,13 @@ export type ConsoleWorkspaceContextValue = {
|
||||
readonly writeExecutor: ConsoleWriteExecutor | null;
|
||||
};
|
||||
|
||||
const STANDALONE_CONTEXT: ConsoleWorkspaceContextValue = {
|
||||
connection: initialState(),
|
||||
connectedTarget: null,
|
||||
recordEvidence: () => undefined,
|
||||
readExecutor: null,
|
||||
writeExecutor: null,
|
||||
};
|
||||
|
||||
export const useConsoleWorkspace = (): ConsoleWorkspaceContextValue =>
|
||||
useOutletContext<ConsoleWorkspaceContextValue>();
|
||||
useOutletContext<ConsoleWorkspaceContextValue>() ?? STANDALONE_CONTEXT;
|
||||
|
||||
Reference in New Issue
Block a user