Skip to content

Instantly share code, notes, and snippets.

View serbanghita's full-sized avatar
🏓

Şerban Ghiţă serbanghita

🏓
View GitHub Profile
@serbanghita
serbanghita / codeSplitting.js
Created August 28, 2018 11:01 — forked from mgreer/codeSplitting.js
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;