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

feat: add fetch imp as third param in custom fetch #21

Merged
merged 1 commit into from
May 7, 2024

Conversation

bill-min
Copy link
Contributor

@bill-min bill-min commented Apr 18, 2024

Description

Motivation and Context

Screenshots (if appropriate):

Checklist:

  • I have updated/added documentation affected by my changes.
  • I have added tests to cover my changes.

}),
fetch: config.fetch
? (...params: Parameters<typeof fetch>) => config.fetch!(...params, fetch)
: async (url, options) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@bill-min I think it'd be nice if the fetch passed into the override was the same as the one which is used by default (the async function below) so that it automatically resolves against the current origin, copies headers, etc. On the micro-frame side we're doing similar and just hoist up the common stuff https://github.com/marko-js/micro-frame/blob/main/src/node_modules/%40internal/micro-frame-component/node.marko#L10

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree, just pushed another commit.

@bill-min bill-min requested a review from DylanPiercey April 18, 2024 23:00
@bill-min bill-min force-pushed the feat-fetch-imp-as-param branch from 3678b73 to c2ec8e1 Compare May 2, 2024 22:29
@DylanPiercey DylanPiercey merged commit 003c769 into marko-js:main May 7, 2024
3 checks passed
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