Closed amelon closed 8 years ago
In the example, rest/spread is not needed. However, they are needed when there are multiple behaviors. The behavior
object represents all passed in component behaviors. If it helps, think of behavior
as a POJO:
const behaviors = { behavior1, behavior2 };
The compose
method takes N
number of objects:
reactStamp(React).compose(container, behavior1, behavior2);
It the rest/spread operators are not used, the compose
method would not work correctly when multiple behaviors are passed.
reactStamp(React).compose(container, { behavior1, behavior2 });
very clear, thank you for your answer.
In your exemple, you're using rest+spread on
behavior
object.But as fas as I understand
react-stamp
composition, it should be possible to just sendbehavior
.Did I miss something?