@solidjs/signals 0.7.2 → 0.7.4
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 +87 -46
- package/dist/node.cjs +421 -378
- package/dist/prod.js +418 -377
- package/dist/types/core/core.d.ts +4 -1
- package/dist/types/core/error.d.ts +1 -0
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/core/scheduler.d.ts +2 -11
- package/dist/types/index.d.ts +1 -1
- package/dist/types/signals.d.ts +10 -0
- package/package.json +1 -1
|
@@ -77,7 +77,10 @@ export declare class Computation<T = any> extends Owner implements SourceType, O
|
|
|
77
77
|
_forceNotify: boolean;
|
|
78
78
|
_transition?: Transition | undefined;
|
|
79
79
|
_cloned?: Computation;
|
|
80
|
-
_optimistic?:
|
|
80
|
+
_optimistic?: (() => void) & {
|
|
81
|
+
_transition?: Transition;
|
|
82
|
+
_init?: () => void;
|
|
83
|
+
};
|
|
81
84
|
constructor(initialValue: T | undefined, compute: null | ((p?: T) => T), options?: SignalOptions<T>);
|
|
82
85
|
_read(): T;
|
|
83
86
|
/**
|
|
@@ -2,6 +2,6 @@ export { ContextNotFoundError, NoOwnerError, NotReadyError } from "./error.js";
|
|
|
2
2
|
export { Owner, createContext, getContext, setContext, hasContext, getOwner, onCleanup, type Context, type ContextRecord, type Disposable } from "./owner.js";
|
|
3
3
|
export { Computation, getObserver, isEqual, untrack, hasUpdated, isPending, latest, UNCHANGED, compute, type SignalOptions } from "./core.js";
|
|
4
4
|
export { Effect, EagerComputation } from "./effect.js";
|
|
5
|
-
export { flush, Queue, incrementClock,
|
|
5
|
+
export { flush, Queue, incrementClock, Transition, ActiveTransition, cloneGraph, type IQueue } from "./scheduler.js";
|
|
6
6
|
export * from "./constants.js";
|
|
7
7
|
export * from "./flags.js";
|
|
@@ -54,8 +54,9 @@ export declare class Transition implements IQueue {
|
|
|
54
54
|
_running: boolean;
|
|
55
55
|
_scheduled: boolean;
|
|
56
56
|
_cloned: Queue;
|
|
57
|
+
_signal: Computation;
|
|
57
58
|
created: number;
|
|
58
|
-
constructor();
|
|
59
|
+
constructor(signal: Computation);
|
|
59
60
|
enqueue(type: number, fn: QueueCallback): void;
|
|
60
61
|
run(type: number): void;
|
|
61
62
|
flush(): void;
|
|
@@ -69,16 +70,6 @@ export declare class Transition implements IQueue {
|
|
|
69
70
|
_transition?: Transition;
|
|
70
71
|
}): void;
|
|
71
72
|
}
|
|
72
|
-
/**
|
|
73
|
-
* Runs the given function in a transition scope, allowing for batch updates and optimizations.
|
|
74
|
-
* This is useful for grouping multiple state updates together to avoid unnecessary re-renders.
|
|
75
|
-
*
|
|
76
|
-
* @param fn A function that receives a resume function to continue the transition.
|
|
77
|
-
* The resume function can be called with another function to continue the transition.
|
|
78
|
-
*
|
|
79
|
-
* @description https://docs.solidjs.com/reference/advanced-reactivity/transition
|
|
80
|
-
*/
|
|
81
|
-
export declare function transition(fn: (resume: (fn: () => any | Promise<any>) => void) => any | Promise<any> | Iterable<any>): void;
|
|
82
73
|
export declare function cloneGraph(node: Computation): Computation;
|
|
83
74
|
export declare function getOGSource<T extends Computation>(input: T): T;
|
|
84
75
|
export declare function getTransitionSource<T extends Computation>(input: T): T;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Computation, ContextNotFoundError, NoOwnerError, NotReadyError, Owner, Queue, createContext, flush, getContext, setContext, hasContext, getOwner, onCleanup, getObserver, isEqual, untrack, hasUpdated, isPending, latest,
|
|
1
|
+
export { Computation, ContextNotFoundError, NoOwnerError, NotReadyError, Owner, Queue, createContext, flush, getContext, setContext, hasContext, getOwner, onCleanup, getObserver, isEqual, untrack, hasUpdated, isPending, latest, SUPPORTS_PROXY } from "./core/index.js";
|
|
2
2
|
export type { SignalOptions, Context, ContextRecord, Disposable, IQueue } from "./core/index.js";
|
|
3
3
|
export { mapArray, repeat, type Maybe } from "./map.js";
|
|
4
4
|
export * from "./signals.js";
|
package/dist/types/signals.d.ts
CHANGED
|
@@ -177,6 +177,16 @@ export declare function resolve<T>(fn: () => T): Promise<T>;
|
|
|
177
177
|
export declare function createOptimistic<T>(): Signal<T | undefined>;
|
|
178
178
|
export declare function createOptimistic<T>(value: Exclude<T, Function>, options?: SignalOptions<T>): Signal<T>;
|
|
179
179
|
export declare function createOptimistic<T>(fn: ComputeFunction<T>, initialValue?: T, options?: SignalOptions<T>): Signal<T>;
|
|
180
|
+
/**
|
|
181
|
+
* Runs the given function in a transition scope, allowing for batch updates and optimizations.
|
|
182
|
+
* This is useful for grouping multiple state updates together to avoid unnecessary re-renders.
|
|
183
|
+
*
|
|
184
|
+
* @param fn A function that receives a resume function to continue the transition.
|
|
185
|
+
* The resume function can be called with another function to continue the transition.
|
|
186
|
+
*
|
|
187
|
+
* @description https://docs.solidjs.com/reference/advanced-reactivity/transition
|
|
188
|
+
*/
|
|
189
|
+
export declare function transition(fn: (resume: (fn: () => any | Promise<any>) => void) => any | Promise<any> | Iterable<any>): void;
|
|
180
190
|
/** Allows the user to mark a state change as non-urgent.
|
|
181
191
|
*
|
|
182
192
|
* @see {@link https://docs.solidjs.com/reference/advanced-reactivity/transition}
|