@solidjs/signals 0.0.4 → 0.0.6

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.
@@ -2,7 +2,8 @@ export { ContextNotFoundError, NoOwnerError, NotReadyError, type ErrorHandler }
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 { flushSync, createBoundary, type IQueue, Queue } from "./scheduler.js";
5
+ export { flushSync, createBoundary, queueTask, type IQueue, Queue } from "./scheduler.js";
6
6
  export { createSuspense } from "./suspense.js";
7
7
  export { SUPPORTS_PROXY } from "./constants.js";
8
8
  export * from "./flags.js";
9
+ export { flatten } from "./utils.js";
@@ -23,4 +23,5 @@ export declare const globalQueue: Queue;
23
23
  * the queue synchronously to get the latest updates by calling `flushSync()`.
24
24
  */
25
25
  export declare function flushSync(): void;
26
+ export declare function queueTask(fn: () => void): void;
26
27
  export declare function createBoundary<T>(fn: () => T, queue: IQueue): T;
@@ -1,5 +1,5 @@
1
1
  import { Computation } from "./core.js";
2
- import type { Effect } from "./effect.js";
2
+ import { type Effect } from "./effect.js";
3
3
  import { Queue } from "./scheduler.js";
4
4
  export declare class SuspenseQueue extends Queue {
5
5
  _nodes: Set<Effect>;
@@ -8,4 +8,4 @@ export declare class SuspenseQueue extends Queue {
8
8
  run(type: number): void;
9
9
  _update(node: Effect): void;
10
10
  }
11
- export declare function createSuspense(fn: () => any, fallbackFn: () => any): () => any;
11
+ export declare function createSuspense(fn: () => any, fallback: () => any): () => any;
@@ -0,0 +1,5 @@
1
+ export declare function isUndefined(value: any): value is undefined;
2
+ export declare function flatten(children: any, options?: {
3
+ skipNonRendered?: boolean;
4
+ doNotUnwrap?: boolean;
5
+ }): any;
@@ -1,4 +1,4 @@
1
- export { Computation, ContextNotFoundError, NoOwnerError, NotReadyError, Owner, Queue, createContext, flushSync, createBoundary, getContext, setContext, hasContext, getOwner, onCleanup, getObserver, isEqual, untrack, hasUpdated, isPending, latest, createSuspense, SUPPORTS_PROXY } from "./core/index.js";
1
+ export { Computation, ContextNotFoundError, NoOwnerError, NotReadyError, Owner, Queue, createContext, flatten, flushSync, createBoundary, getContext, setContext, hasContext, getOwner, onCleanup, getObserver, isEqual, untrack, hasUpdated, isPending, latest, createSuspense, SUPPORTS_PROXY } from "./core/index.js";
2
2
  export type { ErrorHandler, SignalOptions, Context, ContextRecord, Disposable, IQueue } from "./core/index.js";
3
3
  export { mapArray, type Maybe } from "./map.js";
4
4
  export * from "./signals.js";
@@ -130,7 +130,12 @@ export declare function createRoot<T>(init: ((dispose: () => void) => T) | (() =
130
130
  */
131
131
  export declare function runWithOwner<T>(owner: Owner | null, run: () => T): T | undefined;
132
132
  /**
133
- * Runs the given function when an error is thrown in a child owner. If the error is thrown again
134
- * inside the error handler, it will trigger the next available parent owner handler.
133
+ * Switches to fallback whenever an error is thrown within the context of the child scopes
134
+ * @param fn boundary for the error
135
+ * @param fallback an error handler that receives the error
136
+ *
137
+ * * If the error is thrown again inside the error handler, it will trigger the next available parent handler
138
+ *
139
+ * @description https://docs.solidjs.com/reference/reactive-utilities/catch-error
135
140
  */
136
- export declare function catchError<T>(fn: () => T, handler: (error: unknown) => void): void;
141
+ export declare function createErrorBoundary<T, U>(fn: () => T, fallback: (error: unknown, reset: () => void) => U): Accessor<T | U>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidjs/signals",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- export declare function isUndefined(value: any): value is undefined;