Sha256: aaf7caeccf512f83639b3e45ffe280e0e31e9cd000234d64c03fe3a3c8761d91

Contents?: true

Size: 418 Bytes

Versions: 14

Compression:

Stored size: 418 Bytes

Contents

// @ts-check

/**
 * 
 * @param {string} name 
 * @param {{[key: string]: any}} detail 
 * @param {Document | HTMLElement} [target]
 */
function raiseEvent(name, detail, target) {
    if (!target) {
        target = document;
    }

    const event = new CustomEvent(name, { detail: detail});
    document.dispatchEvent(event);
    console.log('Event Raised', name, detail);
}

export { raiseEvent };

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fenton-jekyll-boilerplate-0.0.15 assets/js/modules/events.js
fenton-jekyll-boilerplate-0.0.14 assets/js/modules/events.js
fenton-jekyll-boilerplate-0.0.13 assets/js/modules/events.js
fenton-jekyll-boilerplate-0.0.12 assets/js/modules/events.js
fenton-jekyll-boilerplate-0.0.11 assets/js/modules/events.js
fenton-jekyll-boilerplate-0.0.10 assets/js/modules/events.js
fenton-jekyll-boilerplate-0.0.9 assets/js/modules/events.js
fenton-jekyll-boilerplate-0.0.8 assets/js/modules/events.js
fenton-jekyll-boilerplate-0.0.7 assets/js/modules/events.js
fenton-jekyll-boilerplate-0.0.6 assets/js/modules/events.js
fenton-jekyll-boilerplate-0.0.4 assets/js/modules/events.js
fenton-jekyll-boilerplate-0.0.3 assets/js/modules/events.js
fenton-jekyll-boilerplate-0.0.2 assets/js/modules/events.js
fenton-jekyll-boilerplate-0.0.1 assets/js/modules/events.js