1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-29 18:09:49 +02:00

add extra deprecation to change objects

This commit is contained in:
Ian Storm Taylor
2017-10-27 14:12:21 -07:00
parent ca57f1f8d3
commit 4ad82afd34

View File

@@ -42,7 +42,13 @@ class Change {
*/ */
constructor(attrs) { constructor(attrs) {
const { value } = attrs let { value } = attrs
if (!value && attrs.state) {
logger.deprecate('0.29.0', 'The `state` attribute to change objects has been renamed to `value`.')
value = attrs.state
}
this.value = value this.value = value
this.operations = [] this.operations = []
this.flags = pick(attrs, ['merge', 'save']) this.flags = pick(attrs, ['merge', 'save'])