use-streaming-state
v1.6.0
Published
Hook to read data from a streaming API
Downloads
2
Maintainers
Readme
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)
}
)