In ES5 I create a Model-View-Controller structure by using IIFEs and reveal module pattern.
var model = function () { ... }() var view = function () { ... }() var controller = function (model, view) { view.functionname(var one); ...... }(model, view)
The new block scope {} in ES6 can replace IIFEs, but how we call the functions/methods of the model/view from the controller ?
To combine multiple javascripts in ES5 and avoid naming collision I use an expression:
;( code ...)
How can be this done in ES6 ?
view.function(var one);is invalid JS.;( code ...)does not avoid naming collision. It may solve issues with automatic semi-colon insertion. Not sure what you are asking. Also, limit your question to one question.view.functionname(…)becomes something else in ES6?