added comments describing why we use get_registered_params before notifying read methods

pull/11504/head
godzylinux 2 years ago committed by FoHoOV
parent 11f2508eb0
commit 65c006490f

@ -20,6 +20,7 @@ export const ReactiveMap = make_reactive(Map, {
} }
options.get_registered_params('has')?.forEach((value, param) => { options.get_registered_params('has')?.forEach((value, param) => {
// because we don't want to notify `has` for items that are currently not in the map
if (!options.value.has(param)) { if (!options.value.has(param)) {
return; return;
} }
@ -27,6 +28,7 @@ export const ReactiveMap = make_reactive(Map, {
}); });
options.get_registered_params('get')?.forEach((value, param) => { options.get_registered_params('get')?.forEach((value, param) => {
// because we don't want to notify `get` for items that are currently not in the map
if (!options.value.has(param)) { if (!options.value.has(param)) {
return; return;
} }

@ -16,6 +16,7 @@ export const ReactiveSet = make_reactive(Set, {
return false; return false;
} }
options.get_registered_params('has')?.forEach((value, param) => { options.get_registered_params('has')?.forEach((value, param) => {
// because we don't want to notify `has` for items that are currently not in the set
if (!options.value.has(param)) { if (!options.value.has(param)) {
return; return;
} }

Loading…
Cancel
Save