Skip to content

Conversation

@mahorabhossainmidul
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

@mahorabhossainmidul
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.

@mahorabhossainmidul
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