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:
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import isReactComponent from '../utils/is-react-component'
|
import isReactComponent from '../utils/is-react-component'
|
||||||
|
import memoize from '../utils/memoize'
|
||||||
import typeOf from 'type-of'
|
import typeOf from 'type-of'
|
||||||
import { Record } from 'immutable'
|
import { Record } from 'immutable'
|
||||||
|
|
||||||
@@ -121,7 +122,6 @@ class Schema extends new Record(DEFAULTS) {
|
|||||||
value,
|
value,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -222,6 +222,14 @@ function normalizeMarkComponent(render) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Memoize validation for a schema
|
||||||
|
*/
|
||||||
|
|
||||||
|
memoize(Schema.prototype, [
|
||||||
|
'__validate'
|
||||||
|
])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export.
|
* Export.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user