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 ...
2
votes
0answers
26 views
Google Maps API implementation with a revealing module pattern
What follows is the JavaScript written for a Google Maps API implementation (for an image gallery that shows image, location, description, next and prev buttons, etc.).
I have a JSON "...
1
vote
1answer
49 views
Countdown module that hides an element when a specified date is reached
I have the following piece of code which hides an element when a specified date was reached. I would like to get some tips about do's and don'ts.
Specifically, I'm interested in:
improvements ...
3
votes
1answer
36 views
Rock, Paper, Scissors, and the Revealing Module Pattern
After reviewing this approach:
Rock-Paper-Scissors with the revealing module pattern
I decided to write an alternative where the Revealing Module Pattern is used for the UI, model, and controller.
I ...
4
votes
1answer
74 views
Rock-Paper-Scissors with the revealing module pattern
In my ongoing effort in learning advanced JavaScript I tried to develop the traditional rock paper scissors game by using the famous revealing module pattern. I'm not comfortable yet with what has to ...
3
votes
0answers
24 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
34 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
57 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
47 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
96 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
214 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
48 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
397 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
163 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
456 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
367 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
875 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 ...