Skip to content
React hook for fetching streams that can be aborted.
Branch: master
Clone or download
Latest commit d638f1f Mar 3, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore initial commit Mar 1, 2019
LICENSE Initial commit Mar 1, 2019
README.md
package-lock.json initial commit Mar 1, 2019
package.json updated build Mar 4, 2019
tsconfig.json

README.md

use-abortable-stream-fetch

React hook for fetching streams that can be aborted.

Installation

yarn add use-abortable-stream-fetch

Usage:

import React, { useEffect } from 'react';
import useAbortableStreamFetch from 'use-abortable-stream-fetch';

const Logs = () => {
  const url = '...';
  const { data, error, abort } = useAbortableStreamFetch(url);

  useEffect(() => {
    dispatch(actions.processData(data));
  }, [data]);

  return <div>{data}</div>;
};

export default Logs;
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.