Skip to content

Instantly share code, notes, and snippets.

@meixg
Created January 15, 2016 13:59
Show Gist options
  • Select an option

  • Save meixg/553a453f3b5cdab52072 to your computer and use it in GitHub Desktop.

Select an option

Save meixg/553a453f3b5cdab52072 to your computer and use it in GitHub Desktop.
//一个创建宏命令的函数
var MacroCommand = function(){
return {
commandsList : [],
add : function(command){
this.commandsList.push(command);
},
execute: function(){
for(var i = 0, command; command = this.commandsList[i++];){
command.execute();
}
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment