Skip to content

Commit 1394883

Browse files
committed
Reset models when resetting data from server
1 parent 07f8517 commit 1394883

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/LiveComponent/assets/src/Component/ValueStore.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export default class {
66
private props: any = {};
77
private data: any = {};
88

9-
// TODO: consider removing props from ValueStore & component: only leaving in live_controller
109
constructor(props: any, data: any) {
1110
this.props = props;
1211
this.data = data;
@@ -53,7 +52,13 @@ export default class {
5352
return { ...this.props, ...this.data };
5453
}
5554

55+
/**
56+
* Set the data to a fresh set from the server.
57+
*
58+
* @param data
59+
*/
5660
reinitializeData(data: any): void {
61+
this.updatedModels = [];
5762
this.data = data;
5863
}
5964

0 commit comments

Comments
 (0)