mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-30 18:39:51 +02:00
Memoize Schema.__validate
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
import React from 'react'
|
||||
import isReactComponent from '../utils/is-react-component'
|
||||
import memoize from '../utils/memoize'
|
||||
import typeOf from 'type-of'
|
||||
import { Record } from 'immutable'
|
||||
|
||||
@@ -121,7 +122,6 @@ class Schema extends new Record(DEFAULTS) {
|
||||
value,
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -222,6 +222,14 @@ function normalizeMarkComponent(render) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Memoize validation for a schema
|
||||
*/
|
||||
|
||||
memoize(Schema.prototype, [
|
||||
'__validate'
|
||||
])
|
||||
|
||||
/**
|
||||
* Export.
|
||||
*
|
||||
|
Reference in New Issue
Block a user