Note: This module is not part of the public API, and is subject to change.
Module: j5e/withinable
Description
For emitting events when value is within a certain range
Requires
Class: Withinable
Constructor
new Withinable()
Methods
Withinable.within
Fire a callback when the value is within a certain range
withinable.within(range, unit, callback);
Parameters
(required)
Description:
The upper and lower ends of the range to watch
(required)
Description:
The property to test
(required)
Description:
A callback to run when the event is fired.
Withinable.on
Create an event listener
withinable.on(event, listener);
Parameters
(required)
Description:
The name of the event to listen for
(required)
Description:
A callback to run when the event is fired.
Withinable.removeListener
Remove an event listener
withinable.removeListener(event, listener);
Parameters
(required)
Description:
The name of the event that we are removing a listener from
(required)
Description:
The callback that we are removing
Withinable.emit
Note: This method is not part of the public API, and is subject to change.
Emit an event
withinable.emit(event);
Parameters
(required)
Description:
The name of the event to emit
Withinable.once
Create an event listener that will only fire one time.
withinable.once(event, listener);
Parameters
(required)
Description:
The name of the event to listen for
(required)
Description:
A callback to run when the event is fired.