@seagull/commands
Version:
Side Effect Functions implemented as Command Pattern for the Seagull Framework
28 lines • 844 B
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const mode_1 = require("@seagull/mode");
class Command {
constructor() {
this.mode = mode_1.Mode;
}
get executeHandler() {
const handlerLookup = {
cloud: this.executeCloud,
connected: this.executeConnected,
edge: this.executeEdge,
pure: this.executePure,
};
return handlerLookup[this.mode.environment].bind(this);
}
get revertHandler() {
const handlerLookup = {
cloud: this.revertCloud,
connected: this.revertConnected,
edge: this.revertEdge,
pure: this.revertPure,
};
return handlerLookup[this.mode.environment].bind(this);
}
}
exports.Command = Command;
//# sourceMappingURL=Command.js.map