UNPKG
it-postmsg
Version:
latest (1.0.1)
1.0.1
1.0.0
Streaming iterables over window.postMessage
github.com/alanshaw/it-postmsg
alanshaw/it-postmsg
it-postmsg
/
src
/
source.js
12 lines
(10 loc)
•
238 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
const
{ caller } =
require
(
'postmsg-rpc'
)
module
.
exports
=
(
id, options
) =>
{
return
{ [
Symbol
.
asyncIterator
] () {
return
this
},
next
:
caller
(
`
${id}
_next`
, options),
return
:
caller
(
`
${id}
_return`
, options) } }