summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Buczynski <adambuczynski@gmail.com>2016-08-03 07:53:35 +1200
committerAdam Buczynski <adambuczynski@gmail.com>2016-08-03 07:53:35 +1200
commitafe038217b2989e0bc37c79c2fc7ec4b1440ce4f (patch)
tree0c9a687ff50c1eac47adeed27c497a3b85630b37
parent652210bfce84217a6867d1640facdde3cd4f8ea7 (diff)
downloadsendgrid-nodejs-afe038217b2989e0bc37c79c2fc7ec4b1440ce4f.zip
sendgrid-nodejs-afe038217b2989e0bc37c79c2fc7ec4b1440ce4f.tar.gz
sendgrid-nodejs-afe038217b2989e0bc37c79c2fc7ec4b1440ce4f.tar.bz2
Avoid `this` reference
-rw-r--r--lib/sendgrid.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sendgrid.js b/lib/sendgrid.js
index 38d65e0..4150935 100644
--- a/lib/sendgrid.js
+++ b/lib/sendgrid.js
@@ -75,7 +75,7 @@ function SendGrid(apiKey, host, globalHeaders) {
var client = new Client(globalRequest);
//Interact with the API with this function
- this.API = function(request, callback) {
+ SendGrid.API = function(request, callback) {
//If no callback provided, we will return a promise
if (!callback) {
@@ -109,9 +109,9 @@ function SendGrid(apiKey, host, globalHeaders) {
};
//Set requests
- this.emptyRequest = getEmptyRequest;
- this.globalRequest = globalRequest;
- return this;
+ SendGrid.emptyRequest = getEmptyRequest;
+ SendGrid.globalRequest = globalRequest;
+ return SendGrid;
}
//Try to use native promises by default