mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-24 16:02:55 +02:00
Don't memoize some low level method
This commit is contained in:
@@ -236,58 +236,6 @@ const Node = {
|
|||||||
}, Character.createList())
|
}, 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.
|
* Get children between two child keys.
|
||||||
*
|
*
|
||||||
@@ -1336,19 +1284,11 @@ const Node = {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
memoize(Node, [
|
memoize(Node, [
|
||||||
'assertChild',
|
|
||||||
'assertDescendant',
|
|
||||||
'getAncestors',
|
'getAncestors',
|
||||||
'getBlocks',
|
'getBlocks',
|
||||||
'getBlocksAtRange',
|
'getBlocksAtRange',
|
||||||
'getCharactersAtRange',
|
'getCharactersAtRange',
|
||||||
'getChild',
|
'getChild',
|
||||||
'getChildrenAfter',
|
|
||||||
'getChildrenAfterIncluding',
|
|
||||||
'getChildrenBefore',
|
|
||||||
'getChildrenBeforeIncluding',
|
|
||||||
'getChildrenBetween',
|
|
||||||
'getChildrenBetweenIncluding',
|
|
||||||
'getClosestBlock',
|
'getClosestBlock',
|
||||||
'getClosestInline',
|
'getClosestInline',
|
||||||
'getComponent',
|
'getComponent',
|
||||||
@@ -1379,8 +1319,6 @@ memoize(Node, [
|
|||||||
'getTextDirection',
|
'getTextDirection',
|
||||||
'getTexts',
|
'getTexts',
|
||||||
'getTextsAtRange',
|
'getTextsAtRange',
|
||||||
'hasChild',
|
|
||||||
'hasDescendant',
|
|
||||||
'hasVoidParent',
|
'hasVoidParent',
|
||||||
'isInlineSplitAtRange'
|
'isInlineSplitAtRange'
|
||||||
])
|
])
|
||||||
|
Reference in New Issue
Block a user