Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix typo #85

Merged
merged 1 commit into from
Oct 18, 2024
Merged

docs: fix typo #85

merged 1 commit into from
Oct 18, 2024

Conversation

jamaluddinrumi
Copy link
Contributor

import { defineHooks } from "crossws";

const hooks = defineHooks({
  upgrade(req) {
    console.log(`[ws] upgrading ${req.url}...`)
    return {
      headers: {}
    }
  } // it should be a comma `,` here

  open(peer) {
    console.log(`[ws] open: ${peer}`);
  },

  message(peer, message) {
    console.log("[ws] message", peer, message);
    if (message.text().includes("ping")) {
      peer.send("pong");
    }
  },

  close(peer, event) {
    console.log("[ws] close", peer, event);
  },

  error(peer, error) {
    console.log("[ws] error", peer, error);
  },
}; // it should be a comma `)` here

missing , and ) in hooks guide.

missing `,` & `)` in hooks guide.
@pi0 pi0 changed the title typo docs: fix typo Oct 18, 2024
@pi0 pi0 merged commit a6b10ae into unjs:main Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants