prescottprue / react-redux-firebase

Redux bindings for Firebase. Includes React Hooks and Higher Order Components.
https://react-redux-firebase.com
MIT License
2.55k stars 559 forks source link

fix(types): fix file blob type for uploadFile and uploadFiles #950

Closed rscotten closed 4 years ago

rscotten commented 4 years ago

Description

This PR fixes a type issue in the PR #936 in which the uploadFile() function for file storage uploading was allowed to take a Blob type. Typing the file option to have File | Blob broke the type checking for the UploadFileOptions type definition, and my solution was to make the type generic with Conditional Types.

Check List

If not relevant to pull request, check off as complete

Relevant Issues

936

codecov[bot] commented 4 years ago

Codecov Report

Merging #950 into master will not change coverage. The diff coverage is 25.00%.

@@           Coverage Diff           @@
##           master     #950   +/-   ##
=======================================
  Coverage   88.33%   88.33%           
=======================================
  Files          29       29           
  Lines         797      797           
=======================================
  Hits          704      704           
  Misses         93       93           
prescottprue commented 4 years ago

Thanks for getting this in so quickly!