remove lodash
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
"url": "https://github.com/scrumpy/tiptap/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"lodash-es": "^4.17.11",
|
||||
"lowlight": "^1.11.0",
|
||||
"prosemirror-collab": "^1.1.1",
|
||||
"prosemirror-history": "^1.0.4",
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { debounce } from 'lodash-es'
|
||||
import { Extension } from 'tiptap'
|
||||
import { Step } from 'prosemirror-transform'
|
||||
import {
|
||||
@@ -51,7 +50,7 @@ export default class CollaborationExtension extends Extension {
|
||||
]
|
||||
}
|
||||
|
||||
getSendableSteps = debounce(state => {
|
||||
getSendableSteps = this.debounce(state => {
|
||||
const sendable = sendableSteps(state)
|
||||
|
||||
if (sendable) {
|
||||
@@ -59,4 +58,17 @@ export default class CollaborationExtension extends Extension {
|
||||
}
|
||||
}, this.options.debounce)
|
||||
|
||||
debounce(fn, delay) {
|
||||
let timeout
|
||||
return function (...args) {
|
||||
if (timeout) {
|
||||
clearTimeout(timeout)
|
||||
}
|
||||
timeout = setTimeout(() => {
|
||||
fn(...args)
|
||||
timeout = null
|
||||
}, delay)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7521,11 +7521,6 @@ locate-path@^3.0.0:
|
||||
p-locate "^3.0.0"
|
||||
path-exists "^3.0.0"
|
||||
|
||||
lodash-es@^4.17.11:
|
||||
version "4.17.11"
|
||||
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.11.tgz#145ab4a7ac5c5e52a3531fb4f310255a152b4be0"
|
||||
integrity sha512-DHb1ub+rMjjrxqlB3H56/6MXtm1lSksDp2rA2cNWjG8mlDUYFhUj3Di2Zn5IwSU87xLv8tNIQ7sSwE/YOX/D/Q==
|
||||
|
||||
lodash._reinterpolate@~3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
|
||||
|
||||
Reference in New Issue
Block a user