j-templates 7.0.36 → 7.0.38

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.
Files changed (2) hide show
  1. package/Node/vNode.js +7 -2
  2. package/package.json +1 -1
package/Node/vNode.js CHANGED
@@ -154,6 +154,13 @@ function CreateChildrenScope(vnode, children, data) {
154
154
  if (data === undefined)
155
155
  return Store_1.ObservableScope.Create(WrapStaticChildren(vnode, children));
156
156
  const dataIsAsync = (0, functions_1.IsAsync)(data);
157
+ if (dataIsAsync) {
158
+ const dataScope = Store_1.ObservableScope.Create(data);
159
+ vnode.scopes.push(dataScope);
160
+ data = function () {
161
+ return Store_1.ObservableScope.Value(dataScope);
162
+ };
163
+ }
157
164
  const nodeList = list_1.List.Create();
158
165
  const scope = Store_1.ObservableScope.Create(WrapChildren(vnode.injector, children, ToArray(data), nodeList));
159
166
  scope.async = dataIsAsync;
@@ -170,7 +177,6 @@ function WrapStaticChildren(vnode, children) {
170
177
  };
171
178
  }
172
179
  function WrapChildren(injector, children, data, nodeList) {
173
- const dataIsAsync = (0, functions_1.IsAsync)(data);
174
180
  return function () {
175
181
  const nextData = data();
176
182
  switch (nextData.length) {
@@ -198,7 +204,6 @@ function WrapChildren(injector, children, data, nodeList) {
198
204
  const childNodes = injector_1.Injector.Scope(injector, children, data);
199
205
  return CreateNodeArray(childNodes);
200
206
  });
201
- childrenScope.async = dataIsAsync;
202
207
  list_1.List.Add(nextNodeList, {
203
208
  data,
204
209
  nodes: Store_1.ObservableScope.Value(childrenScope),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "j-templates",
3
- "version": "7.0.36",
3
+ "version": "7.0.38",
4
4
  "description": "j-templates",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/TypesInCode/jTemplates",