Module: xblocks-core/event

Classes

Custom

Methods

(static) dispatch(element, name, params)

Dispatch event.

Parameters:
Name Type Description
element HTMLElement

node events

name string

event name

params Object

the event parameters

Properties
Name Type Attributes Default Description
bubbles boolean <optional>
false
cancelable boolean <optional>
false
detail * <optional>
Source:
Example
import { dispatch } from 'xblocks-core/event';
dispatch(node, 'custom-event', {
    bubbles: true,
    cancelable: true,
    detail: { data: '123' }
})

(static) forwardingEvents(name, fromElement, toElement, captureopt) → {function}

Forwarding events

Parameters:
Name Type Attributes Default Description
name string

event name

fromElement HTMLElement
toElement HTMLElement
capture boolean <optional>
false
Source:
Returns:

callback

Type
function
Example
import { forwardingEvents } from 'xblocks-core/event';
forwardingEvents('custom-event', fromNode, toNode, false);