1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 10:51:44 +02:00

Memoize Schema.__validate

This commit is contained in:
Soreine
2016-11-01 15:50:44 +01:00
parent 321a71ef25
commit 6f49c3fcbc

View File

@@ -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.
*