minigame-std
Version:
Mini Game Standard Development Library.
34 lines (19 loc) • 652 B
Markdown
[**minigame-std**](../README.md)
***
[minigame-std](../README.md) / addNetworkChangeListener
# Function: addNetworkChangeListener()
```ts
function addNetworkChangeListener(listener): () => void
```
监听网络状态变化。
## Parameters
| Parameter | Type | Description |
| ------ | ------ | ------ |
| `listener` | (`type`) => `void` | 网络状态变化的回调函数。 |
## Returns
`Function`
返回一个函数,调用该函数可以移除监听器。
### Returns
`void`
## Defined in
[src/std/network/mod.ts:23](https://github.com/JiangJie/minigame-std/blob/8633d80114dee6c79033ec094d8233bd8263bedc/src/std/network/mod.ts#L23)