Skip to content

Instantly share code, notes, and snippets.

View TrySpace's full-sized avatar
💭
1

Try Space TrySpace

💭
1
View GitHub Profile
import { unified } from "unified";
import markdown from "remark-parse";
import slate, { defaultNodeTypes, serialize } from "remark-slate";
const DEFAULT_HEADINGS = {
1: "h1",
2: "h2",
3: "h3",
4: "h4",
5: "h5",
@raphael-leger
raphael-leger / lazyWithRetry.js
Last active July 30, 2024 08:46
React LazyWithRetry
import { lazy } from 'react';
const lazyWithRetry = (componentImport) =>
lazy(async () => {
const pageHasAlreadyBeenForceRefreshed = JSON.parse(
window.localStorage.getItem(
'page-has-been-force-refreshed'
) || 'false'
);