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

Rename _make to pushStack #1665

Closed
fb55 opened this issue Jan 9, 2021 · 4 comments
Closed

Rename _make to pushStack #1665

fb55 opened this issue Jan 9, 2021 · 4 comments

Comments

@fb55
Copy link
Member

fb55 commented Jan 9, 2021

The internal method _make is equivalent to jQuery's pushStack. Let's rename it, to make it an official API.

Uncovered in #1656.

@fb55 fb55 mentioned this issue Jan 9, 2021
@5saviahv
Copy link
Contributor

5saviahv commented Jan 9, 2021

It would be nice, it is internal in jQuery also, but this way you have at least more information sources available.

@5saviahv
Copy link
Contributor

Interesting why _make wont call directly

new Cheerio(...)

@5saviahv
Copy link
Contributor

in jQuery methods can call for constructor either jQuery(...) or jQuery.pushStack(...). When first one simply creates new jQuery instance. Second one creates new instance and pushes current object into prevObject.

in Cheerio calling _make is basically only way to get access to constructor. I think this way prevObject isnt always previous object.

@fb55
Copy link
Member Author

fb55 commented May 1, 2022

I decided against doing this, as the semantics don't quite line up.

@fb55 fb55 closed this as completed May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants