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

Fixed some example codes #1564

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

jasonmidul
Copy link

HI, this pool have nothing special , i just fix some example codes.

@coolcalcacol
Copy link
Contributor

Eris is a class, so should be called with newas with the original examples

@jasonmidul
Copy link
Author

https://github.com/abalabahaha/eris/blob/dev/index.js#L5 Here you can Eris is a function that returns new Client class.

@babiabeo
Copy link
Contributor

According to MDN:

  1. If the constructor function returns a non-primitive, this return value becomes the result of the whole new expression.

So if I understand correctly, the Eris() function returns a class which is a non-primitive. It means that both Eris() and new Eris() return the same result.

@jasonmidul
Copy link
Author

Yes you are right. Actually when I was using typescript I got a type error so I replaced new Eris with Eris.

@bsian03
Copy link
Collaborator

bsian03 commented Oct 21, 2024

I'd argue that if you're using typescript, you're already familiar with what to do and not to do. That being said this technically is a minor bug, but I have my reservations (aside from the point I just made) with this being the solution. I'll loop back to it once the API facing features are sorted out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants