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

Allowing complete control of the axios instance at the request level (so we can use any axios feature) #62

Merged
merged 13 commits into from
Feb 26, 2019

Conversation

Amit-A
Copy link
Collaborator

@Amit-A Amit-A commented Feb 20, 2019

A few updates, no breaking changes:

  • Addingaxios and axiosOverride config arguments that allow complete control of the axios instance at the request level so we can use any axios feature (including the timeouts in timeout arg for file actions #49 )
  • (cleanup) Standardizing instance function arguments to function(b2, args) while retaining backwards compatibility - necessary for addingaxios and axiosOverride args.
  • (cleanup) Moving API endpoint generation into one file - endpoints.js
  • Improved documentation (Improve README and Documentation #1 )

Amit-A and others added 13 commits February 11, 2019 20:24
Retries 3 times by default, and only on network errors and 5xx errors on indempotent requests (GET, HEAD, OPTIONS, PUT, or DELETE).
Update comments
Also added lodash which will be necessary for the next commit (using lodash merge). This won't add overhead since it looks like lodash is already in use indirectly by a dependency (I see it in the package-lock.json file)
this allows users to control axios arguments at the action/request level (e.g. specify timeouts)
@odensc
Copy link
Collaborator

odensc commented Feb 20, 2019

To be honest I'd rather just release a major version with the breaking change than have all this cruft in the code to deal with backwards compatibility. But I'll defer to the others opinions on that.

@Amit-A
Copy link
Collaborator Author

Amit-A commented Feb 20, 2019

@odensc I agree that it'll look cleaner without the backwards compatibility, but I'd wait on a few other potentially breaking changes before releasing the next major update: rewriting b2.js with an ES6 class and (if possible) removing of the .authorize() call and managing that automatically/internally as requested in #56

Copy link
Owner

@yakovkhalinsky yakovkhalinsky left a comment

Choose a reason for hiding this comment

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

Great to see an update to the README 👍

@Amit-A Amit-A merged commit 56f6a87 into yakovkhalinsky:master Feb 26, 2019
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.

None yet

4 participants