Make a namespace for our scripts #16

Open
opened 2013-06-30 20:05:54 -06:00 by Nodlehs · 2 comments
Nodlehs commented 2013-06-30 20:05:54 -06:00 (Migrated from github.com)

We should slap everything under a namespace

var NamespaceName = NamespaceName || {};

We should slap everything under a namespace var NamespaceName = NamespaceName || {};
Nodlehs commented 2013-06-30 20:07:28 -06:00 (Migrated from github.com)

From https://app.roll20.net/forum/post/146759/constants-available-to-the-whole-script#post-147508

"I imagine very complex scripts will even take advantage of an "export"/closure-based protection as well, e.g.:"

(function() {
//Do stuff in here, only modifying/access konrad if you need to work outside this particular script.
})();

From https://app.roll20.net/forum/post/146759/constants-available-to-the-whole-script#post-147508 "I imagine very complex scripts will even take advantage of an "export"/closure-based protection as well, e.g.:" (function() { //Do stuff in here, only modifying/access konrad if you need to work outside this particular script. })();
j-t-d commented 2013-07-05 11:25:23 -06:00 (Migrated from github.com)

I've used both methods in the command, encounter, treasure, gm modules. Works well.

I've used both methods in the command, encounter, treasure, gm modules. Works well.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jeff/Roll20DungeonSlayers#16
No description provided.