Skip to content

Commit

Permalink
Merge branch 'merge' into bricks
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed Mar 27, 2024
2 parents 96fb7a2 + dc05218 commit 1556bec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/hub.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function parseHeaders(rawHeaders) {
* @param {RequestInit} [options]
* @returns {Promise<Response>}
*/
export function fetchBinary(url, options = {}) {
function fetchBinaryImpl(url, options = {}) {
return new Promise((resolve, reject) => {
const request = new Request(url, options);
const xhr = new XMLHttpRequest();
Expand Down Expand Up @@ -270,6 +270,8 @@ export function fetchBinary(url, options = {}) {
});
}

export const fetchBinary = IS_REACT_NATIVE ? fetchBinaryImpl : fetch;

/**
* Determines whether the given string is a valid URL.
* @param {string|URL} string The string to test for validity as an URL.
Expand Down

0 comments on commit 1556bec

Please sign in to comment.