across-tabs-notify
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

轻量级浏览器跨 tab 通信

目前仅测试了 chrome。

安装

yarn add across-tabs-notify
# or 
npm install --save across-tabs-notify

用法

import AcrossTabsNotify from 'across-tabs-notify'
 
// 发送跨 tab 通知。
AcrossTabsNotify.broardcast('event-name', {
    data: 'message data'
})
 
// 在任意位置监听通知
AcrossTabsNotify.om('event-name', payload => {
  console.log(payload.data)  // 'message data'
})

Package Sidebar

Install

npm i across-tabs-notify

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

151 kB

Total Files

14

Last publish

Collaborators

  • weineel