@domql/update
Advanced tools
Comparing version 2.2.0 to 2.2.1
23
index.js
@@ -25,6 +25,4 @@ 'use strict' | ||
const applyUpdateInit = (params, element) => { | ||
console.log('start update', element.key) | ||
on.initUpdate(element) | ||
if (isString(params) || isNumber(params)) params = { text: params } | ||
console.warn('params', params) | ||
return params | ||
@@ -65,16 +63,11 @@ } | ||
const { ref } = element | ||
const value = element[key] | ||
const { children, childrenKeys } = ref | ||
console.log('====') | ||
console.log(key, childrenKeys, value) | ||
// if (isString(params) || isNumber(params)) params = { text: params } | ||
// move value to ref.children | ||
if (childrenKeys.indexOf(key) === -1) { | ||
const value = params[key] | ||
childrenKeys.push(key) | ||
element[key] = params[key] | ||
console.log('-----') | ||
console.log(params[key], element, key, options) | ||
return children.push(create(params[key], element, key, options)) | ||
element[key] = value | ||
const newElement = create(value, element, key, options) | ||
return children.push(newElement) | ||
} | ||
@@ -108,4 +101,5 @@ | ||
if (children && children.length) { | ||
ref.children = children.map(child => { | ||
return update(element[child.key] || {}, child, options) | ||
children.map(child => { | ||
update(element[child.key] || {}, child, options) | ||
return child | ||
}) | ||
@@ -118,4 +112,5 @@ } | ||
const triggerOnUpdate = (params, element, options) => { | ||
const { ref } = element | ||
on.update(params, element, element.state) | ||
return element | ||
return ref.__updates[0] | ||
} | ||
@@ -122,0 +117,0 @@ |
{ | ||
"name": "@domql/update", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"main": "index.js", | ||
@@ -16,4 +16,4 @@ "license": "MIT", | ||
}, | ||
"gitHead": "ec7e77cec088dafc6b4a5d2893f72e3590a6761e", | ||
"gitHead": "87a27f601df3c39a91dd199fb2068bb761f6ed4e", | ||
"source": "src/index.js" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
8433
197