pass client instance to namespaceFactory

This commit is contained in:
Joe Fleming
2016-07-20 15:57:54 -07:00
parent 22febcbe38
commit dc16822223
2 changed files with 3 additions and 2 deletions

View File

@ -58,7 +58,7 @@ function Client(config) {
_.each(EsApiClient.prototype, _.bind(function (Fn, prop) {
if (Fn.prototype instanceof clientAction.ApiNamespace) {
this[prop] = new Fn(this.transport);
this[prop] = new Fn(this.transport, this);
}
}, this));

View File

@ -24,8 +24,9 @@ exports._resolveUrl = resolveUrl;
exports.ApiNamespace = function () {};
exports.namespaceFactory = function () {
function ClientNamespace(transport) {
function ClientNamespace(transport, client) {
this.transport = transport;
this.client = client;
}
ClientNamespace.prototype = new exports.ApiNamespace();