Skip to content

Instantly share code, notes, and snippets.

View jpblancoder's full-sized avatar

JP Blanchette jpblancoder

View GitHub Profile
<html lang="en-CA">
<head></head>
<body>
<div>Your regional map widget here</div>
<script>
(function() {
function handleResize() {
if (window.parent !== window) {
window.parent.postMessage({
type: "@fusion/pageSize",
function sendAmplitudeEvent({ event, data }) {
if (window.parent !== window) {
window.parent.postMessage({
type: "@fusion/ampliEvent",
payload: { event, data },
}, "*");
}
}
// Page view event - fire once on page load
@jpblancoder
jpblancoder / callAll.js
Created March 4, 2024 21:12
Create a function that calls all the functions passed to it, with the same arguments.
/**
* Create a function that calls all the functions passed to it, with the same arguments.
* @example <div onClick={callAll(f, g, h)} />
* @param {...any} fns - Functions to call (left-to-right execution)
* @returns {Function}
*/
export const callAll =
(...fns) =>
(...args) =>
fns.forEach(fn => isFunctionThenInvoke(fn, args, undefined));