1
0
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:
Jinxuan Zhu
2019-01-09 22:48:18 -05:00
committed by Sunny Hirai
parent 09db2c93b6
commit 44e47d7ffe

View File

@@ -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]))