minigame-std
Version:
Mini Game Standard Development Library.
34 lines (20 loc) • 648 B
Markdown
[**minigame-std**](../README.md)
***
[minigame-std](../README.md) / tryGeneralSyncOp
# Function: tryGeneralSyncOp()
```ts
function tryGeneralSyncOp<T>(op): IOResult<T>
```
Defined in: [src/std/utils/mod.ts:31](https://github.com/JiangJie/minigame-std/blob/fdb22241c47c2e98329a4c62befde728957e03ee/src/std/utils/mod.ts#L31)
执行同步函数,预期异常都是 `WechatMinigame.GeneralCallbackResult`。
## Type Parameters
| Type Parameter |
| ------ |
| `T` |
## Parameters
| Parameter | Type | Description |
| ------ | ------ | ------ |
| `op` | () => `T` | 需要执行的同步函数。 |
## Returns
`IOResult`\<`T`\>
IOResult。