Skip to content

Cleanup and modernize S3Adapter to ES6 syntax. #333

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

Merged
merged 1 commit into from
Feb 10, 2016
Merged

Conversation

nlutsenko
Copy link
Contributor

This also allows usage of S3Adapter instead of new GridStoreAdapter, since both conform to the same interface.

// Creates an S3 session.
// Providing AWS access and secret keys is mandatory
// Region and bucket will use sane defaults if omitted
constructor(accessKey, secretKey, options = {}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

With ES6 we can use destructuring assignment in arguments

constructor(accessKey, secretKey, {
  region = DEFAULT_S3_REGION,
  bucket = DEFAULT_S3_BUCKET,
  ...options
} = {}) {
  this._region = region;
  //etc.
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! Completely forgot about the awesomeness of that feature!

@drew-gross
Copy link
Contributor

Some minor nits, feel free to merge anyone after rebasing.

@nlutsenko nlutsenko assigned nlutsenko and unassigned gfosco Feb 10, 2016
@facebook-github-bot
Copy link

@nlutsenko updated the pull request.

nlutsenko added a commit that referenced this pull request Feb 10, 2016
Cleanup and modernize S3Adapter to ES6 syntax.
@nlutsenko nlutsenko merged commit 29d70a6 into master Feb 10, 2016
@nlutsenko nlutsenko deleted the nlutsenko.files.s3 branch February 10, 2016 06:46
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.

4 participants