javascript - Module pattern callback implementation -
I am re-writing a simple app using HTML / CSS / JavaScript which can be used for images using intervals Creates animations with, and there is a bunch of buttons that control these animations. It is scaling and really messing up, with a logic mixed with DOM manipulations via javascript via javascript script file. So I design module patterns Based on your app's description, is there a problem with this callback implementation for the module? Or with module implementation? In this example, what is the best way to declare private variables and access them through public APIs? Gates and Setters? Are they really necessary? I want to write a readable code but I do not want to do super-architect things. (function ($) {$ .module = function (options) {var module = {options: $. (): (Callback: {start: false}}, options), start : Function (callback) {//console.log ('personal start method'); if (callback === "type of function") {callback ();}}} // public API ret...