mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
update bus.subscribe
This commit is contained in:
1 parent
875bf696e2
commit
d077019e0d
15 files changed
+85
-162
No files matched your search
@@ -113,7 +113,7 @@ class RecordMainConnectionHandler extends RecordConnectionHandler {
|
||||
return;
|
||||
}
|
||||
}
|
||||
bus.subscribe(['record_change'], this, 'onRecordChange');
|
||||
this.id = bus.subscribe(['record_change'], this.onRecordChange.bind(this));
|
||||
}
|
||||
|
||||
async message(msg) {
|
||||
@@ -129,7 +129,7 @@ class RecordMainConnectionHandler extends RecordConnectionHandler {
|
||||
}
|
||||
|
||||
async cleanup() {
|
||||
bus.unsubscribe(['record_change'], this, 'onRecordChange');
|
||||
bus.unsubscribe(['record_change'], this.id);
|
||||
}
|
||||
|
||||
async onRecordChange(data) {
|
||||
@@ -157,7 +157,7 @@ class RecordDetailConnectionHandler extends contest.ContestHandlerMixin(Connecti
|
||||
}
|
||||
}
|
||||
this.rid = rid.toString();
|
||||
bus.subscribe(['record_change'], this, 'onRecordChange');
|
||||
this.id = bus.subscribe(['record_change'], this.onRecordChange.bind(this));
|
||||
this.onRecordChange({ value: { rdoc } });
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ class RecordDetailConnectionHandler extends contest.ContestHandlerMixin(Connecti
|
||||
}
|
||||
|
||||
async cleanup() {
|
||||
bus.unsubscribe(['record_change'], this, 'onRecordChange');
|
||||
bus.unsubscribe(['record_change'], this.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user