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

Custom event naming convention #1571

Closed
ismarslomic opened this issue Jun 1, 2014 · 3 comments
Closed

Custom event naming convention #1571

ismarslomic opened this issue Jun 1, 2014 · 3 comments

Comments

@ismarslomic
Copy link

What event naming conventions does socket.io project follow? I would like to reuse it for my custom events as well, in order to make the application.

@capaj
Copy link
Contributor

capaj commented Jun 1, 2014

this would be better suited for stack overflow. Internal events for socket.io are camel cased strings. I think you best use whatever style suits you best. I think it is better to use dashes and small case letters, because frankly in javascript everything is camel cased and it is always nice to be able to differentiate based on a formatting.

@ismarslomic
Copy link
Author

I have seen examples with 1) lower case and underscore and 2) camelcase, Altso,should I use present tense or past?

@rase-
Copy link
Contributor

rase- commented Jan 12, 2015

Here are a few internal event name examples:

  • close
  • packet
  • packetCreate
  • encoded

Like @capaj mentioned, it's really up to you how you want to name them. A pretty common way is to not do camel case, but add whitespace, such as new post.

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

No branches or pull requests

4 participants
@rase- @capaj @ismarslomic and others