Skip to content

Commit

Permalink
feat: Add Component#getId, Component#getNode
Browse files Browse the repository at this point in the history
Getter method for Component#_requestingUpdate has deliberately not been
added. Component#requestUpdate should be sufficient to hook into the
node's update cycle.
  • Loading branch information
alexanderGugel committed Jun 4, 2015
1 parent c9fd487 commit 92e6d9d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions core/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,23 @@ Component.prototype.onUpdate = function onUpdate () {
this._requestingUpdate = false;
};

/**
* @method
*
* @return {Node} Node to which the component has been added.
*/
Component.prototype.getNode = function getNode() {
return this._node;
};

/**
* @method
*
* @return {Number} Id assigned by the Node when the component has been
* added.
*/
Component.prototype.getId = function getId() {
return this._id;
};

module.exports = Component;

0 comments on commit 92e6d9d

Please sign in to comment.