feat: trait state patching transformation
This commit is contained in:
parent
78bfe22ee3
commit
d66efaeb1f
|
@ -44,11 +44,12 @@ export class Trait extends Synchronized {
|
|||
return;
|
||||
}
|
||||
const stateKey = step.path.substr(1);
|
||||
const value = this.transformPatchValue(stateKey, step.value);
|
||||
if (stateKey in this.entity) {
|
||||
this.entity[stateKey] = step.value;
|
||||
this.entity[stateKey] = value;
|
||||
}
|
||||
else {
|
||||
this.state = this.state.set(stateKey, step.value);
|
||||
this.state = this.state.set(stateKey, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,6 +60,10 @@ export class Trait extends Synchronized {
|
|||
};
|
||||
}
|
||||
|
||||
transformPatchValue(key, value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
static contextType() {
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user