Skip to content

Instantly share code, notes, and snippets.

// make a "base" component
const FakeButton = (props) => (
<div
{...props}
style={{
cursor: 'default',
border: '1px solid',
borderRadius: '3px',
...props.style
}}
@neilj
neilj / window-controller.js
Last active November 4, 2022 21:41
Cross-tab window controller
function WindowController () {
this.id = Math.random();
this.isMaster = false;
this.others = {};
window.addEventListener( 'storage', this, false );
window.addEventListener( 'unload', this, false );
this.broadcast( 'hello' );