1.6.0 • Published 2 years ago

use-streaming-state v1.6.0

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

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)
    }
)