Skip to content

Commit 92e6d9d

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 c9fd487 commit 92e6d9d

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
@@ -114,4 +114,23 @@ Component.prototype.onUpdate = function onUpdate () {
114114
this._requestingUpdate = false;
115115
};
116116

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

0 commit comments

Comments
 (0)