thunderous 2.3.9 → 2.3.10

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.
package/dist/index.cjs CHANGED
@@ -833,20 +833,6 @@ You must set an initial value before calling a property signal's getter.
833
833
  for (const attr of this.attributes) {
834
834
  this.#attrSignals[attr.name] = createSignal(attr.value);
835
835
  }
836
- for (const [attrName, attr] of this.#attributesAsPropertiesMap) {
837
- if (!(attrName in this.#attrSignals)) this.#attrSignals[attrName] = createSignal(null);
838
- const propName = attr.prop;
839
- const [getter] = this.#getPropSignal(propName, { allowUndefined: true });
840
- createEffect(() => {
841
- const value = getter();
842
- if (value === void 0) return;
843
- if (value !== null) {
844
- this.setAttribute(attrName, String(value));
845
- } else {
846
- this.removeAttribute(attrName);
847
- }
848
- });
849
- }
850
836
  this.#render();
851
837
  } catch (error) {
852
838
  const _error = new Error(
@@ -858,6 +844,24 @@ You must set an initial value before calling a property signal's getter.
858
844
  }
859
845
  }
860
846
  connectedCallback() {
847
+ for (const [attrName, attr] of this.#attributesAsPropertiesMap) {
848
+ if (!(attrName in this.#attrSignals)) this.#attrSignals[attrName] = createSignal(null);
849
+ const propName = attr.prop;
850
+ const [getter] = this.#getPropSignal(propName, { allowUndefined: true });
851
+ let busy = false;
852
+ createEffect(() => {
853
+ if (busy) return;
854
+ busy = true;
855
+ const value = getter();
856
+ if (value === void 0) return;
857
+ if (value !== null) {
858
+ this.setAttribute(attrName, String(value));
859
+ } else {
860
+ this.removeAttribute(attrName);
861
+ }
862
+ busy = false;
863
+ });
864
+ }
861
865
  if (this.#observer !== null) {
862
866
  this.#observer.observe(this, { attributes: true });
863
867
  }
package/dist/index.js CHANGED
@@ -798,20 +798,6 @@ You must set an initial value before calling a property signal's getter.
798
798
  for (const attr of this.attributes) {
799
799
  this.#attrSignals[attr.name] = createSignal(attr.value);
800
800
  }
801
- for (const [attrName, attr] of this.#attributesAsPropertiesMap) {
802
- if (!(attrName in this.#attrSignals)) this.#attrSignals[attrName] = createSignal(null);
803
- const propName = attr.prop;
804
- const [getter] = this.#getPropSignal(propName, { allowUndefined: true });
805
- createEffect(() => {
806
- const value = getter();
807
- if (value === void 0) return;
808
- if (value !== null) {
809
- this.setAttribute(attrName, String(value));
810
- } else {
811
- this.removeAttribute(attrName);
812
- }
813
- });
814
- }
815
801
  this.#render();
816
802
  } catch (error) {
817
803
  const _error = new Error(
@@ -823,6 +809,24 @@ You must set an initial value before calling a property signal's getter.
823
809
  }
824
810
  }
825
811
  connectedCallback() {
812
+ for (const [attrName, attr] of this.#attributesAsPropertiesMap) {
813
+ if (!(attrName in this.#attrSignals)) this.#attrSignals[attrName] = createSignal(null);
814
+ const propName = attr.prop;
815
+ const [getter] = this.#getPropSignal(propName, { allowUndefined: true });
816
+ let busy = false;
817
+ createEffect(() => {
818
+ if (busy) return;
819
+ busy = true;
820
+ const value = getter();
821
+ if (value === void 0) return;
822
+ if (value !== null) {
823
+ this.setAttribute(attrName, String(value));
824
+ } else {
825
+ this.removeAttribute(attrName);
826
+ }
827
+ busy = false;
828
+ });
829
+ }
826
830
  if (this.#observer !== null) {
827
831
  this.#observer.observe(this, { attributes: true });
828
832
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thunderous",
3
- "version": "2.3.9",
3
+ "version": "2.3.10",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",