@solidjs/signals 0.3.0 → 0.3.2
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/dev.js +145 -129
- package/dist/node.cjs +370 -355
- package/dist/prod.js +369 -353
- package/dist/types/core/boundaries.d.ts +12 -5
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/core/owner.d.ts +0 -5
- package/dist/types/core/scheduler.d.ts +6 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { Computation } from "./core.js";
|
|
2
2
|
import { type Effect } from "./effect.js";
|
|
3
3
|
import { Queue } from "./scheduler.js";
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class CollectionQueue extends Queue {
|
|
5
|
+
_collectionType: number;
|
|
5
6
|
_nodes: Set<Effect>;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
_disabled: Computation<boolean>;
|
|
8
|
+
constructor(type: number);
|
|
9
|
+
run(type: number): void;
|
|
10
|
+
notify(node: Effect, type: number, flags: number): boolean;
|
|
9
11
|
}
|
|
12
|
+
export declare enum BoundaryMode {
|
|
13
|
+
VISIBLE = "visible",
|
|
14
|
+
HIDDEN = "hidden"
|
|
15
|
+
}
|
|
16
|
+
export declare function createBoundary<T>(fn: () => T, condition: () => BoundaryMode): () => T | undefined;
|
|
10
17
|
export declare function createSuspense(fn: () => any, fallback: () => any): () => any;
|
|
11
|
-
export declare function createErrorBoundary<
|
|
18
|
+
export declare function createErrorBoundary<U>(fn: () => any, fallback: (error: unknown, reset: () => void) => U): () => any;
|
|
@@ -3,7 +3,7 @@ export { Owner, createContext, getContext, setContext, hasContext, getOwner, onC
|
|
|
3
3
|
export { Computation, getObserver, isEqual, untrack, hasUpdated, isPending, latest, flatten, UNCHANGED, compute, runWithObserver, type SignalOptions } from "./core.js";
|
|
4
4
|
export { Effect, EagerComputation } from "./effect.js";
|
|
5
5
|
export { flushSync, type IQueue, Queue } from "./scheduler.js";
|
|
6
|
-
export { createSuspense, createErrorBoundary } from "./boundaries.js";
|
|
6
|
+
export { createSuspense, createErrorBoundary, createBoundary, type BoundaryMode } from "./boundaries.js";
|
|
7
7
|
export { SUPPORTS_PROXY } from "./constants.js";
|
|
8
8
|
export { tryCatch, type TryCatchResult } from "./utils.js";
|
|
9
9
|
export * from "./flags.js";
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
*
|
|
28
28
|
* Note that the owner tree is largely orthogonal to the reactivity tree, and is much closer to the component tree.
|
|
29
29
|
*/
|
|
30
|
-
import { type ErrorHandler } from "./error.js";
|
|
31
30
|
import { type IQueue } from "./scheduler.js";
|
|
32
31
|
export type ContextRecord = Record<string | symbol, unknown>;
|
|
33
32
|
export interface Disposable {
|
|
@@ -45,9 +44,7 @@ export declare class Owner {
|
|
|
45
44
|
_state: number;
|
|
46
45
|
_disposal: Disposable | Disposable[] | null;
|
|
47
46
|
_context: ContextRecord;
|
|
48
|
-
_handlers: ErrorHandler[] | null;
|
|
49
47
|
_queue: IQueue;
|
|
50
|
-
_siblingCount: number | null;
|
|
51
48
|
_childCount: number;
|
|
52
49
|
id: string | null;
|
|
53
50
|
constructor(id?: string | null, skipAppend?: boolean);
|
|
@@ -55,8 +52,6 @@ export declare class Owner {
|
|
|
55
52
|
dispose(this: Owner, self?: boolean): void;
|
|
56
53
|
_disposeNode(): void;
|
|
57
54
|
emptyDisposal(): void;
|
|
58
|
-
addErrorHandler(handler: ErrorHandler): void;
|
|
59
|
-
handleError(error: unknown): void;
|
|
60
55
|
getNextChildId(): string;
|
|
61
56
|
}
|
|
62
57
|
export interface Context<T> {
|
|
@@ -9,17 +9,21 @@ export interface IQueue {
|
|
|
9
9
|
addChild(child: IQueue): void;
|
|
10
10
|
removeChild(child: IQueue): void;
|
|
11
11
|
created: number;
|
|
12
|
+
notify(...args: any[]): boolean;
|
|
13
|
+
_parent: IQueue | null;
|
|
12
14
|
}
|
|
13
15
|
export declare class Queue implements IQueue {
|
|
16
|
+
_parent: IQueue | null;
|
|
14
17
|
_running: boolean;
|
|
15
|
-
_queues: [
|
|
18
|
+
_queues: [Effect[], Effect[]];
|
|
16
19
|
_children: IQueue[];
|
|
17
20
|
created: number;
|
|
18
21
|
enqueue<T extends Computation | Effect>(type: number, node: T): void;
|
|
19
|
-
run(type: number):
|
|
22
|
+
run(type: number): void;
|
|
20
23
|
flush(): void;
|
|
21
24
|
addChild(child: IQueue): void;
|
|
22
25
|
removeChild(child: IQueue): void;
|
|
26
|
+
notify(...args: any[]): boolean;
|
|
23
27
|
}
|
|
24
28
|
export declare const globalQueue: Queue;
|
|
25
29
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { Computation, ContextNotFoundError, NoOwnerError, NotReadyError, Owner, Queue, createContext, flatten, flushSync, getContext, setContext, hasContext, getOwner, onCleanup, getObserver, isEqual, untrack, hasUpdated, isPending, latest, tryCatch, runWithObserver, createErrorBoundary, createSuspense, SUPPORTS_PROXY } from "./core/index.js";
|
|
2
|
-
export type { ErrorHandler, SignalOptions, Context, ContextRecord, Disposable, IQueue } from "./core/index.js";
|
|
1
|
+
export { Computation, ContextNotFoundError, NoOwnerError, NotReadyError, Owner, Queue, createContext, flatten, flushSync, getContext, setContext, hasContext, getOwner, onCleanup, getObserver, isEqual, untrack, hasUpdated, isPending, latest, tryCatch, runWithObserver, createErrorBoundary, createSuspense, createBoundary, SUPPORTS_PROXY } from "./core/index.js";
|
|
2
|
+
export type { ErrorHandler, SignalOptions, BoundaryMode, TryCatchResult, Context, ContextRecord, Disposable, IQueue } from "./core/index.js";
|
|
3
3
|
export { mapArray, repeat, type Maybe } from "./map.js";
|
|
4
4
|
export * from "./signals.js";
|
|
5
5
|
export * from "./store/index.js";
|