File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,15 @@ class App extends Component {
2929 < ReadGist gistId = "a6396779d28ed91eb1a55d54a5d228c9" >
3030 { stuff => {
3131 console . log ( 'the stuff' , stuff ) ;
32- return < div > Got it</ div > ;
32+ const { status } = stuff ;
33+
34+ return (
35+ < div >
36+ { status . pending && < div > Loading...</ div > }
37+ { status . error && < div > Here is an error</ div > }
38+ { status . succeeded && < div > Got it!</ div > }
39+ </ div >
40+ ) ;
3341 } }
3442 </ ReadGist >
3543 ) }
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import { Resource , Fetch } from 'react-redux-resource' ;
2+ import { ResourceRequest , Fetch } from 'react-redux-resource' ;
33import headers from '../utils/headers' ;
44
55export function ReadGist ( { gistId, children } ) {
@@ -8,7 +8,8 @@ export function ReadGist({ gistId, children }) {
88 ) ;
99
1010 return (
11- < Resource
11+ < ResourceRequest
12+ treatNullAsPending
1213 transformData = { gist => [ gist ] }
1314 resourceName = "gists"
1415 request = { ReadGistRequest }
You can’t perform that action at this time.
0 commit comments