@cicada/message

cicada message

Stats

StarsIssuesVersionUpdatedCreatedSize
@cicada/message
0.3.32 years ago4 years agoMinified + gzip package size for @cicada/message in KB

Readme

cicada-message

For cicada iframe post message

NPM version NPM downloads Dependencies

Usage

import createMesssage from '@cicada/message'

const { listen, dispatch, invoke } = createMesssage()

listen('yourMessage', (data) => {
})

dispatch('yourMessage', { data: 'data' })

invoke('yourMessage', { data: 'data' }, 10000).then(result => console.log(result))

API

  • listen(event, callback) 监听事件
  • dispatch(event, data, toParent) 远程触发事件
  • invoke(vent, data, timeout, toParent) 远程服务调用并直接返回

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.