Skip to content

Commit

Permalink
Pass deleter parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
seyacat committed Jan 13, 2024
1 parent 08e5d3c commit 4e6c9c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion reactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function Reactive(
}
},
triggerSubs: function (data) {
let { prop, path, pathIds, value, oldValue } = data;
let { prop, path, pathIds, value, oldValue, deleted } = data;

if (!path) {
path = [prop];
Expand Down Expand Up @@ -124,6 +124,7 @@ function Reactive(
: value,
rawValue: value,
oldValue,
deleted,
pathValues,
prefix: this._prefix,
};
Expand Down Expand Up @@ -152,6 +153,7 @@ function Reactive(
: value,
rawValue: value,
oldValue,
deleted,
pathValues,
prefix: this._prefix,
});
Expand Down Expand Up @@ -468,6 +470,7 @@ function Reactive(
//POST TRIGGER
target.triggerSubs.bind({ target: target, receiver: receiver })({
prop: prop,
deleted: true,
});
}
return true;
Expand Down
1 change: 1 addition & 0 deletions test/reactive.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ it("Multiparent reactive feature", function () {
parent2.target1 = target1;

parent1.subscribe(null, (data) => {
data.pathString == "target1" ? assert.equal(data.deleted, true) : "";
assert.equal(data.base._prefix, parent1._prefix);
});
parent2.subscribe(null, (data) => {
Expand Down

0 comments on commit 4e6c9c8

Please sign in to comment.