Skip to content

Commit 825bda8

Browse files
committed
fix(ModelManager): Run all hooks at the start of data load
1 parent fe93424 commit 825bda8

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/core/ModelManager.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export default class ModelManager {
4848
this.collapseState = {};
4949
this.listeners = [];
5050

51+
this.runAllHooks();
52+
5153
if (this.model.defaultActiveView) {
5254
this.activateView(this.model.defaultActiveView, 0);
5355
}
@@ -245,6 +247,19 @@ export default class ModelManager {
245247

246248
// --------
247249

250+
runAllHooks() {
251+
const names = Object.keys(this.data);
252+
for (let i = 0; i < names.length; i++) {
253+
const name = names[i];
254+
const hooks = this.model.views[name].hooks || [];
255+
for (let viewIdx = 0; viewIdx < this.data[name].length; viewIdx++) {
256+
this.runHooks(name, viewIdx);
257+
}
258+
}
259+
}
260+
261+
// --------
262+
248263
getPropertyList() {
249264
const propertyList = [];
250265

0 commit comments

Comments
 (0)