Open coderschoolreview opened 7 years ago
Thanks for your advices. I have just finished updating source code.
I am looking forward to hearing from you. Thanks and best regards, Le Van Ninh
2017-03-20 14:02 GMT+07:00 coderschoolreview notifications@github.com:
Thanks for submitting @gitvani https://github.com/gitvani, You still need to complete two more required feature before 6pm today :)
- RefreshControl, you can find the example here RefreshControl http://facebook.github.io/react-native/releases/0.42/docs/refreshcontrol.html#refreshcontrol
- Message network error, just check when you fetch data.
Don't hesitate to ask on #questions-rn channel if you have ay questions. Note that the Assignment tab includes hints for optional features too if you want to push yourself further. A few classmates have tried them.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gitvani/Cinema/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AKd1Nfswo7qyYDFUdpqvt0LAHBWaJCDjks5rniRsgaJpZM4MiFRY .
Hi Ninh,
Nice job with your assignment! 😉
The goal of this assignment to get to know how basic components in React native works.
Good point:
react-native-tab-view
to manage tabs bar and scenes. That's cool.Improvements:
Thinking about using await
rather than Promise
to make your code cleaner.
With Promise:
getMoviesFromApiAsync(page) {
let type = this.props.type;
let url = '';
if (type == 'NOW_PLAYING') {
url = 'https://api.themoviedb.org/3/movie/now_playing?api_key=a07e22bc18f5cb106bfe4cc1f83ad8ed&page=' + page;
} else {
url = 'https://api.themoviedb.org/3/movie/top_rated?api_key=a07e22bc18f5cb106bfe4cc1f83ad8ed&page=' + page;
}
return fetch(url)
.then((response) => response.json())
.then((responseJson) => {
return responseJson.results;
})
.catch((error) => {
// console.error(error);
alert("Can not connect internet");
return [];
});
}
With Await:
async getMoviesFromApiAsync(page) {
let type = this.props.type;
let url = '';
if (type == 'NOW_PLAYING') {
url = 'https://api.themoviedb.org/3/movie/now_playing?api_key=a07e22bc18f5cb106bfe4cc1f83ad8ed&page=' + page;
} else {
url = 'https://api.themoviedb.org/3/movie/top_rated?api_key=a07e22bc18f5cb106bfe4cc1f83ad8ed&page=' + page;
}
try {
const response = await fetch(url);
const responseJson = await response.json();
return responseJson.results;
} catch (error) {
return [];
}
}
Could you please tell us what obstacles why doing this assignment or which one you want to know more to build a mobile app?
Hi Coderschool, Thanks for your reviews. One of obstacles is Navigator. I take make a lot of time to implement it.
I am looking forward to hearing from you. Thanks and best regards, Le Van Ninh
2017-03-26 12:31 GMT+07:00 coderschoolreview notifications@github.com:
Hi Ninh,
Nice job with your assignment! 😉
The goal of this assignment to get to know how basic components in React native works.
Good point:
- You use react-native-tab-view to manage tabs bar and scenes. That's cool.
- Nice try with LayoutAnimation to animate the movie detail.
Improvements:
- Thinking about using await rather than Promise to make your code cleaner. With Promise:
getMoviesFromApiAsync(page) { let type = this.props.type; let url = ''; if (type == 'NOW_PLAYING') { url = 'https://api.themoviedb.org/3/movie/now_playing?api_key=a07e22bc18f5cb106bfe4cc1f83ad8ed&page=' + page; } else { url = 'https://api.themoviedb.org/3/movie/top_rated?api_key=a07e22bc18f5cb106bfe4cc1f83ad8ed&page=' + page; } return fetch(url) .then((response) => response.json()) .then((responseJson) => { return responseJson.results;
}) .catch((error) => { // console.error(error); alert("Can not connect internet"); return []; }); }
With Await:
async getMoviesFromApiAsync(page) { let type = this.props.type; let url = ''; if (type == 'NOW_PLAYING') { url = 'https://api.themoviedb.org/3/movie/now_playing?api_key=a07e22bc18f5cb106bfe4cc1f83ad8ed&page=' + page; } else { url = 'https://api.themoviedb.org/3/movie/top_rated?api_key=a07e22bc18f5cb106bfe4cc1f83ad8ed&page=' + page; } try { const response = await fetch(url); const responseJson = await response.json(); return responseJson.results; } catch (error) { return []; } }
Could you please tell us what obstacles why doing this assignment or which one you want to know more to build a mobile app?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gitvani/Cinema/issues/1#issuecomment-289259758, or mute the thread https://github.com/notifications/unsubscribe-auth/AKd1Nc0efThYmGwbCMMVnUZsmfmwQCDjks5rpfgtgaJpZM4MiFRY .
Thanks for submitting @gitvani, You still need to complete two more required feature before 6pm today :)
Don't hesitate to ask on #questions-rn channel if you have ay questions. Note that the Assignment tab includes hints for optional features too if you want to push yourself further. A few classmates have tried them.