Skip to content

Commit

Permalink
chore: ensure AbortController installed globally (#4391)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-ebey authored and kentcdodds committed Dec 15, 2022
1 parent 2df8381 commit 28dcb62
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/remix-node/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
ReadableStream as NodeReadableStream,
WritableStream as NodeWritableStream,
} from "@remix-run/web-stream";
import { AbortController as NodeAbortController } from "abort-controller";

import { atob, btoa } from "./base64";
import {
Expand Down Expand Up @@ -35,6 +36,8 @@ declare global {

ReadableStream: typeof ReadableStream;
WritableStream: typeof WritableStream;

AbortController: typeof AbortController;
}
}
}
Expand All @@ -54,4 +57,6 @@ export function installGlobals() {

global.ReadableStream = NodeReadableStream;
global.WritableStream = NodeWritableStream;

global.AbortController = global.AbortController || NodeAbortController;
}

0 comments on commit 28dcb62

Please sign in to comment.