1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-23 15:32:59 +02:00

Don't memoize some low level method

This commit is contained in:
Samy Pessé
2016-11-02 18:07:13 +01:00
parent b7ad0ba55c
commit 20720a4190

View File

@@ -236,58 +236,6 @@ const Node = {
}, Character.createList())
},
/**
* Get children after a child by `key`.
*
* @param {String or Node} key
* @return {Node} node
*/
getChildrenAfter(key) {
const child = this.assertChild(key)
const index = this.nodes.indexOf(child)
return this.nodes.slice(index + 1)
},
/**
* Get children after a child by `key`, including the child.
*
* @param {String or Node} key
* @return {Node} node
*/
getChildrenAfterIncluding(key) {
const child = this.assertChild(key)
const index = this.nodes.indexOf(child)
return this.nodes.slice(index)
},
/**
* Get children before a child by `key`.
*
* @param {String or Node} key
* @return {Node} node
*/
getChildrenBefore(key) {
const child = this.assertChild(key)
const index = this.nodes.indexOf(child)
return this.nodes.slice(0, index)
},
/**
* Get children before a child by `key`, including the child.
*
* @param {String or Node} key
* @return {Node} node
*/
getChildrenBeforeIncluding(key) {
const child = this.assertChild(key)
const index = this.nodes.indexOf(child)
return this.nodes.slice(0, index + 1)
},
/**
* Get children between two child keys.
*
@@ -1336,19 +1284,11 @@ const Node = {
*/
memoize(Node, [
'assertChild',
'assertDescendant',
'getAncestors',
'getBlocks',
'getBlocksAtRange',
'getCharactersAtRange',
'getChild',
'getChildrenAfter',
'getChildrenAfterIncluding',
'getChildrenBefore',
'getChildrenBeforeIncluding',
'getChildrenBetween',
'getChildrenBetweenIncluding',
'getClosestBlock',
'getClosestInline',
'getComponent',
@@ -1379,8 +1319,6 @@ memoize(Node, [
'getTextDirection',
'getTexts',
'getTextsAtRange',
'hasChild',
'hasDescendant',
'hasVoidParent',
'isInlineSplitAtRange'
])