Skip to content

Feature/show command running #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Nov 18, 2019
Prev Previous commit
Next Next commit
fix typo bug
  • Loading branch information
ShMcK committed Nov 18, 2019
commit 7f8789caa1004e256e8d6dd026b985c7b32add82
12 changes: 7 additions & 5 deletions web-app/src/services/channel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ interface ReceivedEvent {
}

class Channel {
editorSend: (action: Action) => void
machineSend: (action: Action | string) => void
constructor() {
// setup mock if browser only
// @ts-ignore
Expand All @@ -21,9 +19,13 @@ class Channel {
const editor = acquireVsCodeApi()

this.editorSend = editor.postMessage
this.machineSend = () => {
/* machineSend is set asynchronously in the router. see "setMachineSend" */
}
}

public machineSend = (action: Action | string) => {
/* implemented by `setMachineSend` in router on startup */
}
public editorSend = (action: Action) => {
/* */
}

public setMachineSend = (send: any) => {
Expand Down
3 changes: 2 additions & 1 deletion web-app/src/services/state/machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const machine = Machine<CR.MachineContext, CR.MachineStateSchema, CR.Mach
id: 'tutorial',
initial: 'Initialize',
on: {
// track commands
COMMAND_START: {
actions: ['commandStart'],
},
Expand All @@ -94,7 +95,7 @@ export const machine = Machine<CR.MachineContext, CR.MachineStateSchema, CR.Mach
states: {
// TODO: move Initialize into New Tutorial setup
Initialize: {
onEntry: ['initializeTutsorial'],
onEntry: ['initializeTutorial'],
on: {
TUTORIAL_CONFIGURED: 'Summary',
// TUTORIAL_CONFIG_ERROR: 'Start' // TODO: should handle error
Expand Down