refactoring
This commit is contained in:
@@ -14,7 +14,6 @@ export default abstract class Extension {
|
|||||||
defaultOptions: { [key: string]: any } = {}
|
defaultOptions: { [key: string]: any } = {}
|
||||||
|
|
||||||
public abstract name: string
|
public abstract name: string
|
||||||
// public abstract plugins: any
|
|
||||||
|
|
||||||
public type = 'extension'
|
public type = 'extension'
|
||||||
|
|
||||||
@@ -24,11 +23,11 @@ export default abstract class Extension {
|
|||||||
this.editor = editor
|
this.editor = editor
|
||||||
}
|
}
|
||||||
|
|
||||||
get update(): any {
|
update(): any {
|
||||||
return () => {}
|
return () => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
get plugins(): any {
|
plugins(): any {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default class ExtensionManager {
|
|||||||
|
|
||||||
get plugins(): any {
|
get plugins(): any {
|
||||||
return collect(this.extensions)
|
return collect(this.extensions)
|
||||||
.flatMap(extension => extension.plugins)
|
.flatMap(extension => extension.plugins())
|
||||||
.toArray()
|
.toArray()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default class History extends Extension {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
get plugins() {
|
plugins() {
|
||||||
return [
|
return [
|
||||||
history()
|
history()
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user