MatthewWid / better-sse

⬆ Dead simple, dependency-less, spec-compliant server-sent events implementation for Node, written in TypeScript.
https://matthewwid.github.io/better-sse/
MIT License
558 stars 14 forks source link

Remix compatibility #78

Open the-dream-machine opened 2 weeks ago

the-dream-machine commented 2 weeks ago

How do I use this library with remix? Remix provides web standard objects rather than the native Node.js req and res objects. I can't figure out how to extract compatible Node.js http objects from this:

// api.stream.ts

export const loader = async ({ request, response }: LoaderFunctionArgs) => {
  const session = await createSession(request, response)

  return session.push('hello world')
}