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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -