({ userId })
| 27 | ) |
| 28 | |
| 29 | const User = ({ userId }) => { |
| 30 | const state = useAsync({ promiseFn: loadUser, debugLabel: `User ${userId}`, userId }) |
| 31 | return ( |
| 32 | <> |
| 33 | <IfPending state={state}> |
| 34 | <UserPlaceholder /> |
| 35 | </IfPending> |
| 36 | <IfFulfilled state={state}>{data => <UserDetails data={data} />}</IfFulfilled> |
| 37 | <IfRejected state={state}>{error => <p>{error.message}</p>}</IfRejected> |
| 38 | </> |
| 39 | ) |
| 40 | } |
| 41 | |
| 42 | export const App = () => ( |
| 43 | <> |
nothing calls this directly
no test coverage detected