1.1.8 • Published 2 years ago

react-event-stream v1.1.8

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

react-event-stream is custom a React Hook that wraps built-in EventSource object.

npm CodeFactor npm bundle size NPM npm JavaScript Style Guide

react-event-stream simplifies to use Server Sent Events with built-in EventSource in your react application.

More information about server-sent-events.

🕺 Install

react-event-stream uses rxjs as peerDependency, so you have to install rxjs with react-event-stream.

by using npm:

$ npm i react-event-stream rxjs

by using yarn:

$ yarn add react-event-stream rxjs

Usage

import React from 'react'
import useEventStream from 'react-event-stream';

const Example = () => {
    const value = useEventStream('http://localhost:8080/sse', 1000);

    return (
        <>
            {JSON.stringify(value)};
        </>
    );
};

export default Example;

Made with

License

MIT © enesusta

1.1.1

2 years ago

1.0.2

2 years ago

1.1.0

2 years ago

1.1.8

2 years ago

1.0.9

2 years ago

1.1.7

2 years ago

1.0.8

2 years ago

1.1.6

2 years ago

1.0.7

2 years ago

1.1.5

2 years ago

1.0.6

2 years ago

1.1.4

2 years ago

1.0.5

2 years ago

1.1.2

2 years ago

1.0.4-rc

2 years ago

1.0.1

4 years ago

1.0.0

4 years ago