@oscarpalmer/mora 0.29.0 → 0.31.0

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 (51) hide show
  1. package/dist/batch.mjs +15 -6
  2. package/dist/constants.d.mts +2 -2
  3. package/dist/constants.mjs +7 -4
  4. package/dist/effect.d.mts +5 -18
  5. package/dist/effect.mjs +23 -19
  6. package/dist/helpers/is.d.mts +17 -16
  7. package/dist/helpers/is.mjs +20 -11
  8. package/dist/helpers/proxy.d.mts +5 -9
  9. package/dist/helpers/proxy.mjs +4 -4
  10. package/dist/helpers/value.d.mts +3 -3
  11. package/dist/helpers/value.mjs +22 -5
  12. package/dist/index.d.mts +8 -9
  13. package/dist/index.mjs +2 -2
  14. package/dist/models.d.mts +423 -19
  15. package/dist/mora.full.mjs +532 -424
  16. package/dist/subscription.d.mts +1 -9
  17. package/dist/subscription.mjs +14 -15
  18. package/dist/value/array.d.mts +5 -133
  19. package/dist/value/array.mjs +108 -138
  20. package/dist/value/computed.d.mts +4 -12
  21. package/dist/value/computed.mjs +54 -50
  22. package/dist/value/reactive.d.mts +3 -49
  23. package/dist/value/reactive.mjs +10 -54
  24. package/dist/value/readonly.d.mts +7 -0
  25. package/dist/value/readonly.mjs +37 -0
  26. package/dist/value/signal.d.mts +5 -21
  27. package/dist/value/signal.mjs +33 -49
  28. package/dist/value/store.d.mts +9 -92
  29. package/dist/value/store.mjs +58 -49
  30. package/package.json +7 -8
  31. package/src/batch.ts +22 -9
  32. package/src/constants.ts +12 -5
  33. package/src/effect.ts +35 -40
  34. package/src/helpers/is.ts +36 -20
  35. package/src/helpers/proxy.ts +23 -18
  36. package/src/helpers/value.ts +39 -5
  37. package/src/index.ts +23 -8
  38. package/src/models.ts +520 -17
  39. package/src/subscription.ts +20 -20
  40. package/src/value/array.ts +220 -266
  41. package/src/value/computed.ts +80 -74
  42. package/src/value/reactive.ts +16 -77
  43. package/src/value/readonly.ts +71 -0
  44. package/src/value/signal.ts +43 -71
  45. package/src/value/store.ts +130 -177
  46. package/types/constants.d.ts +1 -1
  47. package/types/index.d.ts +1 -1
  48. package/types/value/array.d.ts +1 -1
  49. package/types/value/computed.d.ts +3 -0
  50. package/types/value/signal.d.ts +1 -1
  51. package/types/value/store.d.ts +1 -1
package/dist/batch.mjs CHANGED
@@ -1,13 +1,22 @@
1
1
  import { BATCH } from "./constants.mjs";
2
2
  import { runEffect } from "./effect.mjs";
3
- import { isEffect } from "./helpers/is.mjs";
4
3
  //#region src/batch.ts
