MCPcopy Index your code
hub / github.com/didi/mpx / getNetworkType

Function getNetworkType

packages/api-proxy/src/platform/api/device/network/rnNetwork.js:16–31  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

14}
15
16const getNetworkType = function (options = {}) {
17 const { success, fail, complete } = options
18 NetInfo.fetch().then((connectionInfo) => {
19 const result = {
20 networkType: getConnectionType(connectionInfo),
21 errMsg: 'getNetworkType:ok'
22 }
23 defineUnsupportedProps(result, ['signalStrength', 'hasSystemProxy'])
24 successHandle(result, success, complete)
25 }).catch((err) => {
26 const result = {
27 errMsg: err.message
28 }
29 failHandle(result, fail, complete)
30 })
31}
32
33const onNetworkStatusChange = function (callback) {
34 _callbacks.add(callback)

Callers 1

Calls 5

defineUnsupportedPropsFunction · 0.90
successHandleFunction · 0.90
failHandleFunction · 0.90
getConnectionTypeFunction · 0.85
fetchMethod · 0.80

Tested by

no test coverage detected