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

[file-system] Fix return type of getContentUriAsync #7192

Merged

Conversation

lukmccall
Copy link
Contributor

@lukmccall lukmccall commented Feb 26, 2020

Why

Resolves #6904.

TODO

  • update changelog

How

getContentUriAsync returns string - not object.

Test Plan

  • ts compile ✅
  • code like this works:
FileSystem.downloadAsync(
      'http://techslides.com/demos/sample-videos/small.mp4',
      FileSystem.documentDirectory + 'small.mp4'
    ).then(({ uri }) => {
      FileSystem.getContentUriAsync(uri).then(cUri => {
        console.log(cUri); 
      });
    });

Copy link
Contributor

@bbarthec bbarthec left a comment

Choose a reason for hiding this comment

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

I'm against creating types/interfaces with only one property.
Moreover (regarding to docs and common programming sense) function getContentUriAsync should return only contentUri (string).

@lukmccall lukmccall force-pushed the @lukmccall/expo-file-system-get-content-uri-change-type branch from fa241ad to 1a23138 Compare February 26, 2020 14:37
@ExpoBot
Copy link

ExpoBot commented Feb 26, 2020

Warnings
⚠️

You modified sdk/filesystem.md in the unversioned directory. Please consider copying the changes to the latest released version if applicable.

Generated by 🚫 dangerJS against 4edbfeb

Copy link
Contributor

@bbarthec bbarthec left a comment

Choose a reason for hiding this comment

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

CHANGELOG entry and ready to be shipped 🎉

@lukmccall lukmccall force-pushed the @lukmccall/expo-file-system-get-content-uri-change-type branch from 1a23138 to fa3ca70 Compare March 5, 2020 12:16
@lukmccall lukmccall force-pushed the @lukmccall/expo-file-system-get-content-uri-change-type branch from fa3ca70 to 4edbfeb Compare March 5, 2020 12:19
@lukmccall lukmccall merged commit 439d1ed into master Mar 5, 2020
@lukmccall lukmccall deleted the @lukmccall/expo-file-system-get-content-uri-change-type branch March 5, 2020 15:00
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.

[docs] Typescript issue with FileSystem.getContentUriAsync
3 participants