use-streaming-state

1.6.0 • Public • Published

useStreamingState

How to use

  1. yarn add -D use-streaming-state
import { useStreamingState } from 'use-streaming-state'

useStreamingState(
    {
        reqInfo: 'http://localhost:8080',
        reqInit: {
            method: 'POST',
            body: new FormData()
        },
        streamBuffer: true,
        dataSeparator: '\\n'
    },
    (state) => {
        console.log('incoming data from streaming', state)
    }
)

Package Sidebar

Install

npm i use-streaming-state

Weekly Downloads

6

Version

1.6.0

License

MIT

Unpacked Size

7.03 kB

Total Files

11

Last publish

Collaborators

  • miguelteixeira