Skip to content

Commit

Permalink
fix: vue tries to hydrate the proxy worker plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
tachibana-shin committed Oct 14, 2023
1 parent 9fb9bca commit 1261d26
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions npm/raiku-pgs/lib/thread/create-worker-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ export function createWorkerPlugin(

const proxy = new Proxy({} as APIPorted, {
get(_target, p) {
if (p === "__v_skip") return true // mark raw for vue reactivity

if (p === "toJSON") {
console.warn("[worker-plugin]: toJSON called but can't control.")

return () => "{}"
}
const worker = workerSession.getWorker()
if (p === "Rankings")
return put<ListenerWorker, "get">(worker, "get", p.toString())
Expand Down

0 comments on commit 1261d26

Please sign in to comment.