webdetta 0.1.233 → 0.1.235
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isIterable, isObject,
|
|
1
|
+
import { isIterable, isObject, callFn } from '../common/utils.js';
|
|
2
2
|
import { once } from '../execution/index.js';
|
|
3
3
|
import { r } from '../reactivity/index.js';
|
|
4
4
|
import { Element, Operator, processItem } from './base.js';
|
|
@@ -20,7 +20,7 @@ const createContainer = (content) => {
|
|
|
20
20
|
|
|
21
21
|
const nodes = [], operators = [];
|
|
22
22
|
const contentEffect = r.effect(() => {
|
|
23
|
-
const items =
|
|
23
|
+
const items = callFn(content);
|
|
24
24
|
processItem(items, o => operators.push(o), c => nodes.push(c), true);
|
|
25
25
|
if (startNode) appendAfter(startNode);
|
|
26
26
|
return () => {
|
|
@@ -69,7 +69,7 @@ export const createList = (itemsFn, renderItem, keyFn = listItemKey) => {
|
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
const effect = r.effect(() => {
|
|
72
|
-
const items =
|
|
72
|
+
const items = callFn(itemsFn);
|
|
73
73
|
const entries = listItemsToEntries(items, keyFn);
|
|
74
74
|
|
|
75
75
|
let last = root, i = 0;
|
|
@@ -104,7 +104,7 @@ export const createSlot = (content) => {
|
|
|
104
104
|
export const createIf = () => {
|
|
105
105
|
const conditions = [];
|
|
106
106
|
const node = createSlot(() =>
|
|
107
|
-
conditions.find(d =>
|
|
107
|
+
conditions.find(d => callFn(d.cond))?.value
|
|
108
108
|
);
|
|
109
109
|
|
|
110
110
|
node.elif = (cond, ...args) => {
|