5
4
  function flushHandlers() {
6
- while (BATCH.depth === 0 && BATCH.handlers.size > 0) {
7
- const handlers = [...BATCH.handlers];
8
- BATCH.handlers.clear();
9
- for (const handler of handlers) if (isEffect(handler)) runEffect(handler);
10
- else handler.callback(handler.state.value);
5
+ if (BATCH.flushing) return;
6
+ BATCH.flushing = true;
7
+ try {
8
+ while (BATCH.depth === 0 && BATCH.handlers.size > 0) {
9
+ const handlers = [...BATCH.handlers];
10
+ const { length } = handlers;
11
+ BATCH.handlers.clear();
12
+ for (let index = 0; index < length; index += 1) {
13
+ const handler = handlers[index];
14
+ if (typeof handler.destroy === "function") handler.callback(handler.state.value);
15
+ else runEffect(handler);
16
+ }
17
+ }
18
+ } finally {
19
+ BATCH.flushing = false;
11
20
  }
12
21
  }
13
22
  /**
@@ -1,5 +1,4 @@
1
1
  import { Active, Batch } from "./models.mjs";
2
-
3
2
  //#region src/constants.d.ts
4
3
  declare const ACTIVE: Active;
5
4
  declare const ARRAY_THRESHOLD = 100;
@@ -12,9 +11,10 @@ declare const NAME_ARRAY = "array";
12
11
  declare const NAME_COMPUTED = "computed";
13
12
  declare const NAME_EFFECT = "effect";
14
13
  declare const NAME_MORA = "$mora";
14
+ declare const NAME_READONLY = "readonly";
15
15
  declare const NAME_SIGNAL = "signal";
16
16
  declare const NAME_STORE = "store";
17
17
  declare const NAME_ALL: Set<string>;
18
18
  declare const PROPERTY_LENGTH = "length";
19
19
  //#endregion
20
- export { ACTIVE, ARRAY_OFFSET, ARRAY_PEEK, ARRAY_THRESHOLD, BATCH, METHODS_AFFECTING_LENGTH, METHODS_UPDATE, NAME_ALL, NAME_ARRAY, NAME_COMPUTED, NAME_EFFECT, NAME_MORA, NAME_SIGNAL, NAME_STORE, PROPERTY_LENGTH };
20
+ export { ACTIVE, ARRAY_OFFSET, ARRAY_PEEK, ARRAY_THRESHOLD, BATCH, METHODS_AFFECTING_LENGTH, METHODS_UPDATE, NAME_ALL, NAME_ARRAY, NAME_COMPUTED, NAME_EFFECT, NAME_MORA, NAME_READONLY, NAME_SIGNAL, NAME_STORE, PROPERTY_LENGTH };
@@ -5,15 +5,16 @@ const ARRAY_OFFSET = 25;
5
5
  const ARRAY_PEEK = 10;
6
6
  const BATCH = {
7
7
  depth: 0,
8
+ flushing: false,
8
9
  handlers: /* @__PURE__ */ new Set()
9
10
  };
