RequireJS is a JavaScript file and module loader. It is optimized for in-browser use, but it can be used in other JavaScript environments, like Rhino and Node.

learn more… | top users | synonyms (1)

4
votes
1answer
54 views

Structure a webapp using RequireJS

I've written a small webapp in JavaScript, and am now essentially rewriting it to use RequireJS. I'm doing this partly to get more familiar with RequireJS (which I have little experience with), as ...
1
vote
1answer
70 views

Using GeoComplete with RequireJS (with shim config)

I am using the GeoComplete plugin with RequireJS It works, but please could someone confirm I've done this correctly, mainly my understanding of shim: ...
5
votes
3answers
109 views

Is there anything can be improved in this JavaScript module?

I am using RequireJS JavaScript library. I have the following JavaScript module define for dataservice: ...
7
votes
2answers
136 views

Modular design with Require.js

I am trying to get a better understanding of the modular design pattern and I am using Requirejs to manage my dependencies. I understand separating code into modules (using define with RequireJS) so ...
5
votes
1answer
252 views

Avoiding RequireJS circular dependencies

My app module bootstraps a Backbone.js application. I need app to be available in every other view for easy access to router, ...
0
votes
0answers
46 views

Requirejs modules and lazy instantiation

I’ve implemented what I think is a good structure for instantiating classes with Requirejs. My idea is that each HTML view that acts as some sort of component will have a corresponding JavaScript ...
1
vote
1answer
209 views

Layout manager: decouple DOM insertion from construction and rendering? [closed]

I'm refactoring a responsive report builder in JavaScript. Here's what it looks like: This started as a small set of objects that transformed data, rendered the graphs with D3.js, and managed the ...
2
votes
1answer
202 views

Is my Backbone.View organized properly and stylistically correct?

I'm learning BackboneJS and I just made an attempt at converting a pre-existing module to a Backbone.View. I was hoping to get some feedback on my attempt and learn. I've been using the annotated ToDo ...
4
votes
1answer
313 views

User model with BackboneJS and RequireJS with test cases in Jasmine

I've been taking a stab at implementing test cases using the Jasmine testing framework. To do so, I've made an application which has a User object. This User object is created by the server, but its ...
0
votes
2answers
139 views

Refactoring a constructor to accept a config object

So I have a function which creates a Playlist object. Currently, this function accepts two paramaters: id and name. However, it also exposes a method called 'loadData' which can set the entire object ...