Skip to content

Instantly share code, notes, and snippets.

@FlorianRappl
Created February 27, 2020 14:14
Show Gist options
  • Save FlorianRappl/2528f1b89db6d8d14c1894976c90be43 to your computer and use it in GitHub Desktop.
Save FlorianRappl/2528f1b89db6d8d14c1894976c90be43 to your computer and use it in GitHub Desktop.
window.setData = (name, current) => {
const previous = data[name];
data[name] = current;
window.dispatchEvent(new CustomEvent('changed-data', {
detail: {
name,
previous,
current,
},
}));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment