vim-web 0.3.44-dev.72 → 0.3.44-dev.73

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.
@@ -34,6 +34,18 @@ export interface StateRef<T> {
34
34
  confirm(): void;
35
35
  onChange: ISimpleEvent<T>;
36
36
  }
37
+ /**
38
+ * A basic implementation of StateRef<T> without React.
39
+ */
40
+ export declare class MutableState<T> implements StateRef<T> {
41
+ private _value;
42
+ private _onChange;
43
+ constructor(initial: T);
44
+ get(): T;
45
+ set(value: T): void;
46
+ confirm(): void;
47
+ get onChange(): ISimpleEvent<T>;
48
+ }
37
49
  export interface StateRefresher {
38
50
  refresh: () => void;
39
51
  }
@@ -74583,6 +74583,26 @@ Averrage Date/Second ${avgDataRatePS} kb
74583
74583
  })
74584
74584
  );
74585
74585
  }
74586
+ class MutableState {
74587
+ constructor(initial) {
74588
+ __publicField(this, "_value");
74589
+ __publicField(this, "_onChange", new distExports.SimpleEventDispatcher());
74590
+ this._value = initial;
74591
+ }
74592
+ get() {
74593
+ return this._value;
74594
+ }
74595
+ set(value) {
74596
+ if (value === this._value) return;
74597
+ this._value = value;
74598
+ this._onChange.dispatch(value);
74599
+ }
74600
+ confirm() {
74601
+ }
74602
+ get onChange() {
74603
+ return this._onChange.asEvent();
74604
+ }
74605
+ }
74586
74606
  function useRefresher() {
74587
74607
  const [refresh, setRefresh] = React2.useState(false);
74588
74608
  return {
@@ -74817,6 +74837,7 @@ Averrage Date/Second ${avgDataRatePS} kb
74817
74837
  }
74818
74838
  const reactUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
74819
74839
  __proto__: null,
74840
+ MutableState,
74820
74841
  useActionRef,
74821
74842
  useArgActionRef,
74822
74843
  useArgFuncRef,