mirror of
https://github.com/status-im/react-native-udp.git
synced 2025-01-12 10:04:21 +00:00
Merge pull request #28 from tradle/createSocket
allow options to be passed into createSocket
This commit is contained in:
commit
0825e2b1d4
@ -6,10 +6,9 @@
|
||||
|
||||
var UdpSocket = require('./UdpSocket');
|
||||
|
||||
exports.createSocket = function(type) {
|
||||
return new UdpSocket({
|
||||
type: type
|
||||
})
|
||||
exports.createSocket = function(options) {
|
||||
if (typeof options === 'string') options = { type: options }
|
||||
return new UdpSocket(options)
|
||||
}
|
||||
|
||||
exports.Socket = UdpSocket;
|
||||
|
Loading…
x
Reference in New Issue
Block a user