1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-19 05:31:56 +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.
*/
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]))