new Withinable()

Methods


within( range, unit, callback )

Description
Fire a callback when the value is within a certain range
Parameters
Name Type Description
range Array.<number> The upper and lower ends of the range to watch
unit string The property to test
callback function A callback to run when the event is fired.
Details

on( event, listener )

Description
Create an event listener
Parameters
Name Type Description
event string The name of the event to listen for
listener function A callback to run when the event is fired.

removeListener( event, listener )

Description
Remove an event listener
Parameters
Name Type Description
event string The name of the event that we are removing a listener from
listener function The callback that we are removing

emit( event )

Description
Emit an event
Parameters
Name Type Description
event string The name of the event to emit

once( event, listener )

Description
Create an event listener that will only fire one time.
Parameters
Name Type Description
event string The name of the event to listen for
listener function A callback to run when the event is fired.