Skip to content

Commit 30267cb

Browse files
committed
feat: return unbind function for onChangeDetecting & onChangeSelection
1 parent 171b101 commit 30267cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/shell/src/document-model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export default class DocumentModel {
204204
* 当前 document 的 hover 变更事件
205205
*/
206206
onChangeDetecting(fn: (node: Node) => void) {
207-
this[documentSymbol].designer.detecting.onDetectingChange((node: InnerNode) => {
207+
return this[documentSymbol].designer.detecting.onDetectingChange((node: InnerNode) => {
208208
fn(Node.create(node)!);
209209
});
210210
}
@@ -213,7 +213,7 @@ export default class DocumentModel {
213213
* 当前 document 的选中变更事件
214214
*/
215215
onChangeSelection(fn: (ids: string[]) => void) {
216-
this[documentSymbol].selection.onSelectionChange((ids: string[]) => {
216+
return this[documentSymbol].selection.onSelectionChange((ids: string[]) => {
217217
fn(ids);
218218
});
219219
}

0 commit comments

Comments
 (0)