Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

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

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

Adds a one-time listener function for the event. The next time the event is triggered, this listener is removed and then invoked.

Type Parameters

Event extends keyof EventTypes

Parameters

event: Event
listener: EventListener<EventTypes, Event>

Returns

this

this ChatCompletionStream, so that calls can be chained