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

Expose HTTPStateSource methods #350

Open
KeKs0r opened this issue Jun 23, 2015 · 3 comments
Open

Expose HTTPStateSource methods #350

KeKs0r opened this issue Jun 23, 2015 · 3 comments

Comments

@KeKs0r
Copy link

KeKs0r commented Jun 23, 2015

Hi,

I am currently implementing some funcionality for file uploads on top of the HTTP Source. I need to use xhr for getting the progress for the upload.

I wanted to add a functionality that uses xhr instead of fetch, but is still able to use my hooks. Since most of them only set headers anyways this should not be very complicated. The issue I ran into, is that most of the hook and also options manipulation (e.g. for basePath) are not accessible. How would you feel about manually invoking beforeReq, afterReq and getRequestOptions?

@taion
Copy link
Member

taion commented Jul 16, 2015

If we were to do this, I'd probably just pull out an overrideable HttpStateSource#fetch method to let you override the fetch call.

@KeKs0r
Copy link
Author

KeKs0r commented Jul 17, 2015

That would be fine with me as well. Although I am not 100% sure I could modify fetch in a way that it would work, but it is worth an approach. I don't like the usage of native fetch in general, so being able to overwrite it would be an added bonus for every other use case as well 👍

@taion
Copy link
Member

taion commented Jul 21, 2015

Well, you'd control all the other things passed in, so you could hook into whatever behavior you wanted.

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

No branches or pull requests

2 participants