mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-19 13:41:19 +02:00
Refactor duplicate code in mixin (#2529)
* Refactor duplicate code in mixin * Remove debugger
This commit is contained in:
@@ -48,18 +48,20 @@ function create(type) {
|
||||
* Mix in the object interfaces.
|
||||
*/
|
||||
|
||||
mixin(create('block'), [Block])
|
||||
mixin(create('change'), [Change])
|
||||
mixin(create('decoration'), [Decoration])
|
||||
mixin(create('document'), [Document])
|
||||
mixin(create('editor'), [Editor])
|
||||
mixin(create('inline'), [Inline])
|
||||
mixin(create('leaf'), [Leaf])
|
||||
mixin(create('mark'), [Mark])
|
||||
mixin(create('node'), [Node])
|
||||
mixin(create('operation'), [Operation])
|
||||
mixin(create('point'), [Point])
|
||||
mixin(create('range'), [Range])
|
||||
mixin(create('selection'), [Selection])
|
||||
mixin(create('text'), [Text])
|
||||
mixin(create('value'), [Value])
|
||||
Object.entries({
|
||||
Block,
|
||||
Change,
|
||||
Decoration,
|
||||
Document,
|
||||
Editor,
|
||||
Inline,
|
||||
Leaf,
|
||||
Mark,
|
||||
Node,
|
||||
Operation,
|
||||
Point,
|
||||
Range,
|
||||
Selection,
|
||||
Text,
|
||||
Value,
|
||||
}).forEach(([camel, obj]) => mixin(create(camel.toLowerCase()), [obj]))
|
||||
|
Reference in New Issue
Block a user