-
Notifications
You must be signed in to change notification settings - Fork 640
storage: add promise support #1697
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
storage: add promise support #1697
Conversation
| // Promises are also supported by omitting callbacks. | ||
| bucket.upload('/photos/zoo/zebra.jpg').then(function(data) { | ||
| var file = data[0]; | ||
| }); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| var file = data[0]; | ||
| }); | ||
|
|
||
| // It's also possible to integrate with third-party Promise libraries. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Breaking changes ahead!⚠️
Summary of changes
The following methods previously returned a
streamin the event that thecallbackparameter was omitted. This functionality has since moved to a different method entirely.Storage#getBuckets->Storage#getBucketsStreamBucket#getFiles->Bucket#getFilesStreamEach callback accepting change has also been updated to return a
Promiseinstance in the event that thecallbackwas omitted.