Skip to content

Commit

Permalink
Specify that we expect a CustomEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
sstephenson committed Dec 20, 2020
1 parent 1a59ad7 commit 24f2d4c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/observers/stream_observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ export class StreamObserver {
return this.sources.has(source)
}

prepareFetchRequest = (event: Event) => {
const fetchOptions: FetchRequestOptions = (event as any).detail?.fetchOptions
prepareFetchRequest = <EventListener>((event: CustomEvent) => {
const fetchOptions: FetchRequestOptions = event.detail?.fetchOptions
if (fetchOptions) {
const { headers } = fetchOptions
headers.Accept = [ StreamMessage.contentType, headers.Accept ].join(", ")
}
}
})

inspectFetchResponse = (event: Event) => {
const fetchResponse = fetchResponseFromEvent(event)
Expand Down

0 comments on commit 24f2d4c

Please sign in to comment.