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 (marcuswestin#184)
  • Loading branch information
marcuswestin committed Feb 2, 2016
1 parent b530416 commit dd1fefc
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 dd1fefc

Please sign in to comment.