Skip to content

Instantly share code, notes, and snippets.

@alireza-ahmadi
alireza-ahmadi / retryDynamicImport.ts
Last active October 14, 2024 19:58 — 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…
// Usage:
// Replace React.lazy(() => import('x'));
// with retryDynamicImport(() => import('x'));
import { ComponentType, lazy } from 'react';
const MAX_RETRY_COUNT = 15;
const RETRY_DELAY_MS = 500;
// Regex to extract the module URL from the import statement
@alireza-ahmadi
alireza-ahmadi / todo.md
Last active March 22, 2018 13:43 — forked from DeckerCHAN/todo.md
Gist todo list

To Do

  • for an empty checkboxP
  • for a checked checkboxP
public class Loop {
public static void main(String[] args)
{
Integer total = 500000000;
Integer chunk = 50000000;
Integer i = 0;