Closed bjornstar closed 2 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/pmndrs/use-cannon/EMWmDYjQTHDGbJEUVvVJx5DHUWwu
✅ Preview: https://use-cannon-git-fork-bjornstar-worker-connect-pmndrs.vercel.app
@pmndrs/cannon-worker-api
postMessage
that queues the messages if there is no workerconnect
, we instantiate the worker, add the onmessage handler and flush the messageQueuedisconnect
, removes the onmessage handler (probably unnecessary)init
now takesworld
instead ofstate
@react-three/cannon
connect
beforeinit
in a useEffect (instead of useLayoutEffect)