Class: DynamicMacroDefinition

DynamicMacroDefinition(name, makeTags)

DynamicMacro allows you to create customer tag with JavaScript in macro-fashion. Its purpose is to make logic-heavy macro back to JavaScript for easier management. Unlike TagAction:
  • It can returns multiple tags back to the conductor.
  • Everything has to be sync, tags has to be returned immediately.

Constructor

new DynamicMacroDefinition(name, makeTags)

Parameters:
Name Type Description
name String -
makeTags DynamicMacroDefinition~makeTags -
Example
conductor.macros["hello"] = new DynamicMacroDefinition("dynamic", (args)=> {
	if (args.foo) {
		return [ new Tag("s") ];
	}
	return [
		new Tag("ch", {text: "hello, "+args.text}),
		new Tag("p"),
	];
});
// called like this:
// [hello text=hey] [hello foo=true]