feat(file-opener): add file opener support (#497)

closes #295
This commit is contained in:
Ibrahim Hadeed
2016-08-27 14:43:57 -04:00
committed by GitHub
parent 0cf7d6aca1
commit 21d8122257
3 changed files with 62 additions and 0 deletions
+5
View File
@@ -56,6 +56,11 @@ function setIndex(args: any[], opts: any = {}, resolve?: Function, reject?: Func
resolve(result);
}
});
} else if (opts.callbackStyle === 'object' && opts.successName && opts.errorName) {
let obj: any = {};
obj[opts.successName] = resolve;
obj[opts.errorName] = reject;
args.push(obj);
} else if (typeof opts.successIndex !== 'undefined' || typeof opts.errorIndex !== 'undefined') {
// If we've specified a success/error index
args.splice(opts.successIndex, 0, resolve);