Skip to content

Commit a7e5312

Browse files
doochikFacebook Github Bot 7
authored and
Facebook Github Bot 7
committed
Update CameraRoll examples to use promises
Summary:Update CameraRoll examples to use promises because callbacks are deprecated. Closes facebook#6681 Differential Revision: D3102981 fb-gh-sync-id: c37bc2e470b7cb2aa4a9b3b21d76ddeb9cf3b71c fbshipit-source-id: c37bc2e470b7cb2aa4a9b3b21d76ddeb9cf3b71c
1 parent 0b22d09 commit a7e5312

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Examples/UIExplorer/CameraRollView.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ var CameraRollView = React.createClass({
148148
fetchParams.after = this.state.lastCursor;
149149
}
150150

151-
CameraRoll.getPhotos(fetchParams, this._appendAssets, logError);
151+
CameraRoll.getPhotos(fetchParams)
152+
.then((data) => this._appendAssets(data), (e) => logError(e));
152153
},
153154

154155
/**

Examples/UIExplorer/XHRExample.ios.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ class FormUploader extends React.Component {
146146

147147
_fetchRandomPhoto() {
148148
CameraRoll.getPhotos(
149-
{first: PAGE_SIZE},
149+
{first: PAGE_SIZE}
150+
).then(
150151
(data) => {
151152
if (!this._isMounted) {
152153
return;

0 commit comments

Comments
 (0)