Question on recommended usage of AP.
in Confluence Cloud:
The documentation shows e.g (https://developer.atlassian.com/cloud/confluence/modules/dynamic-content-macro/):
AP.require("confluence", function (confluence) {
var macroData = confluence.getMacroData(function(macroParams) {
doSomethingWith(macroParams.myParameter);
});
});
And in other places (e.g. Confluence) the following usage is shown:
AP.confluence.saveMacro({foo: 'bar'}, "a new macro body");
My question is the following: Is one of the two calling styles (AP.require("confluence", ...
or AP.confluence. ...
) to be preferred?
Or is it just a matter of taste of the documentation writer?