import { Context } from "https://deno.land/x/oak_nest@v2.0.0/deps.ts";
Convert the connection to stream events, returning an event target for
sending server sent events. Events dispatched on the returned target will
be sent to the client and be available in the client's EventSource
that
initiated the connection.
Note the body needs to be returned to the client to be able to dispatch events, so dispatching events within the middleware will delay sending the body back to the client.
This will set the response body and update response headers to support sending SSE events. Additional middleware should not modify the body.