feat: return unbind function for onChangeDetecting & onChangeSelection

This commit is contained in:
LeoYuan 袁力皓 2022-05-27 10:53:50 +08:00
parent 171b1013b2
commit 30267cb173

View File

@ -204,7 +204,7 @@ export default class DocumentModel {
* document hover
*/
onChangeDetecting(fn: (node: Node) => void) {
this[documentSymbol].designer.detecting.onDetectingChange((node: InnerNode) => {
return this[documentSymbol].designer.detecting.onDetectingChange((node: InnerNode) => {
fn(Node.create(node)!);
});
}
@ -213,7 +213,7 @@ export default class DocumentModel {
* document
*/
onChangeSelection(fn: (ids: string[]) => void) {
this[documentSymbol].selection.onSelectionChange((ids: string[]) => {
return this[documentSymbol].selection.onSelectionChange((ids: string[]) => {
fn(ids);
});
}