File tree Expand file tree Collapse file tree 1 file changed +3
-20
lines changed
Expand file tree Collapse file tree 1 file changed +3
-20
lines changed Original file line number Diff line number Diff line change @@ -43,26 +43,9 @@ export default Coroutine.create(PokemonInfoPage);
4343```
4444
4545``` javascript
46- class MyComponent extends Coroutine {
47- async observe () {
48- try {
49- const users = await Users .retrieve ();
50- return { status: ' success' , users };
51- } catch (error) {
52- return { status: ' failure' , error };
53- }
54- }
55-
56- render () {
57- switch (this .state .data .status ) {
58- case ' success' :
59- return < UserList users= {this .state .data .users } / > ;
60- case ' failure' :
61- return < ErrorMessage error= {this .state .data .error } / > ;
62- default :
63- return < Loading / > ;
64- }
65- }
46+ function * MovieInfoLoader ({ movieId }) {
47+ const movieData = yield movieCache .read (movieId);
48+ return < MovieInfo data= {movieData} / > ;
6649}
6750```
6851
You can’t perform that action at this time.
0 commit comments