Skip to content

Feature/output channel #557

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 9 commits into from
Jan 3, 2022
Prev Previous commit
cleanup action logs
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
ShMcK committed Jan 2, 2022
commit 11365242c355d924239ad18b142878c8073cc1e6
2 changes: 1 addition & 1 deletion web-app/src/services/state/actions/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const updatePosition = assign({
})

export const loadNext = send((context: T.MachineContext): T.Action => {
const level = selectors.currentLevel(context)
const level: TT.Level = selectors.currentLevel(context)
return getNext(context.position, level, context.tutorial?.levels || [])
})

Expand Down
2 changes: 1 addition & 1 deletion web-app/src/services/state/machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export const createMachine = (options: any) => {
},
LevelComplete: {
onEntry: ['onLevelComplete'],
onExit: ['testClear', 'incrementLevel'],
onExit: ['testClear'],
on: {
NEXT_LEVEL: 'LoadNext',
KEY_PRESS_ENTER: 'LoadNext',
Expand Down
7 changes: 1 addition & 6 deletions web-app/src/services/state/useStateMachine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ const editorSend = (action: T.Action) =>
const useStateMachine = (): Output => {
const [state, send] = useMachine<T.MachineContext, any>(createMachine({ editorSend }))

const sendWithLog = (action: T.Action): void => {
logger(action)
send(action)
}

// event bus listener
React.useEffect(() => {
const listener = 'message'
Expand Down Expand Up @@ -57,7 +52,7 @@ const useStateMachine = (): Output => {
return {
context: state.context,
route,
send: sendWithLog,
send,
}
}

Expand Down