Skip to content

Commit

Permalink
bug: return unregister callback from onMount
Browse files Browse the repository at this point in the history
  • Loading branch information
umaranis committed May 6, 2024
1 parent 8e959d5 commit 3e82f9b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// unregisters onDestroy through returned callback
onMount(() => {
editor.registerCommand(
return editor.registerCommand(
CAN_REDO_COMMAND,
(payload) => {
canRedo = payload;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
// unregisters onDestory using returned callback
onMount(() => {
mergeRegister(
return mergeRegister(
editor.registerUpdateListener(({editorState}) => {
editorState.read(() => {
updateToolbar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// unregisters onDestroy through returned callback
onMount(() => {
editor.registerCommand(
return editor.registerCommand(
CAN_UNDO_COMMAND,
(payload) => {
canUndo = payload;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}
isEditable = editor.isEditable();
editor.registerEditableListener((currentIsEditable) => {
return editor.registerEditableListener((currentIsEditable) => {
isEditable = currentIsEditable;
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
const editor = getEditor();
onMount(() => {
editor.registerCommand(
return editor.registerCommand(
INSERT_HORIZONTAL_RULE_COMMAND,
(type) => {
const selection = getSelection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@
];
onMount(() => {
registerMarkdownShortcuts(editor, TRANSFORMERS);
return registerMarkdownShortcuts(editor, TRANSFORMERS);
});
</script>

0 comments on commit 3e82f9b

Please sign in to comment.