1.6.0 • Published 2 years ago
use-streaming-state v1.6.0
useStreamingState
How to use
- 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)
}
)