Skip to content

Commit

Permalink
Merge pull request #1 from janis-commerce/JMV-457-inject-client
Browse files Browse the repository at this point in the history
change method name getInstance to inject, now inject the client insted of return the getInstance
  • Loading branch information
manuelvilche committed Aug 6, 2019
2 parents ced2b8e + 13e8a3c commit e5b14f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/active-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ class ActiveClient {
const client = clients && clients.length === 1 ? clients[0] : false;

if(client)
client.getInstance = this.getInstance(client);
this.inject(client);

return client;
}

static getInstance(client) {
return TheClass => {
static inject(client) {
client.getInstance = TheClass => {
const instance = new TheClass();
instance.client = client;

Expand Down

0 comments on commit e5b14f8

Please sign in to comment.