Skip to content

Commit f1a9d4f

Browse files
committed
Simplify
1 parent 65a5b48 commit f1a9d4f

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

lib/utils/templatize.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,7 @@ function createTemplatizerClass(template, templateInfo, options) {
364364
*/
365365
function addPropagateEffects(template, templateInfo, options) {
366366
let userForwardHostProp = options.forwardHostProp;
367-
const hasHostProps = templateInfo.hasHostProps ||
368-
(templateInfo.hasHostProps =
369-
Boolean(templateInfo.hostProps &&
370-
Object.keys(templateInfo.hostProps).length));
371-
if (userForwardHostProp && hasHostProps) {
367+
if (userForwardHostProp && templateInfo.hasHostProps) {
372368
// Provide data API and property effects on memoized template class
373369
let klass = templateInfo.templatizeTemplateClass;
374370
if (!klass) {
@@ -427,6 +423,9 @@ function addNotifyEffects(klass, template, templateInfo, options) {
427423
}
428424
if (options.forwardHostProp && template.__dataHost) {
429425
for (let hprop in hostProps) {
426+
if (!templateInfo.hasHostProps) {
427+
templateInfo.hasHostProps = true;
428+
}
430429
klass.prototype._addPropertyEffect(hprop,
431430
klass.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,
432431
{fn: createNotifyHostPropEffect()});

0 commit comments

Comments
 (0)