@solidjs/signals 0.7.3 → 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.
@@ -79,6 +79,7 @@ export declare class Computation<T = any> extends Owner implements SourceType, O
79
79
  _cloned?: Computation;
80
80
  _optimistic?: (() => void) & {
81
81
  _transition?: Transition;
82
+ _init?: () => void;
82
83
  };
83
84
  constructor(initialValue: T | undefined, compute: null | ((p?: T) => T), options?: SignalOptions<T>);
84
85
  _read(): T;
@@ -1,4 +1,5 @@
1
1
  export declare class NotReadyError extends Error {
2
+ constructor(node: any);
2
3
  }
3
4
  export declare class NoOwnerError extends Error {
4
5
  constructor();
@@ -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, transition, ActiveTransition, type IQueue } from "./scheduler.js";
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;
@@ -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, transition, SUPPORTS_PROXY } from "./core/index.js";
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";
@@ -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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidjs/signals",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",