@@ -126,8 +126,10 @@ export class JsonFormsAngularService {
126
126
127
127
updateCore < T extends CoreActions > ( coreAction : T ) : T {
128
128
const coreState = coreReducer ( this . _state . core , coreAction ) ;
129
- this . _state . core = coreState ;
130
- this . updateSubject ( ) ;
129
+ if ( coreState !== this . _state . core ) {
130
+ this . _state . core = coreState ;
131
+ this . updateSubject ( ) ;
132
+ }
131
133
return coreAction ;
132
134
}
133
135
@@ -156,22 +158,28 @@ export class JsonFormsAngularService {
156
158
setUiSchema ( uischema : UISchemaElement | undefined ) : void {
157
159
const newUiSchema = uischema ?? generateDefaultUISchema ( this . _state . core . schema ) ;
158
160
const coreState = coreReducer ( this . _state . core , Actions . updateCore ( this . _state . core . data , this . _state . core . schema , newUiSchema ) ) ;
159
- this . _state . core = coreState ;
160
- this . updateSubject ( ) ;
161
+ if ( coreState !== this . _state . core ) {
162
+ this . _state . core = coreState ;
163
+ this . updateSubject ( ) ;
164
+ }
161
165
}
162
166
163
167
setSchema ( schema : JsonSchema | undefined ) : void {
164
168
const coreState = coreReducer ( this . _state . core ,
165
169
Actions . updateCore ( this . _state . core . data , schema ?? generateJsonSchema ( this . _state . core . data ) , this . _state . core . uischema )
166
170
) ;
167
- this . _state . core = coreState ;
168
- this . updateSubject ( ) ;
171
+ if ( coreState !== this . _state . core ) {
172
+ this . _state . core = coreState ;
173
+ this . updateSubject ( ) ;
174
+ }
169
175
}
170
176
171
177
setData ( data : any ) : void {
172
178
const coreState = coreReducer ( this . _state . core , Actions . updateCore ( data , this . _state . core . schema , this . _state . core . uischema ) ) ;
173
- this . _state . core = coreState ;
174
- this . updateSubject ( ) ;
179
+ if ( coreState !== this . _state . core ) {
180
+ this . _state . core = coreState ;
181
+ this . updateSubject ( ) ;
182
+ }
175
183
}
176
184
177
185
setLocale ( locale : string ) : void {
0 commit comments