Skip to content

Commit

Permalink
feat(plugin): call clearFunction with original fn args
Browse files Browse the repository at this point in the history
  • Loading branch information
tlancina committed Feb 8, 2016
1 parent 6688c4d commit 8f27fc9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dist/plugins/plugin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/plugin.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8f27fc9

Please sign in to comment.