Skip to content

chore: reuse fetch method #97

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

Merged
merged 2 commits into from
Apr 22, 2025
Merged

chore: reuse fetch method #97

merged 2 commits into from
Apr 22, 2025

Conversation

43081j
Copy link
Contributor

@43081j 43081j commented Apr 18, 2025

By creating the fetch function in the constructor, we allocate a new function every time the mocker is instantiated.

We can avoid this by using a field (to bind this) which itself delegates to a method on the prototype.

Copy link

netlify bot commented Apr 18, 2025

Deploy Preview for mentoss canceled.

Name Link
🔨 Latest commit a66debc
🔍 Latest deploy log https://app.netlify.com/sites/mentoss/deploys/680672af6dfdf30008ce084f

@nzakas
Copy link
Contributor

nzakas commented Apr 21, 2025

This is a good idea! Can you take a look at the merge conflict?

43081j added 2 commits April 21, 2025 17:29
By creating the fetch function in the constructor, we allocate a new
function every time the mocker is instantiated.

We can avoid this by using a field (to bind `this`) which itself
delegates to a method on the prototype.
@43081j
Copy link
Contributor Author

43081j commented Apr 21, 2025

i sorted the conflicts, but running the formatter showed we missed some in main

if you want me to split those into their own PR, let me know

Copy link
Contributor

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. I'll need to check why the formatting isn't running on precommit for me.

@nzakas nzakas merged commit e36595b into humanwhocodes:main Apr 22, 2025
16 checks passed
@43081j 43081j deleted the fetch-mem branch April 22, 2025 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants