Skip to content

Commit 1a8b405

Browse files
committed
Component constructor to return this
Crafty component constructors need to return `this`, otherwise entity creation can't be chained with other component's constructors after this component's constructor has been called. Fixed.
1 parent e16072a commit 1a8b405

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

component/templates/_base.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Crafty.c('<%= name %>', {
1414
// constructor
1515
<%= name.toLowerCase() %>: function(placeholder) {
1616
this.placeholder = placeholder;
17+
18+
return this;
1719
}
1820

1921
});

0 commit comments

Comments
 (0)