Let’s say I need to modify the way scrum board works - for example rendering of versions on the version panel. We’re adding extra statuses there.
I extend global object and that way Atlassian code executes my code as well.
As far as I understand AMD, If I do
var versionController = require("jira-agile/rapid/ui/version/version-controller");
if ( typeof versionController.draw === 'function'){
var versionDraw = versionController.draw;
versionController.draw = function(){
versionDraw.apply(this, arguments);
.... my code....
}
}
I won’t be able to overload the definition of “jira-agile/rapid/ui/version/version-controller” the same way global GH. object would do.
So, if the some backlog code will execute require(“jira-agile/rapid/ui/version/version-controller”).draw(), it will not execute “… my code…” as this is going to be a different object? Is that correct?