mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-20 06:01:24 +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.
|
* Mix in the object interfaces.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
mixin(create('block'), [Block])
|
Object.entries({
|
||||||
mixin(create('change'), [Change])
|
Block,
|
||||||
mixin(create('decoration'), [Decoration])
|
Change,
|
||||||
mixin(create('document'), [Document])
|
Decoration,
|
||||||
mixin(create('editor'), [Editor])
|
Document,
|
||||||
mixin(create('inline'), [Inline])
|
Editor,
|
||||||
mixin(create('leaf'), [Leaf])
|
Inline,
|
||||||
mixin(create('mark'), [Mark])
|
Leaf,
|
||||||
mixin(create('node'), [Node])
|
Mark,
|
||||||
mixin(create('operation'), [Operation])
|
Node,
|
||||||
mixin(create('point'), [Point])
|
Operation,
|
||||||
mixin(create('range'), [Range])
|
Point,
|
||||||
mixin(create('selection'), [Selection])
|
Range,
|
||||||
mixin(create('text'), [Text])
|
Selection,
|
||||||
mixin(create('value'), [Value])
|
Text,
|
||||||
|
Value,
|
||||||
|
}).forEach(([camel, obj]) => mixin(create(camel.toLowerCase()), [obj]))
|
||||||
|
Reference in New Issue
Block a user