This pattern is like the module pattern; it focuses on public & private methods. The difference is that the revealing module pattern was engineered as a way to ensure that all methods and variables are kept private until they are explicitly exposed; usually through an object literal returned by the ...

learn more… | top users | synonyms

0
votes
0answers
9 views

Mini school database with JS revealing module pattern

I tried the module pattern for the first time, with this exercise as a problem to solve: http://exercism.io/exercises/javascript/grade-school/readme It's a small exercise requiring simple tasks : ...
0
votes
0answers
22 views

Modular JS revealing module pattern

I am just getting started with Modular JS and I am converting a spaghetti coded jQuery UI using the revealing module pattern. My concern is, basically, if I am doing it right. tab_template: ...
2
votes
1answer
54 views

Stock performance app

I'm building an app that tells you a stock's percentage change in price between two dates by using Yahoo's API. Given a stock ticker and two dates, it currently outputs the percentage return to the ...
2
votes
0answers
43 views

Weather Application - Reavling Module Pattern

I'm trying to practice and learn design patterns, and I decided to create a weather app using the revealing module pattern. How can I improve on this, and what mistakes did I make? Main.js ...
2
votes
2answers
95 views

Should I use module pattern for this notification controller?

I have the following code, I use this pattern for the entire JavaScript code. I'm trying to re-factor my code again. Should I use the Module pattern? Revealing Module Pattern to be specific? What's ...
17
votes
1answer
204 views

Alea implementation

The following is an implementation of the Alea random number generation approach by Johannes Baagøe, reworked from the rot.js implementation by dropping all the pesky underscore prefixes in the ...
8
votes
1answer
1k views

Node module using promises and the revealing module pattern

Can someone give me some feedback on this pattern? I am writing a node.js module that connects to a remote API, caches JSON, returns it as output. I have a cli wrapper script that uses the module, ...
1
vote
0answers
45 views

Injecting required functions by synchronous script loading

I have a file HintBox.js containing a JS prototype of the same name which requires our internal JS library (call it $lib) in ...
2
votes
1answer
373 views

Module pattern callback implementation

I'm rewriting a simple app using HTML/CSS/JavaScript that creates animations with images using intervals, and there's a bunch of buttons that controls these animations. It's scaling and becoming ...
2
votes
1answer
156 views

Am I using the JavaScript “module pattern” correctly?

I am reading this article about how you can organize JavaScript code for large projects. I am attempting to write a simple events calendar as a way to play with some of these design patterns. Using ...
7
votes
1answer
442 views

First “Revealing Module” implementation

I have a little js I call a "jqGrid Factory" to encapsulate common settings and functionality across my web app. I just want to see what improvements I can make. ...
0
votes
1answer
51 views

Singleton model for modifying future .chart elements

I have written a singleton module which is to be used for some future modifications on .chart elements. Modification functions, such as ...
4
votes
3answers
356 views

Extracting pattern and simplifying testing

I observe the same pattern in a number of my classes but can't extract/abstract it due the tight coupling inside each particular implementation. Having the class accepting an optional number of ...
3
votes
1answer
822 views

Revealing module implicity calling an internal function - is this a “smell” [closed]

I'm trying to improve my javascript and have been using the revealing module pattern to good effect but I noticed that code in the module not in a function or the return is executed on creation have ...