Skip to content

Commit

Permalink
fix: revert type changes for useEditor in vue-3 package
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Kühn authored and Philipp Kühn committed Jan 5, 2022
1 parent 17363af commit 3ba3afb
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/vue-3/src/useEditor.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import {
onMounted,
onBeforeUnmount,
shallowRef,
Ref,
} from 'vue'
import { onMounted, onBeforeUnmount, shallowRef } from 'vue'
import { EditorOptions } from '@tiptap/core'
import { Editor } from './Editor'

// We set a custom return type. Otherwise TypeScript will throw TS4023. Not sure why.
export const useEditor = (options: Partial<EditorOptions> = {}): Ref<Editor> => {
const editor = shallowRef<Editor>() as Ref<Editor>
export const useEditor = (options: Partial<EditorOptions> = {}) => {
const editor = shallowRef<Editor>()

onMounted(() => {
editor.value = new Editor(options)
Expand Down

0 comments on commit 3ba3afb

Please sign in to comment.