Skip to content

Commit

Permalink
chore(templates): use typeof check for requestIdleCallback (#4999)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcansh authored Jan 4, 2023
1 parent 27af5bf commit b438e52
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion integration/helpers/node-template/app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function hydrate() {
});
}

if (requestIdleCallback) {
if (typeof requestIdleCallback === "function") {
requestIdleCallback(hydrate);
} else {
// Safari doesn't support requestIdleCallback
Expand Down
2 changes: 1 addition & 1 deletion scripts/playground/template/app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const hydrate = () => {
});
};

if (requestIdleCallback) {
if (typeof requestIdleCallback === "function") {
requestIdleCallback(hydrate);
} else {
// Safari doesn't support requestIdleCallback
Expand Down
2 changes: 1 addition & 1 deletion templates/arc/app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function hydrate() {
});
}

if (requestIdleCallback) {
if (typeof requestIdleCallback === "function") {
requestIdleCallback(hydrate);
} else {
// Safari doesn't support requestIdleCallback
Expand Down
2 changes: 1 addition & 1 deletion templates/cloudflare-pages/app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function hydrate() {
});
}

if (requestIdleCallback) {
if (typeof requestIdleCallback === "function") {
requestIdleCallback(hydrate);
} else {
// Safari doesn't support requestIdleCallback
Expand Down
2 changes: 1 addition & 1 deletion templates/cloudflare-workers/app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function hydrate() {
});
}

if (requestIdleCallback) {
if (typeof requestIdleCallback === "function") {
requestIdleCallback(hydrate);
} else {
// Safari doesn't support requestIdleCallback
Expand Down
4 changes: 2 additions & 2 deletions templates/deno/app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ function hydrate() {
document,
<StrictMode>
<RemixBrowser />
</StrictMode>,
</StrictMode>
);
});
}

if (requestIdleCallback) {
if (typeof requestIdleCallback === "function") {
requestIdleCallback(hydrate);
} else {
// Safari doesn't support requestIdleCallback
Expand Down
2 changes: 1 addition & 1 deletion templates/express/app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function hydrate() {
});
}

if (requestIdleCallback) {
if (typeof requestIdleCallback === "function") {
requestIdleCallback(hydrate);
} else {
// Safari doesn't support requestIdleCallback
Expand Down
2 changes: 1 addition & 1 deletion templates/fly/app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function hydrate() {
});
}

if (requestIdleCallback) {
if (typeof requestIdleCallback === "function") {
requestIdleCallback(hydrate);
} else {
// Safari doesn't support requestIdleCallback
Expand Down
2 changes: 1 addition & 1 deletion templates/netlify/app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function hydrate() {
});
}

if (requestIdleCallback) {
if (typeof requestIdleCallback === "function") {
requestIdleCallback(hydrate);
} else {
// Safari doesn't support requestIdleCallback
Expand Down
2 changes: 1 addition & 1 deletion templates/remix/app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function hydrate() {
});
}

if (requestIdleCallback) {
if (typeof requestIdleCallback === "function") {
requestIdleCallback(hydrate);
} else {
// Safari doesn't support requestIdleCallback
Expand Down
2 changes: 1 addition & 1 deletion templates/vercel/app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function hydrate() {
});
}

if (requestIdleCallback) {
if (typeof requestIdleCallback === "function") {
requestIdleCallback(hydrate);
} else {
// Safari doesn't support requestIdleCallback
Expand Down

0 comments on commit b438e52

Please sign in to comment.