- core
- Context
- ElementAllocator
- ElementOutput
- Engine
- Entity
- EventEmitter
- EventHandler
- Group
- Modifier
- OptionsManager
- RenderNode
- Scene
- SpecParser
- Transform
- View
- ViewSequence
- events
- EventArbiter
- EventFilter
- EventMapper
- inputs
- Accumulator
- GenericSync
- MouseSync
- PinchSync
- RotateSync
- ScaleSync
- ScrollSync
- TouchSync
- TouchTracker
- TwoFingerSync
- math
- Matrix
- Quaternion
- Random
- Utilities
- Vector
- modifiers
- Draggable
- Fader
- ModifierChain
- StateModifier
- physics
- PhysicsEngine
- physics/bodies
- Body
- Circle
- Particle
- Rectangle
- physics/constraints
- Surface
- Collision
- Constraint
- Curve
- Distance
- Snap
- Wall
- Walls
- physics/forces
- Drag
- Force
- Repulsion
- RotationalDrag
- RotationalSpring
- Spring
- VectorField
- physics/integrators
- SymplecticEuler
- surfaces
- CanvasSurface
- ContainerSurface
- ImageSurface
- InputSurface
- TextareaSurface
- VideoSurface
- transitions
- CachedMap
- Easing
- MultipleTransition
- SnapTransition
- SpringTransition
- Transitionable
- TransitionableTransform
- TweenTransition
- WallTransition
- utilities
- KeyCodes
- Timer
- Utility
- views
- ContextualView
- Deck
- DrawerLayout
- EdgeSwapper
- FlexibleLayout
- Flipper
- GridLayout
- HeaderFooterLayout
- Lightbox
- RenderController
- ScrollContainer
- Scroller
- Scrollview
- SequentialLayout
- widgets
- NavigationBar
- TabBar
EventHandler
EventHandler forwards received events to a set of provided callback functions. It allows events to be captured, processed, and optionally piped through to other event handlers.
Overview
Methods
setInputHandler
setOutputHandler
emit
addListener
pipe
unpipe
on
addListener
subscribe
unsubscribe
Methods
setInputHandler(object, handler)Static
Assign an event handler to receive an object's input events.
Parameters
object
Object
object to mix trigger, subscribe, and unsubscribe functions into
handler
EventHandler
assigned event handler
setOutputHandler(object, handler)Static
Assign an event handler to receive an object's output events.
Parameters
object
Object
object to mix pipe, unpipe, on, addListener, and removeListener functions into
handler
EventHandler
assigned event handler
emit(type, event)
Trigger an event, sending to all downstream handlers listening for provided 'type' key.
Parameters
type
String
event type key (for example, 'click')
event
Object
event data
Returns
EventHandler
this
addListener()
Alias for emit
pipe(target)
Add event handler object to set of downstream handlers.
Parameters
target
EventHandler
event handler target object
Returns
EventHandler
passed event handler
unpipe(target)
Remove handler object from set of downstream handlers. Undoes work of "pipe".
Parameters
target
EventHandler
target handler object
Returns
EventHandler
provided target
on(type, handler)
Bind a callback function to an event type handled by this object.
Parameters
type
String
event type key (for example, 'click')
handler
Function(string, Object)
callback
Returns
EventHandler
this
addListener()
Alias for "on"
subscribe(source)
Listen for events from an upstream event handler.
Parameters
source
EventEmitter
source emitter object
Returns
EventHandler
this
unsubscribe(source)
Stop listening to events from an upstream event handler.
Parameters
source
EventEmitter
source emitter object
Returns
EventHandler
this