Skip to content

Instantly share code, notes, and snippets.

View brianfakhoury's full-sized avatar
☀️
felix culpa

Brian Fakhoury brianfakhoury

☀️
felix culpa
View GitHub Profile
@mgreer
mgreer / codeSplitting.js
Last active August 31, 2021 21:29
Code splitting HOC
// @flow
import * as React from 'react';
import {asyncComponent} from 'react-async-component';
export const loaderMaker = (bgColor: string = 'transparent') => () => (
<div style={{position: 'absolute', width: '100%', height: '100%', backgroundColor: bgColor}} />
);
const MAX_RETRIES = 3;
const STARTING_BACKOFF = 500;