refactoring
This commit is contained in:
@@ -113,12 +113,12 @@ export default class CommandManager {
|
|||||||
.entries(commands)
|
.entries(commands)
|
||||||
.map(([name, command]) => {
|
.map(([name, command]) => {
|
||||||
return [name, (...args: any[]) => command(...args)({ ...props, dispatch })]
|
return [name, (...args: any[]) => command(...args)({ ...props, dispatch })]
|
||||||
}))
|
})) as SingleCommands
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...formattedCommands,
|
...formattedCommands,
|
||||||
chain: () => this.createChain(tr, dispatch),
|
chain: () => this.createChain(tr, dispatch),
|
||||||
} as SingleCommands & { chain: () => ChainedCommands }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public buildProps(tr: Transaction, shouldDispatch = true) {
|
public buildProps(tr: Transaction, shouldDispatch = true) {
|
||||||
|
|||||||
Reference in New Issue
Block a user