Skip to content

Commit

Permalink
use cross-platform fetch function
Browse files Browse the repository at this point in the history
  • Loading branch information
sashankaryal committed Nov 29, 2022
1 parent d043173 commit c9dcf4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions app/packages/looker/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from "./state";

import LookerWorker from "./worker.ts?worker&inline";
import { getFetchParameters } from "@fiftyone/utilities";
import { getFetchFunction, getFetchParameters } from "@fiftyone/utilities";

/**
* Shallow data-object comparison for equality
Expand Down Expand Up @@ -521,7 +521,6 @@ export const isFloatArray = (arr) =>
arr instanceof Float32Array || arr instanceof Float64Array;

export const getArrayBufferFromUrl = async (url: string) => {
const data = await fetch(url);
const arrayBuffer = await data.arrayBuffer();
return arrayBuffer;
const data = await getFetchFunction()("GET", url, null, "arrayBuffer");
return data;
};
2 changes: 1 addition & 1 deletion app/packages/utilities/src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface FetchFunction {
method: string,
path: string,
body?: A,
result?: "json" | "blob"
result?: "json" | "blob" | "arrayBuffer"
): Promise<R>;
}

Expand Down

0 comments on commit c9dcf4c

Please sign in to comment.