Replace state "deep" option with "shallow" option

This commit is contained in:
Talia 2024-01-17 11:52:41 +01:00
parent 035eeb8fc0
commit 47994975f9

View file

@ -65,7 +65,7 @@ export class State extends SimpleState {
const old = this.get(prop)
if (old !== value) {
this.emit(prop, value)
if (this.#options.deep !== false) {
if (this.#options.shallow) {
if (State.isState(old)) this.disown(prop, old)
if (State.isState(value)) this.adopt(prop, value)
}