const promises = msgs
.map((raw) =>
parseTRPCMessage(raw, router._def._config.transformer),
)
.map(client.data.handleRequest); // client.data.handleRequest is no ready yet, so there is an error TypeError: Array.prototype.map callback must be a function.
websocket
-----> open
https://github.com/cah4a/trpc-bun-adapter/blob/4de96b72e099c4d19561651bc43b74c8fc3240ec/src/createBunWSHandler.ts#L79
await ctxPromise; // if this takes some time.
----> message https://github.com/cah4a/trpc-bun-adapter/blob/4de96b72e099c4d19561651bc43b74c8fc3240ec/src/createBunWSHandler.ts#L290
https://github.com/cah4a/trpc-bun-adapter/blob/4de96b72e099c4d19561651bc43b74c8fc3240ec/src/createBunWSHandler.ts#L125
client.data.handleRequest = ... // set handleRequest