Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

implement this.fetch #203

Merged
merged 1 commit into from
Mar 19, 2018
Merged

implement this.fetch #203

merged 1 commit into from
Mar 19, 2018

Conversation

Rich-Harris
Copy link
Member

The second half of #178. With this PR, preload functions can use this.fetch to fetch resources. URLs are resolved against the local server, and if credentials is set to include or same-origin, cookies (including cookies that are about to be sent to the client) will be included.

On the client, this.fetch is just an alias for window.fetch.

I opted for this.fetch (rather than a) polluting the request object or b) introducing a second argument to preload) because it means that the preload context (which now includes fetch, store, error and redirect) is something that can easily be passed around (e.g. to a set of API helpers).

@Rich-Harris Rich-Harris merged commit e60714b into master Mar 19, 2018
@Rich-Harris Rich-Harris deleted the gh-178-fetch branch March 19, 2018 01:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant