wmpf.Channel.on(string event, function callback)

View Markdown

Last edited on 2026-04-06

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)
})