UNPKG

it-postmsg

Version:

Streaming iterables over window.postMessage

12 lines (10 loc) 238 B
const { caller } = require('postmsg-rpc') module.exports = (id, options) => { return { [Symbol.asyncIterator] () { return this }, next: caller(`${id}_next`, options), return: caller(`${id}_return`, options) } }