Skip to content

Commit a764ee3

Browse files
authored
fix: Make signal in EventPublisherSubscribeIteratorOptions AbortSignal | undefined (#928)
If it isn't, while using the `signal` prop from the handler function, my typescript complains with `exactOptionalPropertyTypes` enabled: ``` Argument of type '{ signal: AbortSignal | undefined; }' is not assignable to parameter of type 'EventPublisherSubscribeIteratorOptions' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties. Types of property 'signal' are incompatible. Type 'AbortSignal | undefined' is not assignable to type 'AbortSignal'. Type 'undefined' is not assignable to type 'AbortSignal'. ``` Ref.: https://orpc.unnoq.com/docs/event-iterator#event-publisher <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Adjusted public API option to be more permissive with cancellation signals, aligning types with existing behavior. * No changes to runtime behavior or user-facing functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent b953b88 commit a764ee3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/shared/src/event-publisher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface EventPublisherSubscribeIteratorOptions extends EventPublisherOp
2121
/**
2222
* Aborts the async iterator. Throws if aborted before or during pulling.
2323
*/
24-
signal?: AbortSignal
24+
signal?: AbortSignal | undefined
2525
}
2626

2727
export class EventPublisher<T extends Record<PropertyKey, any>> {

0 commit comments

Comments
 (0)