domql
Advanced tools
Comparing version 1.6.23 to 1.6.24
{ | ||
"name": "domql", | ||
"description": "DOM rendering Javascript framework at early stage.", | ||
"version": "1.6.23", | ||
"version": "1.6.24", | ||
"repository": "https://github.com/domql/domql", | ||
@@ -6,0 +6,0 @@ "publishConfig": { |
@@ -137,6 +137,6 @@ 'use strict' | ||
const checkIfOnUpdate = (element, parent, options) => { | ||
if (!isFunction(element.if)) return | ||
if (!isFunction(element.if) || !element.state || !parent) return | ||
const ref = element.__ref | ||
const ifPassed = element.if(element, element.state, element.context) | ||
const ifPassed = element.if(element, element.state, element.context, options) | ||
const itWasFalse = ref.__if !== true | ||
@@ -143,0 +143,0 @@ |
'use strict' | ||
import { exec, isFunction, isString } from '@domql/utils' | ||
import { exec, isArray, isFunction, isString } from '@domql/utils' | ||
const ENV = process.env.NODE_ENV | ||
@@ -14,4 +14,4 @@ | ||
export const extendizeByKey = (element, parent, key) => { | ||
const { extend, props, state, childExtend, childProps } = element | ||
const hasComponentAttrs = extend || childExtend || props || state || element.on | ||
const { extend, props, state, childExtend, childProps, on } = element | ||
const hasComponentAttrs = extend || childExtend || props || state || on | ||
const componentKey = key.split('_')[0] | ||
@@ -29,2 +29,8 @@ | ||
} | ||
} else if (extend) { | ||
const preserveExtend = isArray(extend) ? extend : [extend] | ||
return { | ||
...element, | ||
extend: [componentKey || key].concat(preserveExtend) | ||
} | ||
} else if (isFunction(element)) { | ||
@@ -31,0 +37,0 @@ return { |
2857744
78169