Skip to content

Commit

Permalink
fix #389
Browse files Browse the repository at this point in the history
  • Loading branch information
mStirner committed Dec 30, 2023
1 parent c810790 commit 28108d5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion components/endpoints/class.command.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,18 @@ module.exports = class Command {
* @param {Array} [params] Parameter array
* @param {Function} [cb] Callback
*/
trigger(params, cb = () => { }) {
trigger(params, cb) {

if (!cb && params instanceof Function) {
cb = params;
params = [];
}

if (!params && !cb) {
params = [];
cb = () => { };
}

let worker = this.#privates.get("handler");
let iface = interfaces.get(this.interface);

Expand Down
9 changes: 8 additions & 1 deletion components/scenes/makro-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ module.exports = {
"component": "endpoints",
"item": endpoint,
"method": "trigger",
"args": [command]
"args": [command, () => {

//console.log("Command executed adasdasdfasdfasdfasfdadsfasdf", err || success)
// how should this be catched?
// reject the makro execution if one command fails?
// or ignore it simple, and continue?

}]
});

resolve(_id);
Expand Down

0 comments on commit 28108d5

Please sign in to comment.