SocketCluster / SocketCluster/socketcluster-client

socket.constructor.name returns `Emitter`

Open
#33 0 comments 0 reactions 1 assignee View on GitHub

@jondubois is already working on this.

Since May 16, 2018.

Dominant language
JavaScript
Stars
300
Forks
90
PR merge metrics
No merged PRs in 30d

Description

Object.create doesn't assign anything to the prototype. There are 2 workarounds for this:
Option 1 use new (technically, this is faster since V8 optimizes for it, but used so infrequently it really doesn't matter)
Option 2 SCSocket.prototype.constructor = SCSocket + don't use anonymous function for creators (eg var SCSocket = function SCSocket(...`

use case:
user passes in either a socket or a channel into a function. If socket do x, if channel, do y.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.