@pie-element/shared-player-events 0.2.1-next.20261015154938 → 0.2.1-next.20261019151920

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -32,11 +32,8 @@ function a(e, t, r = {}) {
32
32
  u = !0, c !== null && clearTimeout(c), c = setTimeout(f, Math.max(0, o())), s !== void 0 && l === null && (l = setTimeout(f, Math.max(0, s)));
33
33
  },
34
34
  flush() {
35
- if (!u) {
36
- d();
37
- return;
38
- }
39
- try {
35
+ if (!u) d();
36
+ else try {
40
37
  f();
41
38
  } catch (e) {
42
39
  console.warn("[session-notifier] a committed session-changed dispatch threw", e);
@@ -109,11 +106,11 @@ var c = /* @__PURE__ */ new WeakSet(), l = (e, t) => typeof t == "object" && !!t
109
106
  let t = e.context;
110
107
  if (t === void 0) return;
111
108
  let n = this.pendingByContext.get(t);
112
- if (!(!n || n.requests.length === 0)) {
109
+ if (n && n.requests.length !== 0) {
113
110
  this.pendingByContext.delete(t);
114
111
  for (let e of n.requests) {
115
112
  let n = e.requestorRef.deref(), r = e.callbackRef.deref();
116
- !n || !r || n.dispatchEvent(new u(t, n, r, !0));
113
+ n && r && n.dispatchEvent(new u(t, n, r, !0));
117
114
  }
118
115
  }
119
116
  };
@@ -151,11 +148,7 @@ var h = class {
151
148
  return this.currentValue;
152
149
  }
153
150
  handleValue = (e, t) => {
154
- if (this.isDisconnected) {
155
- t?.();
156
- return;
157
- }
158
- t !== this.unsubscribe && (this.unsubscribe?.(), this.unsubscribe = t), !this.subscribe && this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.currentValue = e, this.onValue?.(e);
151
+ this.isDisconnected ? t?.() : (t !== this.unsubscribe && (this.unsubscribe?.(), this.unsubscribe = t), !this.subscribe && this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.currentValue = e, this.onValue?.(e));
159
152
  };
160
153
  requestValue() {
161
154
  this.host.dispatchEvent(new u(this.context, this.host, this.handleValue, this.subscribe));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/shared-player-events",
3
- "version": "0.2.1-next.20261015154938",
3
+ "version": "0.2.1-next.20261019151920",
4
4
  "description": "PIE Player Events (ESM) - internalized from @pie-framework/pie-player-events",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",