Skip to content

marconi/use-abortable-stream-fetch

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

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;

About

React hook for fetching streams that can be aborted.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published