Listen to service events of registered third-party Apps.
Parameters
Object object
| Attribute | Type | Default | Required | Description |
|---|---|---|---|---|
| event | string | Yes | Name of the event to listen to | |
| callback | function | Yes | Callback function |
object.callback Callback Function
Parameters
Object res
| Property | Type | Description |
|---|---|---|
| data | string | Data passed through wmpf from a third-party app to Mini Program |
Sample Code
wmpf.Channel.on('test', (res) => {
console.log(res.data)
})