Skip to content

Commit

Permalink
Add GlobalPluginPreset
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Jun 6, 2016
1 parent f49a3e6 commit fef1c8f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ import {ActionSettings} from "./ActionSettings";
import {ActionResponse} from "./ActionResponse";
import assign = require("object-assign");

interface GlobalPluginPreset {
plugin: Function;
options: any;
}



export default class Action {

actionName: string;
Expand Down Expand Up @@ -91,7 +98,8 @@ export default class Action {

// Register globalPlugins to this action.
Action._globalPlugins.forEach((p,i) => {
var plugin = new plugin(this, p.options);
var cls = p.plugin;
var plugin = new cls(this, p.options || {});
this.plug(plugin);
});
}
Expand Down

0 comments on commit fef1c8f

Please sign in to comment.