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

2
votes
1answer
27 views

Javascript module for sorting and searching

Here is a vanilla JS module that I wrote for sorting and searching an array. I would appreciate feedback on the design of the module as I'm new to writing javascript in modules and don't know if I'm ...
4
votes
0answers
36 views

Module with helper functions to initialize or reinitialize a Slick carousel

I been getting into javascript patterns and would love to get some feedback. I notice that I got some general helper functions. Is this a good approach of dealing with it? ...
2
votes
1answer
42 views

Clipboard support in jQuery using revealing module pattern

I have recently been getting into the habit of leveraging the revealing module pattern for all my code. I used this guide for inspiration, but my code doesn't feel as elegant. ...
2
votes
0answers
44 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
67 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
46 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 ...
5
votes
1answer
86 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
32 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
56 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: ...
3
votes
1answer
65 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
56 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
104 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
231 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
52 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
464 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
174 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
483 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
53 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
415 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 ...
4
votes
1answer
942 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 ...