mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-18 04:13:51 +08:00
Clean up and simplify WebSocket implementation on the JS side
Summary:- Get rid of no longer necessary WebSocket.js v WebSocketBase.js split - Use `EventTarget(list, of, events)` as base class to auto-generate `oneventname` getters/setters that get invoked along with other event handlers - Type annotation `any` considered harmful, especially when we can easily spell out the actual type - Throw in some `const` goodness for free **Test Plan:** Launch UIExplorer example app, supplied `websocket_test_server` script, and try different combinations of sending and receiving text and binary data on both iOS and Android. Closes https://github.com/facebook/react-native/pull/6889 Differential Revision: D3184835 Pulled By: mkonicek fb-gh-sync-id: f21707f4e97aa5a79847f5157e0a9f132a1a01cd fbshipit-source-id: f21707f4e97aa5a79847f5157e0a9f132a1a01cd
This commit is contained in:
committed by
Facebook Github Bot 0
parent
0fa48c00a9
commit
ebb44d202b
@@ -174,6 +174,10 @@ const APIExamples = [
|
||||
key: 'VibrationExample',
|
||||
module: require('./VibrationExample'),
|
||||
},
|
||||
{
|
||||
key: 'WebSocketExample',
|
||||
module: require('./WebSocketExample'),
|
||||
},
|
||||
{
|
||||
key: 'XHRExample',
|
||||
module: require('./XHRExample'),
|
||||
|
||||
Reference in New Issue
Block a user