Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(templates): use typeof check for requestIdleCallback #4999

Merged
merged 1 commit into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore(templates): use typeof check for requestIdleCallback
  • Loading branch information
mcansh authored Jan 4, 2023
commit 6748b8507af95d0dca230c7026274ec72d893a49
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