mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 11:57:46 +08:00
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:
committed by
Facebook Github Bot 7
parent
0b22d09366
commit
a7e5312aeb
@@ -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));
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -146,7 +146,8 @@ class FormUploader extends React.Component {
|
||||
|
||||
_fetchRandomPhoto() {
|
||||
CameraRoll.getPhotos(
|
||||
{first: PAGE_SIZE},
|
||||
{first: PAGE_SIZE}
|
||||
).then(
|
||||
(data) => {
|
||||
if (!this._isMounted) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user