轻量级JS消息库:flyer.js
jopen
10年前
flyer.js 是一个轻量级的消息库,开发用于clojurescript & javascript.
它提供了在 frames, iframes, 和 windows之间广播消息。
功能和操作
- Simple API, from which you can build more elaborate messaging systems.
- Messages are broadcasted to all frames and registered windows, regardless of whether or not they want them (hence, the name)
- Frames can subscribe to specific channels, and can pattern-match to specific topics being sent on that channel
flyer.broadcast({ channel: "default", topic: "person.insert", data: {id: 1, name: "Ben"} }); flyer.broadcast({ channel: "default", topic: "person.delete", data: {id: 1} });