Skip to content

Commit

Permalink
Allow for calling handlers from JS with just a handler name and respo…
Browse files Browse the repository at this point in the history
…nseCallback function.
  • Loading branch information
marcuswestin committed Feb 2, 2016
1 parent c563453 commit 6a83f58
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions WebViewJavascriptBridge/WebViewJavascriptBridge_JS.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ function registerHandler(handlerName, handler) {
}

function callHandler(handlerName, data, responseCallback) {
if (arguments.length == 2 && typeof data == 'function') {
responseCallback = data;
data = null;
}
_doSend({ handlerName:handlerName, data:data }, responseCallback);
}

Expand Down

0 comments on commit 6a83f58

Please sign in to comment.