feat(instagram): add instagram sharing plugin (#453)

Closes #307
This commit is contained in:
Matt Lewis
2016-08-19 14:08:05 +01:00
committed by Ibrahim Hadeed
parent 14e41a31ef
commit f3e698f1be
3 changed files with 68 additions and 0 deletions
+8
View File
@@ -48,6 +48,14 @@ function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Func
// Get those arguments in the order [resolve, reject, ...restOfArgs]
args.unshift(reject);
args.unshift(resolve);
} else if (opts.callbackStyle === 'node') {
args.push((err, result) => {
if (err) {
reject(err);
} else {
resolve(result);
}
});
} else if (typeof opts.successIndex !== 'undefined' || typeof opts.errorIndex !== 'undefined') {
// If we've specified a success/error index
args.splice(opts.successIndex, 0, resolve);