jquery - Javascript- Calling other JS function vs calling other function through pub-sub always? -
i read pub-sub pattern in javascript. got point enable loose coupling between different javascript files i.e. publisher need change if 1 of subscribers removed.
but wondering correct use everywhere i.e. using @ every place calling function javascript file? example, if have 6 javascript files js-a js-f. currently, call function js-f-function-1 js-a js-f.js-f-function-1(). correct replace such calls publishing such event js-a , subscribing same in js-f?
Comments
Post a Comment