Skip to content

Commit

Permalink
Flow type: saveToCameraRoll returns a string
Browse files Browse the repository at this point in the history
Summary:
Updates the flow typing to return Promise\<string\> instead of Promise\<Object\>. To validate that it actually does return a string, see https://github.com/facebook/react-native/blob/6493a857542c0985470311511c1be80982fcd474/Libraries/CameraRoll/RCTCameraRollManager.m#L98 and https://github.com/facebook/react-native/blob/6493a857542c0985470311511c1be80982fcd474/Libraries/CameraRoll/RCTCameraRollManager.m#L116
Closes facebook/react-native#15631

Differential Revision: D5714842

Pulled By: shergin

fbshipit-source-id: fb141b014c262bc4fb44419515e56bbe0641d8bf
  • Loading branch information
maartenschumacher authored and facebook-github-bot committed Sep 12, 2017
1 parent de6f8a6 commit fb3c8d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CameraRoll.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class CameraRoll {
/**
* `CameraRoll.saveImageWithTag()` is deprecated. Use `CameraRoll.saveToCameraRoll()` instead.
*/
static saveImageWithTag(tag: string): Promise<Object> {
static saveImageWithTag(tag: string): Promise<string> {
console.warn(
'`CameraRoll.saveImageWithTag()` is deprecated. Use `CameraRoll.saveToCameraRoll()` instead.',
);
Expand All @@ -150,7 +150,7 @@ class CameraRoll {
static saveToCameraRoll(
tag: string,
type?: 'photo' | 'video',
): Promise<Object> {
): Promise<string> {
invariant(
typeof tag === 'string',
'CameraRoll.saveToCameraRoll must be a valid string.',
Expand Down

0 comments on commit fb3c8d0

Please sign in to comment.