react-stream-event-any
0.0.22 • Public • Published
bun a react-stream-event-any
npm i react-stream-event-any
yarn add react-stream-event-any
pnpm add react-stream-event-any
import ServerStreamEvent from "react-stream-event-any"
type StreamData = string
const response = ServerStreamEvent<StreamData>({
url: `${ApiEndpoint}/ai/chat/completions/${id}`,
method: "POST",
header: {
"Content-Type": "application/json"
},
body: JSON.stringify(data)
})
for await (const data of response){
console.log(data) // type StreamData
}
Readme
Keywords
nonePackage Sidebar
Install
npm i react-stream-event-any
Weekly Downloads