Edit this page

up.event up.event.build([type], [props])
JavaScript function

Builds an event with the given type and properties.

The returned event is not emitted.

Example

let event = up.event.build('my:event', { foo: 'bar' })
console.log(event.type)              // logs "my:event"
console.log(event.foo)               // logs "bar"
console.log(event.defaultPrevented)  // logs "false"
up.emit(event)                       // emits the event

Parameters

[type]
optional

The event type.

May also be passed as a property { type }.

string
[props={}]
optional

An object with event properties.

[props.type]
optional

The event type.

May also be passed as a first string argument.

string

Return value

The unemitted event object.