@mmstack/primitives 20.11.0 → 20.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6104,6 +6104,7 @@ function tabSync(sig, opt) {
6104
6104
  }
6105
6105
  const NONE = Symbol();
6106
6106
  let received = NONE;
6107
+ let last = untracked(sig);
6107
6108
  const { unsub, post } = bus.subscribe(id, (next) => {
6108
6109
  const before = untracked(sig);
6109
6110
  received = next;
@@ -6111,13 +6112,12 @@ function tabSync(sig, opt) {
6111
6112
  if (untracked(sig) === before)
6112
6113
  received = NONE;
6113
6114
  });
6114
- let firstDone = false;
6115
6115
  const effectRef = effect(() => {
6116
6116
  const val = sig();
6117
- if (!firstDone) {
6118
- firstDone = true;
6119
- return;
6120
- }
6117
+ if (val === last)
6118
+ return; // unchanged since last seen → nothing to post
6119
+ last = val;
6120
+ // came from bus → don't echo
6121
6121
  if (val === received) {
6122
6122
  received = NONE;
6123
6123
  return;