Skip to content

Commit bea9978

Browse files
feat: Add Component#getId, Component#getNode
Getter method for Component#_requestingUpdate has deliberately not been added. Component#requestUpdate should be sufficient to hook into the node's update cycle.
1 parent ebfc48d commit bea9978

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

core/Component.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,23 @@ Component.prototype.onUpdate = function onUpdate () {
116116
this._requestingUpdate = false;
117117
};
118118

119+
/**
120+
* @method
121+
*
122+
* @return {Node} Node to which the component has been added.
123+
*/
124+
Component.prototype.getNode = function getNode() {
125+
return this._node;
126+
};
127+
128+
/**
129+
* @method
130+
*
131+
* @return {Number} Id assigned by the Node when the component has been
132+
* added.
133+
*/
134+
Component.prototype.getId = function getId() {
135+
return this._id;
136+
};
137+
119138
module.exports = Component;

0 commit comments

Comments
 (0)