Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/openai/lib/EventStream.ts>EventStream#off

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
method EventStream.prototype.off
import { EventStream } from "https://deno.land/x/openai@v4.59.0/lib/EventStream.ts";

Removes the specified listener from the listener array for the event. off() will remove, at most, one instance of a listener from the listener array. If any single listener has been added multiple times to the listener array for the specified event, then off() must be called multiple times to remove each instance.

Type Parameters

Event extends keyof EventTypes

Parameters

event: Event
listener: EventListener<EventTypes, Event>

Returns

this

this ChatCompletionStream, so that calls can be chained