∅:D[
3.309] → [
4.1942:1998]
B:BD[
4.1942] → [
4.1942:1998]
B:BD[
4.1998] → [
3.310:432]
∅:D[
3.432] → [
4.2126:2141]
B:BD[
4.2126] → [
4.2126:2141]
B:BD[
4.2141] → [
5.2869:2910]
∅:D[
5.2910] → [
4.2141:2169]
B:BD[
4.2141] → [
4.2141:2169]
const newData = {
...oldData,
[key]: (newValueOrCallback as ((prev: T[typeof key], whole: W) => T[typeof key]))(oldData[key], wholeData),
};
// console.log({ newData });
return newData;
const newKey = (newValueOrCallback as ((prev: T[typeof key], whole: W) => T[typeof key]))(oldData[key], wholeData);
if (oldData[key] === newKey) {
return oldData; // no update detected, no need to update anything
} else {
const newData = {
...oldData,
[key]: (newValueOrCallback as ((prev: T[typeof key], whole: W) => T[typeof key]))(oldData[key], wholeData),
};
// console.log({ newData });
return newData;
}