Skip to content

Instantly share code, notes, and snippets.

Avatar

Victor Doss vidoss

View GitHub Profile
@neilj
neilj / window-controller.js
Last active Oct 30, 2019
Cross-tab window controller
View window-controller.js
function WindowController () {
this.id = Math.random();
this.isMaster = false;
this.others = {};
window.addEventListener( 'storage', this, false );
window.addEventListener( 'unload', this, false );
this.broadcast( 'hello' );
View gist:d18ada55ef8d7c4929bb
// make a "base" component
const FakeButton = (props) => (
<div
{...props}
style={{
cursor: 'default',
border: '1px solid',
borderRadius: '3px',
...props.style
}}
You can’t perform that action at this time.