@oscarpalmer/mora 0.11.1 → 0.12.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.
- package/dist/computed.cjs +1 -1
- package/dist/computed.js +1 -1
- package/dist/mora.full.js +2 -2
- package/dist/signal.cjs +1 -1
- package/dist/signal.js +1 -1
- package/package.json +1 -1
- package/src/computed.ts +1 -1
- package/src/index.ts +2 -0
- package/src/reactive.ts +5 -0
- package/src/signal.ts +1 -1
- package/types/batch.d.cts +5 -1
- package/types/computed.d.cts +5 -1
- package/types/computed.d.ts +1 -1
- package/types/index.d.cts +7 -3
- package/types/index.d.ts +1 -0
- package/types/is.d.cts +6 -2
- package/types/reactive.d.cts +5 -1
- package/types/reactive.d.ts +4 -0
- package/types/signal.d.cts +6 -2
- package/types/signal.d.ts +1 -1
- package/types/subscription.d.cts +5 -1
package/dist/computed.cjs
CHANGED
package/dist/computed.js
CHANGED
package/dist/mora.full.js
CHANGED
|
@@ -179,7 +179,7 @@ class Computed extends Reactive {
|
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
182
|
-
*
|
|
182
|
+
* @inheritdoc
|
|
183
183
|
*/
|
|
184
184
|
get() {
|
|
185
185
|
if (activeComputed != null && activeComputed !== this) {
|
|
@@ -206,7 +206,7 @@ class Signal extends Reactive {
|
|
|
206
206
|
super('signal', value);
|
|
207
207
|
}
|
|
208
208
|
/**
|
|
209
|
-
*
|
|
209
|
+
* @inheritdoc
|
|
210
210
|
*/
|
|
211
211
|
get() {
|
|
212
212
|
if (activeComputed != null) {
|
package/dist/signal.cjs
CHANGED
package/dist/signal.js
CHANGED
package/package.json
CHANGED
package/src/computed.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,4 +2,6 @@ export {startBatch, stopBatch} from './batch';
|
|
|
2
2
|
export {computed, type Computed} from './computed';
|
|
3
3
|
export {effect, type Effect} from './effect';
|
|
4
4
|
export {isComputed, isEffect, isReactive, isSignal} from './is';
|
|
5
|
+
export type {Reactive} from './reactive';
|
|
5
6
|
export {signal, type Signal} from './signal';
|
|
7
|
+
|
package/src/reactive.ts
CHANGED
package/src/signal.ts
CHANGED
package/types/batch.d.cts
CHANGED
|
@@ -10,13 +10,17 @@ declare class Computed<Value> extends Reactive<Value> {
|
|
|
10
10
|
private readonly effect;
|
|
11
11
|
constructor(callback: () => Value);
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* @inheritdoc
|
|
14
14
|
*/
|
|
15
15
|
get(): Value;
|
|
16
16
|
}
|
|
17
17
|
declare abstract class Reactive<Value> {
|
|
18
18
|
protected readonly state: ReactiveState<Value>;
|
|
19
19
|
constructor(name: string, value: Value);
|
|
20
|
+
/**
|
|
21
|
+
* Get the value
|
|
22
|
+
*/
|
|
23
|
+
abstract get(): Value;
|
|
20
24
|
/**
|
|
21
25
|
* Get the value _(without reactivity)_
|
|
22
26
|
*/
|
package/types/computed.d.cts
CHANGED
|
@@ -19,7 +19,7 @@ export declare class Computed<Value> extends Reactive<Value> {
|
|
|
19
19
|
private readonly effect;
|
|
20
20
|
constructor(callback: () => Value);
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* @inheritdoc
|
|
23
23
|
*/
|
|
24
24
|
get(): Value;
|
|
25
25
|
}
|
|
@@ -30,6 +30,10 @@ export declare function computed<Value>(callback: () => Value): Computed<Value>;
|
|
|
30
30
|
declare abstract class Reactive<Value> {
|
|
31
31
|
protected readonly state: ReactiveState<Value>;
|
|
32
32
|
constructor(name: string, value: Value);
|
|
33
|
+
/**
|
|
34
|
+
* Get the value
|
|
35
|
+
*/
|
|
36
|
+
abstract get(): Value;
|
|
33
37
|
/**
|
|
34
38
|
* Get the value _(without reactivity)_
|
|
35
39
|
*/
|
package/types/computed.d.ts
CHANGED
package/types/index.d.cts
CHANGED
|
@@ -14,7 +14,7 @@ export declare class Computed<Value> extends Reactive<Value> {
|
|
|
14
14
|
private readonly effect;
|
|
15
15
|
constructor(callback: () => Value);
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* @inheritdoc
|
|
18
18
|
*/
|
|
19
19
|
get(): Value;
|
|
20
20
|
}
|
|
@@ -22,9 +22,13 @@ export declare class Computed<Value> extends Reactive<Value> {
|
|
|
22
22
|
* Create a computed value
|
|
23
23
|
*/
|
|
24
24
|
export declare function computed<Value>(callback: () => Value): Computed<Value>;
|
|
25
|
-
declare abstract class Reactive<Value> {
|
|
25
|
+
export declare abstract class Reactive<Value> {
|
|
26
26
|
protected readonly state: ReactiveState<Value>;
|
|
27
27
|
constructor(name: string, value: Value);
|
|
28
|
+
/**
|
|
29
|
+
* Get the value
|
|
30
|
+
*/
|
|
31
|
+
abstract get(): Value;
|
|
28
32
|
/**
|
|
29
33
|
* Get the value _(without reactivity)_
|
|
30
34
|
*/
|
|
@@ -56,7 +60,7 @@ export type Unsubscribe = () => void;
|
|
|
56
60
|
export declare class Signal<Value> extends Reactive<Value> {
|
|
57
61
|
constructor(value: Value);
|
|
58
62
|
/**
|
|
59
|
-
*
|
|
63
|
+
* @inheritdoc
|
|
60
64
|
*/
|
|
61
65
|
get(): Value;
|
|
62
66
|
/**
|
package/types/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { startBatch, stopBatch } from './batch';
|
|
|
2
2
|
export { computed, type Computed } from './computed';
|
|
3
3
|
export { effect, type Effect } from './effect';
|
|
4
4
|
export { isComputed, isEffect, isReactive, isSignal } from './is';
|
|
5
|
+
export type { Reactive } from './reactive';
|
|
5
6
|
export { signal, type Signal } from './signal';
|
package/types/is.d.cts
CHANGED
|
@@ -10,13 +10,17 @@ declare class Computed<Value> extends Reactive<Value> {
|
|
|
10
10
|
private readonly effect;
|
|
11
11
|
constructor(callback: () => Value);
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* @inheritdoc
|
|
14
14
|
*/
|
|
15
15
|
get(): Value;
|
|
16
16
|
}
|
|
17
17
|
declare abstract class Reactive<Value> {
|
|
18
18
|
protected readonly state: ReactiveState<Value>;
|
|
19
19
|
constructor(name: string, value: Value);
|
|
20
|
+
/**
|
|
21
|
+
* Get the value
|
|
22
|
+
*/
|
|
23
|
+
abstract get(): Value;
|
|
20
24
|
/**
|
|
21
25
|
* Get the value _(without reactivity)_
|
|
22
26
|
*/
|
|
@@ -48,7 +52,7 @@ export type Unsubscribe = () => void;
|
|
|
48
52
|
declare class Signal<Value> extends Reactive<Value> {
|
|
49
53
|
constructor(value: Value);
|
|
50
54
|
/**
|
|
51
|
-
*
|
|
55
|
+
* @inheritdoc
|
|
52
56
|
*/
|
|
53
57
|
get(): Value;
|
|
54
58
|
/**
|
package/types/reactive.d.cts
CHANGED
|
@@ -10,13 +10,17 @@ declare class Computed<Value> extends Reactive<Value> {
|
|
|
10
10
|
private readonly effect;
|
|
11
11
|
constructor(callback: () => Value);
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* @inheritdoc
|
|
14
14
|
*/
|
|
15
15
|
get(): Value;
|
|
16
16
|
}
|
|
17
17
|
export declare abstract class Reactive<Value> {
|
|
18
18
|
protected readonly state: ReactiveState<Value>;
|
|
19
19
|
constructor(name: string, value: Value);
|
|
20
|
+
/**
|
|
21
|
+
* Get the value
|
|
22
|
+
*/
|
|
23
|
+
abstract get(): Value;
|
|
20
24
|
/**
|
|
21
25
|
* Get the value _(without reactivity)_
|
|
22
26
|
*/
|
package/types/reactive.d.ts
CHANGED
|
@@ -4,6 +4,10 @@ import { type Subscription, type Unsubscribe } from './subscription';
|
|
|
4
4
|
export declare abstract class Reactive<Value> {
|
|
5
5
|
protected readonly state: ReactiveState<Value>;
|
|
6
6
|
constructor(name: string, value: Value);
|
|
7
|
+
/**
|
|
8
|
+
* Get the value
|
|
9
|
+
*/
|
|
10
|
+
abstract get(): Value;
|
|
7
11
|
/**
|
|
8
12
|
* Get the value _(without reactivity)_
|
|
9
13
|
*/
|
package/types/signal.d.cts
CHANGED
|
@@ -10,13 +10,17 @@ declare class Computed<Value> extends Reactive<Value> {
|
|
|
10
10
|
private readonly effect;
|
|
11
11
|
constructor(callback: () => Value);
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* @inheritdoc
|
|
14
14
|
*/
|
|
15
15
|
get(): Value;
|
|
16
16
|
}
|
|
17
17
|
declare abstract class Reactive<Value> {
|
|
18
18
|
protected readonly state: ReactiveState<Value>;
|
|
19
19
|
constructor(name: string, value: Value);
|
|
20
|
+
/**
|
|
21
|
+
* Get the value
|
|
22
|
+
*/
|
|
23
|
+
abstract get(): Value;
|
|
20
24
|
/**
|
|
21
25
|
* Get the value _(without reactivity)_
|
|
22
26
|
*/
|
|
@@ -48,7 +52,7 @@ export type Unsubscribe = () => void;
|
|
|
48
52
|
export declare class Signal<Value> extends Reactive<Value> {
|
|
49
53
|
constructor(value: Value);
|
|
50
54
|
/**
|
|
51
|
-
*
|
|
55
|
+
* @inheritdoc
|
|
52
56
|
*/
|
|
53
57
|
get(): Value;
|
|
54
58
|
/**
|
package/types/signal.d.ts
CHANGED
package/types/subscription.d.cts
CHANGED
|
@@ -10,13 +10,17 @@ declare class Computed<Value> extends Reactive<Value> {
|
|
|
10
10
|
private readonly effect;
|
|
11
11
|
constructor(callback: () => Value);
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* @inheritdoc
|
|
14
14
|
*/
|
|
15
15
|
get(): Value;
|
|
16
16
|
}
|
|
17
17
|
declare abstract class Reactive<Value> {
|
|
18
18
|
protected readonly state: ReactiveState<Value>;
|
|
19
19
|
constructor(name: string, value: Value);
|
|
20
|
+
/**
|
|
21
|
+
* Get the value
|
|
22
|
+
*/
|
|
23
|
+
abstract get(): Value;
|
|
20
24
|
/**
|
|
21
25
|
* Get the value _(without reactivity)_
|
|
22
26
|
*/
|