Home Reference Source Test

Function

Static Public Summary
public

arbiter(event: Event, region: Object)

Function that handles event flow, negotiating with the interpreter, and dispatcher.

public

dispatcher(binding: Binding, data: Object, events: Array)

Emits data at the target element if available, and bubbles up from the target to the parent until the document has been reached.

public

interpreter(bindings: Array, event: Object, state: Object): Object | null

Receives an event and an array of Bindings (element -> gesture handler) to determine what event will be emitted.

Static Public

public arbiter(event: Event, region: Object) source

import arbiter from 'zingtouch/src/core/arbiter.js'

Function that handles event flow, negotiating with the interpreter, and dispatcher.

  1. Receiving all touch events in the window.
  2. Determining which gestures are linked to the target element.
  3. Negotiating with the Interpreter what event should occur.
  4. Sending events to the dispatcher to emit events to the target.

Params:

NameTypeAttributeDescription
event Event

The event emitted from the window object.

region Object

The region object of the current listener.

public dispatcher(binding: Binding, data: Object, events: Array) source

import dispatcher from 'zingtouch/src/core/dispatcher.js'

Emits data at the target element if available, and bubbles up from the target to the parent until the document has been reached. Called from the arbiter.

Params:

NameTypeAttributeDescription
binding Binding

An object of type Binding

data Object

The metadata computed by the gesture being emitted.

events Array

An array of ZingEvents, corresponding to the inputs on the screen.

public interpreter(bindings: Array, event: Object, state: Object): Object | null source

import interpreter from 'zingtouch/src/core/interpreter.js'

Receives an event and an array of Bindings (element -> gesture handler) to determine what event will be emitted. Called from the arbiter.

Params:

NameTypeAttributeDescription
bindings Array

An array containing Binding objects that associate the element to an event handler.

event Object

The event emitted from the window.

state Object

The state object of the current listener.

Return:

Object | null

Returns an object containing a binding and metadata, or null if a gesture will not be emitted.