Comparing version 0.0.1 to 0.0.2
@@ -115,2 +115,3 @@ var _ = require('underscore')._, | ||
// Parse Gigya's JSON response | ||
var json; | ||
if(_.isString(response)) { | ||
@@ -117,0 +118,0 @@ try { |
@@ -7,3 +7,3 @@ { | ||
], | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "Scott Hovestadt <scott.hovestadt@gmail.com>", | ||
@@ -10,0 +10,0 @@ "maintainers": [ |
@@ -44,1 +44,31 @@ Unofficial Gigya Node SDK | ||
``` | ||
##Using EventEmitter style callbacks | ||
In addition to node-style callbacks, the SDK also support EventEmitter style callbacks: | ||
``` | ||
gigya.socialize.getUserInfo({ | ||
UID: 'PUT-UID-HERE' | ||
}).on('response', function(response) { | ||
// Print response to console | ||
console.log(response); | ||
}).on('err', function(err) { | ||
// Request failed, handle error | ||
return console.error(err); | ||
}); | ||
``` | ||
Additionally, accounts.search and ds.search have special support for streaming query response data: | ||
``` | ||
gigya.accounts.search({ | ||
query: 'SELECT * FROM accounts' | ||
}).on('record', function(account) { | ||
// Do something with account... | ||
console.log(account); | ||
}).on('end', function(summary) { | ||
// Done streaming | ||
console.log(summary); | ||
}).on('err', function(err) { | ||
// Request failed, handle error | ||
return console.error(err); | ||
}); | ||
``` |
27135
580
74