Skip to main content

Questions tagged [revealing-module-pattern]

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 closure in which it’s defined. It also allows the developer to avoid a lot of `this.` in the code.

Filter by
Sorted by
Tagged with
-3 votes
1 answer
131 views

Here is a class that I have implemented in order to sort rows of parameters in the form of an array of strings. ...
MigMax's user avatar
  • 15
2 votes
0 answers
53 views

I've been working on a project to make myself more comfortable with NodeJS, especially Express and TypeScript. Searching and reviewing a lot of approaches of the people, providing bootstraps for it, I ...
Pascal Schrage's user avatar
4 votes
1 answer
2k views

Feature requirements. I can move a square box. I can resize a square box by stretching four edges. Many square boxes can exist. I've implemented moving and resizing square boxes by module pattern. Of ...
gentlejo's user avatar
  • 155
0 votes
1 answer
448 views

I've recently been learning about the revealing module pattern, and it seems like a really good way to structure code in many cases. However, I find myself wanting to use it like a class, so I'm ...
ReeseyCup's user avatar
0 votes
1 answer
76 views

I'm learning about the Javascript module pattern from an array of online sources. The following suits my basic needs at the moment: ...
sansSpoon's user avatar
  • 173
3 votes
1 answer
217 views

I'm keen to get some feedback on how I have utilized the Revealing Module pattern here. This code is part of a web application that is used by the public. The purpose of this code is to encapsulate ...
JTech's user avatar
  • 143
3 votes
1 answer
434 views

I want to understand better how to make re-usable components that I can create multiple instances of, and I think the revealing module pattern comes handy, however, I'm not sure I'm implementing it ...
Carlos Valencia's user avatar
2 votes
0 answers
99 views

Making long story short, I got a chance to jump from DevOps to Software Development (Frontend). Because I'm quite new to JS design patterns, I need some quality advice about the job I've done recently....
xsimonzx's user avatar
2 votes
1 answer
151 views

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 ...
Joseph Palomino's user avatar
7 votes
2 answers
1k views

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? ...
Dejan.S's user avatar
  • 196
2 votes
1 answer
78 views

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. ...
Antonio Pavicevac-Ortiz's user avatar
2 votes
0 answers
171 views

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 ...
sarath's user avatar
  • 51
1 vote
1 answer
115 views

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 brought ...
Christopher Hill's user avatar
3 votes
1 answer
174 views

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 ...
konijn's user avatar
  • 34.4k
5 votes
1 answer
335 views

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 ...
Antonin Cezard's user avatar
3 votes
0 answers
112 views

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 : ...
Antonin Cezard's user avatar
3 votes
1 answer
135 views

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 ...
Jackmc1047's user avatar
2 votes
0 answers
124 views

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 ...
Kieran's user avatar
  • 21
2 votes
2 answers
161 views

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 ...
Akar's user avatar
  • 369
20 votes
1 answer
573 views

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 ...
konijn's user avatar
  • 34.4k
9 votes
1 answer
2k views

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, ...
Sammers's user avatar
  • 93
2 votes
1 answer
827 views

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 ...
zok's user avatar
  • 213
2 votes
1 answer
258 views

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 ...
user1028270's user avatar
7 votes
1 answer
556 views

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. ...
Brian Ogden's user avatar
0 votes
1 answer
72 views

I have written a singleton module which is to be used for some future modifications on .chart elements. Modification functions, such as ...
Viktor's user avatar
  • 217
4 votes
3 answers
548 views

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 ...
abatishchev's user avatar
4 votes
1 answer
1k views

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 ...
Nathan's user avatar
  • 231