@rettangoli/fe 0.0.9 → 0.0.10
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 +1 -1
- package/src/createComponent.js +7 -5
- package/src/parser.js +3 -3
package/package.json
CHANGED
package/src/createComponent.js
CHANGED
|
@@ -365,10 +365,6 @@ class BaseComponent extends HTMLElement {
|
|
|
365
365
|
if (oldValue !== newValue && this.render) {
|
|
366
366
|
// Call handleOnUpdate if it exists
|
|
367
367
|
if (this.handlers?.handleOnUpdate) {
|
|
368
|
-
const changes = {
|
|
369
|
-
oldAttrs: { [name]: oldValue },
|
|
370
|
-
newAttrs: { [name]: newValue }
|
|
371
|
-
};
|
|
372
368
|
const deps = {
|
|
373
369
|
...this.deps,
|
|
374
370
|
refIds: this.refIds,
|
|
@@ -377,7 +373,13 @@ class BaseComponent extends HTMLElement {
|
|
|
377
373
|
store: this.store,
|
|
378
374
|
render: this.render.bind(this),
|
|
379
375
|
};
|
|
380
|
-
|
|
376
|
+
const changes = {
|
|
377
|
+
oldAttrs: { [name]: oldValue },
|
|
378
|
+
newAttrs: { [name]: newValue },
|
|
379
|
+
oldProps: deps.props,
|
|
380
|
+
newProps: deps.props,
|
|
381
|
+
};
|
|
382
|
+
this.handlers.handleOnUpdate(deps, changes);
|
|
381
383
|
} else {
|
|
382
384
|
requestAnimationFrame(() => {
|
|
383
385
|
this.render();
|
package/src/parser.js
CHANGED
|
@@ -428,7 +428,7 @@ export const createVirtualDom = ({
|
|
|
428
428
|
// Call the specific component's handleOnUpdate instead of the parent's onUpdate
|
|
429
429
|
if (element.handlers && element.handlers.handleOnUpdate) {
|
|
430
430
|
const deps = {
|
|
431
|
-
...(element.deps
|
|
431
|
+
...(element.deps),
|
|
432
432
|
store: element.store,
|
|
433
433
|
render: element.render.bind(element),
|
|
434
434
|
handlers: element.handlers,
|
|
@@ -436,12 +436,12 @@ export const createVirtualDom = ({
|
|
|
436
436
|
refIds: element.refIds || {},
|
|
437
437
|
getRefIds: () => element.refIds || {},
|
|
438
438
|
};
|
|
439
|
-
element.handlers.handleOnUpdate({
|
|
439
|
+
element.handlers.handleOnUpdate(deps, {
|
|
440
440
|
oldProps,
|
|
441
441
|
newProps,
|
|
442
442
|
oldAttrs,
|
|
443
443
|
newAttrs,
|
|
444
|
-
}
|
|
444
|
+
});
|
|
445
445
|
}
|
|
446
446
|
});
|
|
447
447
|
}
|