UNPKG
comlink
Version:
alpha (4.0.0-alpha.10)
latest (4.4.2)
next (4.0.0-alpha.10)
4.4.2
4.4.1
4.4.0
4.3.1
4.3.0
4.2.1
4.2.0
4.1.0
4.0.5
4.0.4
4.0.3
4.0.2
4.0.1
4.0.0
4.0.0-alpha.10
4.0.0-alpha.9
4.0.0-alpha.8
4.0.0-alpha.7
4.0.0-alpha.6
4.0.0-alpha.4
4.0.0-alpha.3
4.0.0-alpha.2
4.0.0-alpha.1
4.0.0-alpha.0
3.2.0
3.1.1
3.1.0
3.0.3
3.0.2
2.3.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.1
Comlink makes WebWorkers enjoyable
github.com/GoogleChromeLabs/comlink
GoogleChromeLabs/comlink
comlink
/
docs
/
examples
/
99-nonworker-examples
/
iframes
/
iframe.html
11 lines
(9 loc)
•
298 B
HTML
View Raw
1
2
3
4
5
6
7
8
9
10
11
<!DOCTYPE
html
>
<
script
type
=
"module"
>
import
*
as
Comlink
from
"https://unpkg.com/comlink/dist/esm/comlink.mjs"
;
// import * as Comlink from "../../../../dist/esm/comlink.mjs";
function
add
(
a, b
) {
return
a + b; }
Comlink
.
expose
(add,
Comlink
.
windowEndpoint
(self.
parent
));
</
script
>