Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MultithreadedJSBook/code-samples
/ asyncOnMessageWrap
Function
asyncOnMessageWrap
ch8-template-render/worker.js:4–8 ·
view source on GitHub ↗
(fn)
Source
from the content-addressed store, hash-verified
2
const
template = require(
'./template.js'
);
3
4
function
asyncOnMessageWrap(fn) {
5
return
async
function
(msg) {
6
parentPort.postMessage(
await
fn(msg));
7
}
8
}
9
10
const
commands = {
11
renderLove: (data) => template.renderLove(data)
Callers
1
worker.js
File · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected