-
Notifications
You must be signed in to change notification settings - Fork 85
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
Client should list all the methods available #834
Comments
This is not the object you expect, but meanwhile
|
Hey @mdubus, after some digging the problem comes from here: Class behavior on logclass Rectangle {
constructor(height, width) {
this.height = height;
this.width = width;
}
square () {
return this.height + this.width
}
}
console.log(classRec) output Rectangle { height: 1, width: 2 } Factory Function behavior on logconst rec = (height, width) => ({
height,
width,
square: function() { return this.height * 2 }, // function and not => not keep context
square2: () => { return this.height * 2 } // function and not => not keep context
})
const classRec = new Rectangle(1, 2)
const functRec = rec (1, 2)
console.log(functRec) output {
height: 1,
width: 2,
square: [Function: square],
square2: [Function: square2]
} I'm trying to find out why, I would think per intuition that it is linked to private and public functions as we might not want the user to know them? In either case, we will have to change our classes to functions if we want your output (which I think is way better for users trying to find methods name without having to go to the documentation) see #835 |
Until we go for a factory function this is not possible. Because factory function is not planned as a refactor I close this issue |
By logging my client, I only see the
config
andhttpRequest
.This is really confusing as we might think that there are no methods available :
If possible, it would be nice to have an exhaustive object with all the methods available inside
The text was updated successfully, but these errors were encountered: