pass client instance to namespaceFactory
This commit is contained in:
@ -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));
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user