10
- const METHODS_AFFECTING_LENGTH = new Set([
11
+ const METHODS_AFFECTING_LENGTH = /* @__PURE__ */ new Set([
11
12
  "pop",
12
13
  "push",
13
14
  "shift",
14
15
  "unshift"
15
16
  ]);
16
- const METHODS_UPDATE = new Set([
17
+ const METHODS_UPDATE = /* @__PURE__ */ new Set([
17
18
  ...METHODS_AFFECTING_LENGTH,
18
19
  "copyWithin",
19
20
  "fill",
@@ -25,14 +26,16 @@ const NAME_ARRAY = "array";
25
26
  const NAME_COMPUTED = "computed";
26
27
  const NAME_EFFECT = "effect";
27
28
  const NAME_MORA = "$mora";
29
+ const NAME_READONLY = "readonly";
28
30
  const NAME_SIGNAL = "signal";
29
31
  const NAME_STORE = "store";
30
- const NAME_ALL = new Set([
32
+ const NAME_ALL = /* @__PURE__ */ new Set([
31
33
  NAME_ARRAY,
32
34
  NAME_COMPUTED,
35
+ NAME_READONLY,
33
36
  NAME_SIGNAL,
34
37
  NAME_STORE
35
38
  ]);
36
39
  const PROPERTY_LENGTH = "length";
37
40
  //#endregion
38
- export { ACTIVE, ARRAY_OFFSET, ARRAY_PEEK, ARRAY_THRESHOLD, BATCH, METHODS_AFFECTING_LENGTH, METHODS_UPDATE, NAME_ALL, NAME_ARRAY, NAME_COMPUTED, NAME_EFFECT, NAME_MORA, NAME_SIGNAL, NAME_STORE, PROPERTY_LENGTH };
41
+ export { ACTIVE, ARRAY_OFFSET, ARRAY_PEEK, ARRAY_THRESHOLD, BATCH, METHODS_AFFECTING_LENGTH, METHODS_UPDATE, NAME_ALL, NAME_ARRAY, NAME_COMPUTED, NAME_EFFECT, NAME_MORA, NAME_READONLY, NAME_SIGNAL, NAME_STORE, PROPERTY_LENGTH };
package/dist/effect.d.mts CHANGED
@@ -1,27 +1,14 @@
1
+ import { Effect, EffectState } from "./models.mjs";
1
2
  import { GenericCallback } from "@oscarpalmer/atoms/models";
2
-
3
3
  //#region src/effect.d.ts
4
- declare class Effect {
5
- /**
6
- * Internal name of the effect
7
- *
8
- * @internal
9
- */
10
- private readonly $mora;
11
- /**
12
- * Internal state of the effect
13
- *
14
- * @internal
15
- */
16
- private readonly state;
17
- constructor(callback: GenericCallback);
18
- }
19
- declare function runEffect(effect: Effect): void;
20
4
  /**
21
5
  * Create an effect
6
+ *
22
7
  * @param callback Callback for handling signal effects
23
8
  * @returns Effect
24
9
  */
25
10
  declare function effect(callback: GenericCallback): Effect;
11
+ declare function internalEffect(callback: GenericCallback): EffectState;
12
+ declare function runEffect(state: EffectState): void;
26
13
  //#endregion
27
- export { Effect, effect, runEffect };
14
+ export { effect, internalEffect, runEffect };
package/dist/effect.mjs CHANGED
@@ -1,28 +1,32 @@
1
- import { ACTIVE, NAME_EFFECT, NAME_MORA } from "./constants.mjs";
1
+ import { ACTIVE, NAME_EFFECT } from "./constants.mjs";
2
2
  //#region src/effect.ts
3
- var Effect = class {
4
- constructor(callback) {
5
- Object.defineProperty(this, NAME_MORA, { value: NAME_EFFECT });
6
- this.state = { callback };
7
- runEffect(this);
8
- }
9
- };
10
- function runEffect(effect) {
11
- const previousEffect = ACTIVE.effect;
12
- ACTIVE.effect = effect;
13
- try {
14
- effect.state.callback();
15
- } finally {
16
- ACTIVE.effect = previousEffect;
17
- }
18
- }
19
3
  /**
20
4
  * Create an effect
5
+ *
21
6
  * @param callback Callback for handling signal effects
22
7
  * @returns Effect
23
8
  */
24
9
  function effect(callback) {
25
- return typeof callback === "function" ? new Effect(callback) : void 0;
10
+ if (typeof callback !== "function") throw new TypeError("Effect callback must be a function");
11
+ return getEffect(callback)[0];
12
+ }
13
+ function getEffect(callback) {
14
+ const state = { callback };
15
+ const instance = Object.freeze({ $mora: NAME_EFFECT });
16
+ runEffect(state);
17
+ return [instance, state];
18
+ }
19
+ function internalEffect(callback) {
20
+ return getEffect(callback)[1];
21
+ }
22
+ function runEffect(state) {
23
+ const previousEffect = ACTIVE.effect;
24
+ ACTIVE.effect = state;
25
+ try {
26
+ state.callback();
27
+ } finally {
28
+ ACTIVE.effect = previousEffect;
29
+ }
26
30
  }
27
31
  //#endregion
28
- export { Effect, effect, runEffect };
32
+ export { effect, internalEffect, runEffect };
@@ -1,47 +1,48 @@
1
- import { Effect } from "../effect.mjs";
2
- import { Reactive } from "../value/reactive.mjs";
3
- import { Computed } from "../value/computed.mjs";
4
- import { Signal } from "../value/signal.mjs";
5
- import { ReactiveArray } from "../value/array.mjs";
6
- import { Store } from "../value/store.mjs";
1
+ import { Computed, Effect, Reactive, ReactiveArray, ReactiveStore, ReadonlySignal, Signal } from "../models.mjs";
7
2
  import { PlainObject } from "@oscarpalmer/atoms/models";
8
-
9
3
  //#region src/helpers/is.d.ts
10
- /**
11
- * Is the value a reactive array?
12
- * @param value Value to check
13
- * @returns True if value is a {@link ReactiveArray}
14
- */
15
- declare function isArray<Item>(value: unknown): value is ReactiveArray<Item>;
16
4
  /**
17
5
  * Is the value a computed signal?
6
+ *
18
7
  * @param value Value to check
19
8
  * @returns True if value is a {@link Computed}
20
9
  */
21
10
  declare function isComputed<Value>(value: unknown): value is Computed<Value>;
22
11
  /**
23
12
  * Is the value an effect?
13
+ *
24
14
  * @param value Value to check
25
15
  * @returns True if value is an {@link Effect}
26
16
  */
27
17
  declare function isEffect(value: unknown): value is Effect;
28
18
  /**
29
19
  * Is the value reactive?
20
+ *
30
21
  * @param value Value to check
31
22
  * @returns True if value is a {@link Reactive}
32
23
  */
33
- declare function isReactive<Value, Equal = Value>(value: unknown): value is Reactive<Value, Equal>;
24
+ declare function isReactive<Value>(value: unknown): value is Reactive<Value>;
34
25
  /**
35
26
  * Is the value a signal?
27
+ *
36
28
  * @param value Value to check
37
29
  * @returns True if value is a {@link Signal}
38
30
  */
39
31
  declare function isSignal<Value>(value: unknown): value is Signal<Value>;
32
+ /**
33
+ * Is the value a reactive array?
34
+ *
35
+ * @param value Value to check
36
+ * @returns True if value is a {@link ReactiveArray}
37
+ */
38
+ declare function isReactiveArray<Item>(value: unknown): value is ReactiveArray<Item>;
40
39
  /**
41
40
  * Is the value a reactive store?
41
+ *
42
42
  * @param value Value to check
43
43
  * @returns True if value is a {@link Store}
44
44
  */
45
- declare function isStore<Value extends PlainObject>(value: unknown): value is Store<Value>;
45
+ declare function isReactiveStore<Value extends PlainObject>(value: unknown): value is ReactiveStore<Value>;
46
+ declare function isReadonlySignal<Value>(value: unknown): value is ReadonlySignal<Value>;
46
47
  //#endregion
47
- export { isArray, isComputed, isEffect, isReactive, isSignal, isStore };
48
+ export { isComputed, isEffect, isReactive, isReactiveArray, isReactiveStore, isReadonlySignal, isSignal };
@@ -1,15 +1,8 @@
1
- import { NAME_ALL, NAME_ARRAY, NAME_COMPUTED, NAME_EFFECT, NAME_SIGNAL, NAME_STORE } from "../constants.mjs";
1
+ import { NAME_ALL, NAME_ARRAY, NAME_COMPUTED, NAME_EFFECT, NAME_READONLY, NAME_SIGNAL, NAME_STORE } from "../constants.mjs";
2
2
  //#region src/helpers/is.ts
3
3
  /**
4
- * Is the value a reactive array?
5
- * @param value Value to check
6
- * @returns True if value is a {@link ReactiveArray}
7
- */
8
- function isArray(value) {
9
- return isMora(value, NAME_ARRAY);
10
- }
11
- /**
12
4
  * Is the value a computed signal?
5
+ *
13
6
  * @param value Value to check
14
7
  * @returns True if value is a {@link Computed}
15
8
  */
@@ -18,6 +11,7 @@ function isComputed(value) {
18
11
  }
19
12
  /**
20
13
  * Is the value an effect?
14
+ *
21
15
  * @param value Value to check
22
16
  * @returns True if value is an {@link Effect}
23
17
  */
@@ -29,6 +23,7 @@ function isMora(value, name) {
29
23
  }
30
24
  /**
31
25
  * Is the value reactive?
26
+ *
32
27
  * @param value Value to check
33
28
  * @returns True if value is a {@link Reactive}
34
29
  */
@@ -37,6 +32,7 @@ function isReactive(value) {
37
32
  }
38
33
  /**
39
34
  * Is the value a signal?
35
+ *
40
36
  * @param value Value to check
41
37
  * @returns True if value is a {@link Signal}
42
38
  */
@@ -44,12 +40,25 @@ function isSignal(value) {
44
40
  return isMora(value, NAME_SIGNAL);
45
41
  }
46
42
  /**
43
+ * Is the value a reactive array?
44
+ *
45
+ * @param value Value to check
46
+ * @returns True if value is a {@link ReactiveArray}
47
+ */
48
+ function isReactiveArray(value) {
49
+ return isMora(value, NAME_ARRAY);
50
+ }
51
+ /**
47
52
  * Is the value a reactive store?
53
+ *
48
54
  * @param value Value to check
49
55
  * @returns True if value is a {@link Store}
50
56
  */
51
- function isStore(value) {
57
+ function isReactiveStore(value) {
52
58
  return isMora(value, NAME_STORE);
53
59
  }
60
+ function isReadonlySignal(value) {
61
+ return isMora(value, NAME_READONLY);
62
+ }
54
63
  //#endregion
55
- export { isArray, isComputed, isEffect, isReactive, isSignal, isStore };
64
+ export { isComputed, isEffect, isReactive, isReactiveArray, isReactiveStore, isReadonlySignal, isSignal };
@@ -1,14 +1,10 @@
1
- import { Computed } from "../value/computed.mjs";
2
- import { ReactiveState, SetValueInProxyParameters } from "../models.mjs";
3
- import { ReactiveArray } from "../value/array.mjs";
4
- import { Store } from "../value/store.mjs";
1
+ import { Computed, ComputedEffect, ReactiveArray, ReactiveState, ReactiveStore, SetValueInProxyParameters } from "../models.mjs";
5
2
  import { ArrayOrPlainObject, Key, PlainObject } from "@oscarpalmer/atoms/models";
6
-
7
3
  //#region src/helpers/proxy.d.ts
8
- declare function emityProxyValues<Value>(state: ReactiveState<Value, Value>, mapped: Map<Key, Computed<unknown>>): void;
9
- declare function emityProxyValues<Value>(state: ReactiveState<Value[], Value>, mapped: Map<Key, Computed<unknown>>): void;
10
- declare function getReactiveValueInProxy<Value>(array: ReactiveArray<Value>, mapped: Map<Key, Computed<unknown>>, index: number, isArray: true): Computed<unknown>;
11
- declare function getReactiveValueInProxy<Value extends PlainObject>(store: Store<Value>, mapped: Map<Key, Computed<unknown>>, key: Key, isArray: false): Computed<unknown>;
4
+ declare function emityProxyValues<Value>(state: ReactiveState<Value, Value>, mapped: Map<Key, [Computed<unknown>, ComputedEffect]>): void;
5
+ declare function emityProxyValues<Value>(state: ReactiveState<Value[], Value>, mapped: Map<Key, [Computed<unknown>, ComputedEffect]>): void;
6
+ declare function getReactiveValueInProxy<Value, Result = Value>(array: ReactiveArray<Value>, mapped: Map<Key, [Computed<unknown>, ComputedEffect]>, index: number, isArray: true): Computed<Result>;
7
+ declare function getReactiveValueInProxy<Value extends PlainObject>(store: ReactiveStore<Value>, mapped: Map<Key, [Computed<unknown>, ComputedEffect]>, key: Key, isArray: false): Computed<unknown>;
12
8
  declare function setProxyValue<Value, Item = Value>(array: boolean, state: ReactiveState<Value, Item>, isObject: (value: unknown) => value is Value | undefined, isProperty: (value: unknown) => boolean, setObject: (state: ReactiveState<Value, Item>, value: Value | undefined) => void, setProperty: (state: ReactiveState<Value, Item>, property: unknown, value: Item) => void, first?: unknown, second?: unknown): void;
13
9
  declare function setValueInProxy<Value extends ArrayOrPlainObject, Equal>(parameters: SetValueInProxyParameters<Value, Equal>): boolean;
14
10
  //#endregion
@@ -1,20 +1,20 @@
1
1
  import "../constants.mjs";
2
- import { computed } from "../value/computed.mjs";
3
2
  import { emitValue } from "./value.mjs";
3
+ import { internalComputed } from "../value/computed.mjs";
4
4
  //#region src/helpers/proxy.ts
5
5
  function emityProxyValues(state, mapped) {
6
6
  const values = [...mapped.values()];
7
7
  const { length } = values;
8
- for (let index = 0; index < length; index += 1) values[index].effect.dirty = true;
8
+ for (let index = 0; index < length; index += 1) values[index][1].dirty = true;
9
9
  emitValue(state);
10
10
  }
11
11
  function getReactiveValueInProxy(reactive, mapped, key, isArray) {
12
12
  let item = mapped.get(key);
13
13
  if (item == null) {
14
- item = computed(() => isArray ? reactive.get().at(key) : reactive.get()[key]);
14
+ item = internalComputed(() => isArray ? reactive.get().at(key) : reactive.get()[key]);
15
15
  mapped.set(key, item);
16
16
  }
17
- return item;
17
+ return item[0];
18
18
  }
19
19
  function setProxyValue(array, state, isObject, isProperty, setObject, setProperty, first, second) {
20
20
  if (array && first === "length") {
@@ -1,8 +1,8 @@
1
1
  import { ReactiveState } from "../models.mjs";
2
-
3
2
  //#region src/helpers/value.d.ts
4
3
  declare function emitValue<Value>(state: ReactiveState<Value, never>): void;
5
4
  declare function equalArrays<Value>(state: ReactiveState<Value[], Value>, first: Value[], second: Value[]): boolean;
6
- declare function getValue<Value>(state: ReactiveState<Value, never>): Value;
5
+ declare function getSimpleValue<Value>(state: ReactiveState<Value, never>): Value;
6
+ declare function handleSimpleValue<Value>(state: ReactiveState<Value, Value>, origin: Value | (() => Value | Promise<Value>) | Promise<Value>, setValue: (state: ReactiveState<Value, Value>, value: Value) => void, onAfter?: () => void): void;
7
7
  //#endregion
8
- export { emitValue, equalArrays, getValue };
8
+ export { emitValue, equalArrays, getSimpleValue, handleSimpleValue };
@@ -1,9 +1,8 @@
1
1
  import { ACTIVE, BATCH } from "../constants.mjs";
2
2
  import { flushHandlers } from "../batch.mjs";
3
- import { round } from "@oscarpalmer/atoms/math";
4
3
  //#region src/helpers/value.ts
5
4
  function emitValue(state) {
6
- for (const computed of state.computeds) computed.effect.dirty = true;
5
+ for (const computed of state.computeds) computed.dirty = true;
7
6
  for (const effect of state.effects) BATCH.handlers.add(effect);
8
7
  for (const [, subscription] of state.subscriptions) BATCH.handlers.add(subscription);
9
8
  if (BATCH.depth === 0) flushHandlers();
@@ -13,7 +12,7 @@ function equalArrays(state, first, second) {
13
12
  if (length !== second.length) return false;
14
13
  let offset = 0;
15
14
  if (length >= 100) {
16
- offset = round(length / 10);
15
+ offset = Math.round(length / 10);
17
16
  offset = offset > 25 ? 25 : offset;
18
17
  for (let index = 0; index < offset; index += 1) if (!state.equal(first[index], second[index])) return false;
19
18
  }
@@ -21,10 +20,28 @@ function equalArrays(state, first, second) {
21
20
  for (let index = offset; index < length; index += 1) if (!state.equal(first[index], second[index])) return false;
22
21
  return true;
23
22
  }
24
- function getValue(state) {
23
+ function getSimpleValue(state) {
25
24
  if (ACTIVE.computed != null) state.computeds.add(ACTIVE.computed);
26
25
  if (ACTIVE.effect != null) state.effects.add(ACTIVE.effect);
27
26
  return state.value;
28
27
  }
28
+ function handleSimpleValue(state, origin, setValue, onAfter) {
29
+ try {
30
+ let actual = typeof origin === "function" ? origin() : origin;
31
+ if (actual instanceof Promise) {
32
+ state.promise = actual;
33
+ actual.then((value) => {
34
+ if (actual === state.promise) {
35
+ state.promise = void 0;
36
+ setValue(state, value);
37
+ }
38
+ }).catch(() => {
39
+ if (actual === state.promise) state.promise = void 0;
40
+ });
41
+ } else setValue(state, actual);
42
+ } catch {} finally {
43
+ onAfter?.();
44
+ }
45
+ }
29
46
  //#endregion
30
- export { emitValue, equalArrays, getValue };
47
+ export { emitValue, equalArrays, getSimpleValue, handleSimpleValue };
package/dist/index.d.mts CHANGED
@@ -1,10 +1,9 @@
1
1
  import { startBatch, stopBatch } from "./batch.mjs";
2
- import { Effect, effect } from "./effect.mjs";
3
- import { Reactive } from "./value/reactive.mjs";
4
- import { Computed, computed } from "./value/computed.mjs";
5
- import { Signal, signal } from "./value/signal.mjs";
6
- import { Unsubscribe } from "./models.mjs";
7
- import { ReactiveArray, array } from "./value/array.mjs";
8
- import { Store, store } from "./value/store.mjs";
9
- import { isArray, isComputed, isEffect, isReactive, isSignal } from "./helpers/is.mjs";
10
- export { type Computed, type Effect, type Reactive, type ReactiveArray, type Signal, type Store, type Unsubscribe, array, computed, effect, isArray, isComputed, isEffect, isReactive, isSignal, signal, startBatch, stopBatch, store };
2
+ import { Computed, Effect, ReactiveArray, ReactiveStore, ReadonlySignal, Signal, Unsubscribe } from "./models.mjs";
3
+ import { effect } from "./effect.mjs";
4
+ import { isComputed, isEffect, isReactive, isReactiveArray, isReactiveStore, isReadonlySignal, isSignal } from "./helpers/is.mjs";
5
+ import { array } from "./value/array.mjs";
6
+ import { computed } from "./value/computed.mjs";
7
+ import { signal } from "./value/signal.mjs";
8
+ import { store } from "./value/store.mjs";
9
+ export { type Computed, type Effect, type ReactiveArray, type ReactiveStore, type ReadonlySignal, type Signal, type Unsubscribe, array, computed, effect, isComputed, isEffect, isReactive, isReactiveArray, isReactiveStore, isReadonlySignal, isSignal, signal, startBatch, stopBatch, store };
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { effect } from "./effect.mjs";
2
- import { isArray, isComputed, isEffect, isReactive, isSignal } from "./helpers/is.mjs";
3
2
  import { startBatch, stopBatch } from "./batch.mjs";
3
+ import { isComputed, isEffect, isReactive, isReactiveArray, isReactiveStore, isReadonlySignal, isSignal } from "./helpers/is.mjs";
4
4
  import { computed } from "./value/computed.mjs";
5
5
  import { signal } from "./value/signal.mjs";
6
6
  import { array } from "./value/array.mjs";
7
7
  import { store } from "./value/store.mjs";
8
- export { array, computed, effect, isArray, isComputed, isEffect, isReactive, isSignal, signal, startBatch, stopBatch, store };
8
+ export { array, computed, effect, isComputed, isEffect, isReactive, isReactiveArray, isReactiveStore, isReadonlySignal, isSignal, signal, startBatch, stopBatch, store };