Skip to content

Instantly share code, notes, and snippets.

View AliRazaviDeveloper's full-sized avatar
🎯
Focusing

AliRazavi AliRazaviDeveloper

🎯
Focusing
View GitHub Profile
@AliRazaviDeveloper
AliRazaviDeveloper / retryDynamicImport.ts
Last active October 25, 2024 15:56 — forked from mberneti/retryDynamicImport.ts
This utility function retryDynamicImport enhances React’s lazy loading mechanism by adding retry logic with a versioned query parameter. It retries importing a component multiple times in case of failure, which can be useful for bypassing browser cache or dealing with intermittent network issues. It can be used as a drop-in replacement for React…
import { ComponentType, lazy } from "react";
interface RetryOptions {
maxRetryCount?: number;
retryDelayMs?: number;
}
const DEFAULT_RETRY_OPTIONS: Required<RetryOptions> = {
maxRetryCount: 15,
retryDelayMs: 500,
@AliRazaviDeveloper
AliRazaviDeveloper / vscode-setting.json
Created May 14, 2024 10:48
custom setting vscode
{
// ========== Visuals ==========
"editor.cursorSmoothCaretAnimation": "on",
"editor.fontFamily": "MonoLisa-Medium,Fira Code,IntelOneMono-Medium,Consolas,Input Mono, monospace",
"editor.guides.bracketPairs": "active",
"editor.lineNumbers": "interval",
"editor.renderWhitespace": "boundary",
"window.autoDetectColorScheme": true,
"workbench.editor.tabActionLocation": "left",
"workbench.fontAliasing": "antialiased",