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

Add defaults method like request.defaults #163

Open
gsf opened this issue Apr 8, 2017 · 5 comments
Open

Add defaults method like request.defaults #163

gsf opened this issue Apr 8, 2017 · 5 comments
Milestone

Comments

@gsf
Copy link
Collaborator

gsf commented Apr 8, 2017

The defaults method in the request library is useful for creating a new request function​ with some options already set. It can also take a requester function, which is a lightweight way to extend functionality. The requester is undocumented but is at this point not much code to implement and could be an interesting refactor for xhr.

@gsf gsf added the enhancement label Apr 8, 2017
@gsf gsf added this to the v3.0 milestone Apr 8, 2017
@naugtur
Copy link
Owner

naugtur commented Apr 12, 2017

@jmeas Apart from opinions which are always welcome, would you mind sharing if this form of extending xhr fulfills your needs (the ones originally leading to your PR with qs) ?

@jamesplease
Copy link
Collaborator

I think it would fulfill my needs, @naugtur . If we added this, we could revert the other API, with the added benefit of being more consistent with request.

@naugtur
Copy link
Owner

naugtur commented Apr 15, 2017

My point exactly.
If you guys want to PR this I won't get in your way.
Let me know.
I'll be able to dig in after Easter if you don't want.

BTW. I'm looking for someone to share npm publishing access too.

@jamesplease
Copy link
Collaborator

@naugtur , I've got it on my to do list to dig more into this library. I'm going to work on those integration tests first, I think. Time permitting, I'd be happy to help out with more, too.

@gsf
Copy link
Collaborator Author

gsf commented Apr 17, 2017

I may have time this week to implement but I can't make that promise. If you get to it first, @naugtur, I'd be happy to review.

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

3 participants