magic-helper
Version:
this is magic helper
16 lines (15 loc) • 371 B
text/typescript
import h5 from 'weixin-js-sdk'
import type { ActionParams } from '../types'
export const action = (action: ActionParams) => {
return new Promise((resolve, reject) => {
try {
h5.miniProgram.postMessage({
data: action
})
h5.miniProgram.navigateBack()
resolve('ok')
} catch (error) {
reject(error)
}
})
}