Skip to content

Commit

Permalink
fix(core): createCan command props shouldn't try dispatch (ueberdosis…
Browse files Browse the repository at this point in the history
  • Loading branch information
kivikakk committed Jul 26, 2022
1 parent e2f8747 commit fea5103
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/CommandManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ export class CommandManager {

public createCan(startTr?: Transaction): CanCommands {
const { rawCommands, state } = this
const dispatch = undefined
const dispatch = false
const tr = startTr || state.tr
const props = this.buildProps(tr, dispatch)
const formattedCommands = Object.fromEntries(Object
.entries(rawCommands)
.map(([name, command]) => {
return [name, (...args: never[]) => command(...args)({ ...props, dispatch })]
return [name, (...args: never[]) => command(...args)({ ...props, dispatch: undefined })]
})) as unknown as SingleCommands

return {
Expand Down

0 comments on commit fea5103

Please sign in to comment.