From 4ad82afd340630a746a45e0247a310c8842f959d Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Fri, 27 Oct 2017 14:12:21 -0700 Subject: [PATCH] add extra deprecation to change objects --- packages/slate/src/models/change.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/slate/src/models/change.js b/packages/slate/src/models/change.js index 2eccd1781..dd55c4bdc 100644 --- a/packages/slate/src/models/change.js +++ b/packages/slate/src/models/change.js @@ -42,7 +42,13 @@ class Change { */ 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.operations = [] this.flags = pick(attrs, ['merge', 'save'])