mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +08:00
feat(plugin): call clearFunction with original fn args
This commit is contained in:
parent
6688c4d91d
commit
8f27fc9e51
3
dist/plugins/plugin.js
vendored
3
dist/plugins/plugin.js
vendored
@ -95,6 +95,9 @@ function wrapObservable(pluginObj, methodName, args, opts) {
|
||||
var pluginResult = callCordovaPlugin(pluginObj, methodName, args, opts, observer.next.bind(observer), observer.error.bind(observer));
|
||||
return function () {
|
||||
try {
|
||||
if (opts.clearWithArgs) {
|
||||
return util_1.get(window, pluginObj.pluginRef)[opts.clearFunction].apply(pluginObj, args);
|
||||
}
|
||||
return util_1.get(window, pluginObj.pluginRef)[opts.clearFunction].apply(pluginObj, pluginResult);
|
||||
}
|
||||
catch (e) {
|
||||
|
2
dist/plugins/plugin.js.map
vendored
2
dist/plugins/plugin.js.map
vendored
File diff suppressed because one or more lines are too long
@ -106,6 +106,9 @@ function wrapObservable(pluginObj:any, methodName:string, args:any[], opts:any =
|
||||
|
||||
return () => {
|
||||
try {
|
||||
if (opts.clearWithArgs){
|
||||
return get(window, pluginObj.pluginRef)[opts.clearFunction].apply(pluginObj, args);
|
||||
}
|
||||
return get(window, pluginObj.pluginRef)[opts.clearFunction].apply(pluginObj, pluginResult);
|
||||
} catch(e) {
|
||||
console.warn('Unable to clear the previous observable watch for', pluginObj.name, methodName);
|
||||
|
Loading…
Reference in New Issue
Block a user