business logic, customer communication.

This commit is contained in:
2023-04-06 17:35:09 +08:00
parent 7c5a9214a1
commit 6157f994a9
23 changed files with 717 additions and 156 deletions

19
lib/functions.js Normal file
View File

@ -0,0 +1,19 @@
function createElement(tagName, className, ...children) {
return createElementInit(tagName, className && (element => element.className = className), ...children);
}
function createElementInit(tagName, init, ...children) {
const element = document.createElement(tagName);
if (typeof init === 'function') {
init(element);
}
if (children.length > 0) {
element.append(...children);
}
return element;
}
export {
createElement,
createElementInit
}