-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hi,
I would like to use your abstract class from
https://github.com/starfederation/datastar-typescript/blob/main/src/abstractServerSentEventGenerator.ts
for my package https://www.npmjs.com/package/nestjs-datastar
Unfortunately, this is not possible because the send() method has a hard-coded return type of string[].
Could you please update the abstract class slightly by using generics, like this:
// ...
export abstract class ServerSentEventGenerator<T = string[]> {
// ...
protected send(
event: EventType,
dataLines: string[],
options: DatastarEventOptions,
): T {
This way, the return type of the send() method would be flexible.
Metadata
Metadata
Assignees
Labels
No labels