Open4

PartyKitをRemixと使ってみる

smallStallsmallStall

ここで使っているのか。えらい簡単だな。

whos-here.tsx
  usePartySocket({
    // connect to the party defined by 'geo.ts'
    party: "geo",
    // this can be any name, we just picked 'index'
    room: "index",
    onMessage(evt) {
      const data = JSON.parse(evt.data) as State;
      setUsers(data);
    },
  });