Skip to content

Commit

Permalink
Merge pull request #240 from gaop-0561/master
Browse files Browse the repository at this point in the history
简化JS中的调用
  • Loading branch information
uknownothingsnow authored Mar 23, 2021
2 parents 506b36d + 984d8db commit 3621bd6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion library/src/main/assets/WebViewJavascriptBridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
}
// 调用线程
function callHandler(handlerName, data, responseCallback) {

// 如果方法不需要参数,只有回调函数,简化JS中的调用
if (arguments.length == 2 && typeof data == 'function') {
responseCallback = data;
data = null;
}
_doSend(handlerName, data, responseCallback);
}

Expand Down

0 comments on commit 3621bd6

Please sign in to comment.