forked from marcuswestin/WebViewJavascriptBridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the
error
parameter from all response callbacks. This change…
… breaks API backwards compatibility! Previously, responses were sent using either `response.respondWith(data)` or `response.respondWithError(error)`. Response handlers were then required to take two parameters: ` function responseHandler(error, responseData) { if (error) { /* handle error */ } ... } ` However, this approach causes confusion, as seen in GH issue marcuswestin#18. Instead, we do away with the notion of errors in responses and simply have response callback blocks with a single data parameter: `responseCallback(data)` and `function responseHandler(responseData) { ... }` To migrate from old ObjC code, simple replace all instances of `WVJBResponse* response` with `WVJBResponseCallback responseCallback`, and replace all instances of `response.respondWith(data)` with `responseCallback(data)`. To migrate from old Javascript code, replace all instances of `response.respondWith(data)` with `response(data)`.
- Loading branch information
1 parent
318e72a
commit 4ab41bb
Showing
6 changed files
with
83 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.