Update CameraRoll examples to use promises

Summary:Update CameraRoll examples to use promises because callbacks are deprecated.
Closes https://github.com/facebook/react-native/pull/6681

Differential Revision: D3102981

fb-gh-sync-id: c37bc2e470b7cb2aa4a9b3b21d76ddeb9cf3b71c
fbshipit-source-id: c37bc2e470b7cb2aa4a9b3b21d76ddeb9cf3b71c
This commit is contained in:
Aleksei Androsov
2016-03-27 14:57:48 -07:00
committed by Facebook Github Bot 7
parent 0b22d09366
commit a7e5312aeb
2 changed files with 4 additions and 2 deletions

View File

@@ -148,7 +148,8 @@ var CameraRollView = React.createClass({
fetchParams.after = this.state.lastCursor;
}
CameraRoll.getPhotos(fetchParams, this._appendAssets, logError);
CameraRoll.getPhotos(fetchParams)
.then((data) => this._appendAssets(data), (e) => logError(e));
},
/**

View File

@@ -146,7 +146,8 @@ class FormUploader extends React.Component {
_fetchRandomPhoto() {
CameraRoll.getPhotos(
{first: PAGE_SIZE},
{first: PAGE_SIZE}
).then(
(data) => {
if (!this._isMounted) {
return;