25 lines · 729 B · TypeScript
RawDownload
export interface LaunchStateSnapshot {  phase: "idle" | "launching";  recipeId: string | null;} export interface LaunchState {  getLaunchingRecipeId: () => string | null;  getState: () => LaunchStateSnapshot;  markLaunching: (recipeId: string) => void;  markIdle: () => void;} export const createLaunchState = (): LaunchState => {  let state: LaunchStateSnapshot = { phase: "idle", recipeId: null };  return {    getLaunchingRecipeId: (): string | null => state.recipeId,    getState: (): LaunchStateSnapshot => state,    markLaunching: (recipeId: string): void => {      state = { phase: "launching", recipeId };    },    markIdle: (): void => {      state = { phase: "idle", recipeId: null };    },  };};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t