Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. import React, { useState } from 'react';
  2. import { withAsync } from '@sullivan/use-async';
  3.  
  4. const PageFetch = ({ loading, data, error, dispatch }) => (
  5. <div>
  6. <button enabled={!loading} onClick={dispatch}>Request Page</button>
  7. <pre>{JSON.stringify({ loading, data, error })}</pre>
  8. </div>
  9. );
  10.  
  11. export default withAsync(fetch, '')(PageFetch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement