0

I have one library/object that is compatible with commonjs, and I have another library/object that adds itself to the first library/object.

Do I need to manually wrap the second library for commonjs or should it be accessible through the first library?

The two libraries I am using are backbone.js and backfire.js.

backbonejs already exports its objects and I can access them fine.

backfirejs adds to the backbone object:

Backfire.js:

Backbone.Firebase = function(ref) {
this._fbref = ref;
this._children = [];
if (typeof ref == "string") {
this._fbref = new Firebase(ref);
}
_.bindAll(this);
this._fbref.on("child_added", this._childAdded);
this._fbref.on("child_moved", this._childMoved);
this._fbref.on("child_changed", this._childChanged);
this._fbref.on("child_removed", this._childRemoved);
};

How can I access the Firebase object using commonjs?

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
SankJoe
  • 1
  • 1
  • could you show us some code to illustrate what you're talking about? – Ben McCormick Jun 25 '13 at 22:37
  • What do you mean by "manually wrap"? Also, what does this have to do with inheritance? – Bergi Jun 25 '13 at 23:25
  • Updated question with code – SankJoe Jun 26 '13 at 20:21
  • @SankJoe: Thanks. Isn't this missing a `var Backbone = import("Backbone.js")` at the top of your file? – Bergi Jun 27 '13 at 00:15
  • possible duplicate of [Are there any problems with nesting app-specific Backbone.js assets under common ones?](http://stackoverflow.com/questions/13629130/are-there-any-problems-with-nesting-app-specific-backbone-js-assets-under-common) – Paul Sweatte Apr 14 '14 at 22:33

0 Answers0