From be1725d2eb0af76e240a922dac5901579fe4e0aa Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Thu, 14 Jul 2016 10:42:56 -0500 Subject: [PATCH] chore(comments): explain sync --- src/plugins/plugin.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/plugin.ts b/src/plugins/plugin.ts index b6dc607b6..7a97b8bf8 100644 --- a/src/plugins/plugin.ts +++ b/src/plugins/plugin.ts @@ -142,6 +142,7 @@ function callInstance(pluginObj: any, methodName: string, args: any[], opts: any function wrapInstance (pluginObj: any, methodName: string, opts: any = {}) { return (...args) => { if (opts.sync) { + // Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is return callInstance(pluginObj, methodName, args, opts); } else if (opts.observable) { return new Observable(observer => { @@ -190,6 +191,7 @@ export const wrap = function(pluginObj: any, methodName: string, opts: any = {} return (...args) => { if (opts.sync) + // Sync doesn't wrap the plugin with a promise or observable, it returns the result as-is return callCordovaPlugin(pluginObj, methodName, args, opts); else if (opts.observable)