Comparing version 0.9.12 to 0.9.13
{ | ||
"name": "aurumjs", | ||
"version": "0.9.12", | ||
"version": "0.9.13", | ||
"main": "prebuilt/esnext/aurumjs.js", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -12,3 +12,6 @@ import { EventEmitter } from '../aurumjs.js'; | ||
}); | ||
[Symbol.iterator](): Iterator<VDOMNode>; | ||
[Symbol.iterator](): Iterator<{ | ||
node: VDOMNode; | ||
parent: VDOMNode; | ||
}>; | ||
private iterateVDOM; | ||
@@ -15,0 +18,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { EventEmitter } from '../aurumjs.js'; | ||
import { dsMicroDebounce, dsTap, EventEmitter } from '../aurumjs.js'; | ||
import { createAPI } from '../rendering/aurum_element.js'; | ||
@@ -18,10 +18,10 @@ import { ArrayDataSource, DataSource } from '../stream/data_source.js'; | ||
for (const node of this.roots) { | ||
yield* this.iterateVDOM(node); | ||
yield* this.iterateVDOM(node, undefined); | ||
} | ||
} | ||
*iterateVDOM(node) { | ||
yield node; | ||
*iterateVDOM(node, parent) { | ||
yield { node, parent }; | ||
if (node.children) { | ||
for (const child of node.children) { | ||
yield* this.iterateVDOM(child); | ||
yield* this.iterateVDOM(child, node); | ||
} | ||
@@ -37,9 +37,12 @@ } | ||
let renderToken = new CancellationToken(); | ||
sessionToken.chain(renderToken); | ||
root.onChange.subscribe(() => { | ||
sessionToken.addCancelable(() => { | ||
if (renderToken) { | ||
renderToken.cancel(); | ||
} | ||
}); | ||
DataSource.fromEvent(root.onChange, sessionToken).transform(dsMicroDebounce(), dsTap(() => { | ||
renderToken.cancel(); | ||
renderToken = new CancellationToken(); | ||
sessionToken.chain(renderToken); | ||
root.roots = aurumToVDOMInternal(content, renderToken, root.onChange); | ||
}, sessionToken); | ||
}), sessionToken); | ||
root.roots = aurumToVDOMInternal(content, renderToken, root.onChange); | ||
@@ -46,0 +49,0 @@ return root; |
@@ -1,2 +0,2 @@ | ||
import { EventEmitter } from '../aurumjs.js'; | ||
import { dsMicroDebounce, dsTap, EventEmitter } from '../aurumjs.js'; | ||
import { AurumElementModel, createAPI, Renderable } from '../rendering/aurum_element.js'; | ||
@@ -18,13 +18,13 @@ import { ArrayDataSource, DataSource } from '../stream/data_source.js'; | ||
*[Symbol.iterator](): Iterator<VDOMNode> { | ||
*[Symbol.iterator](): Iterator<{ node: VDOMNode; parent: VDOMNode }> { | ||
for (const node of this.roots) { | ||
yield* this.iterateVDOM(node); | ||
yield* this.iterateVDOM(node, undefined); | ||
} | ||
} | ||
private *iterateVDOM(node: VDOMNode): Generator<VDOMNode> { | ||
yield node; | ||
private *iterateVDOM(node: VDOMNode, parent: VDOMNode): Generator<{ node: VDOMNode; parent: VDOMNode }> { | ||
yield { node, parent }; | ||
if (node.children) { | ||
for (const child of node.children) { | ||
yield* this.iterateVDOM(child); | ||
yield* this.iterateVDOM(child, node); | ||
} | ||
@@ -49,11 +49,18 @@ } | ||
let renderToken = new CancellationToken(); | ||
sessionToken.chain(renderToken); | ||
sessionToken.addCancelable(() => { | ||
if (renderToken) { | ||
renderToken.cancel(); | ||
} | ||
}); | ||
root.onChange.subscribe(() => { | ||
renderToken.cancel(); | ||
renderToken = new CancellationToken(); | ||
sessionToken.chain(renderToken); | ||
DataSource.fromEvent(root.onChange, sessionToken).transform( | ||
dsMicroDebounce(), | ||
dsTap(() => { | ||
renderToken.cancel(); | ||
renderToken = new CancellationToken(); | ||
root.roots = aurumToVDOMInternal(content, renderToken, root.onChange); | ||
}, sessionToken); | ||
root.roots = aurumToVDOMInternal(content, renderToken, root.onChange); | ||
}), | ||
sessionToken | ||
); | ||
@@ -60,0 +67,0 @@ root.roots = aurumToVDOMInternal(content, renderToken, root.onChange); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
2556928
38997