Skip to content

Instantly share code, notes, and snippets.

View JoeStanton's full-sized avatar

Joe Stanton JoeStanton

  • DeepMind
  • London
View GitHub Profile
@iammerrick
iammerrick / LazilyLoad.js
Last active August 7, 2019 14:15
Lazily Load Code Declaratively in React + Webpack
import React from 'react';
const toPromise = (load) => (new Promise((resolve) => (
load(resolve)
)));
class LazilyLoad extends React.Component {
constructor() {
super(...arguments);
<!doctype html>
<html>
<head>
<style type="text/css">
body {
margin: 0;
}
iframe {
bottom: 0;