Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { useState } from 'react';
- import { withAsync } from '@sullivan/use-async';
- const PageFetch = ({ loading, data, error, dispatch }) => (
- <div>
- <button enabled={!loading} onClick={dispatch}>Request Page</button>
- <pre>{JSON.stringify({ loading, data, error })}</pre>
- </div>
- );
- export default withAsync(fetch, '')(PageFetch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement