@solidjs/signals 0.8.2 → 0.8.3

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.
@@ -39,7 +39,7 @@ export interface RawSignal<T> {
39
39
  _transition?: Transition;
40
40
  }
41
41
  export interface FirewallSignal<T> extends RawSignal<T> {
42
- _owner: Computed<any>;
42
+ _firewall: Computed<any>;
43
43
  _nextChild: FirewallSignal<unknown> | null;
44
44
  }
45
45
  export type Signal<T> = RawSignal<T> | FirewallSignal<T>;
@@ -72,6 +72,7 @@ export interface Root extends Owner {
72
72
  dispose(self?: boolean): void;
73
73
  }
74
74
  export declare function recompute(el: Computed<any>, create?: boolean): void;
75
+ export declare function dispose(node: Computed<unknown>): void;
75
76
  export declare function getNextChildId(owner: Owner): string;
76
77
  export declare function computed<T>(fn: (prev?: T) => T): Computed<T>;
77
78
  export declare function computed<T>(fn: (prev: T) => T, initialValue?: T, options?: SignalOptions<T>): Computed<T>;
@@ -16,4 +16,3 @@ export declare function effect<T>(compute: (prev: T | undefined) => T, effect: (
16
16
  render?: boolean;
17
17
  defer?: boolean;
18
18
  }): void;
19
- export declare function runEffect(this: Effect<any>): void;
@@ -1,6 +1,6 @@
1
1
  export { ContextNotFoundError, NoOwnerError, NotReadyError } from "./error.js";
2
2
  export { createContext, getContext, setContext, type Context, type ContextRecord } from "./context.js";
3
- export { getObserver, isEqual, untrack, getOwner, runWithOwner, createOwner, createRoot, computed, signal, asyncComputed, read, setSignal, onCleanup, getNextChildId, isPending, pending, staleValues, type Owner, type Computed, type Root, type Signal, type SignalOptions } from "./core.js";
3
+ export { getObserver, isEqual, untrack, getOwner, runWithOwner, createOwner, createRoot, computed, dispose, signal, asyncComputed, read, setSignal, onCleanup, getNextChildId, isPending, pending, staleValues, type Owner, type Computed, type Root, type Signal, type SignalOptions } from "./core.js";
4
4
  export { effect, type Effect } from "./effect.js";
5
5
  export { flush, Queue, type IQueue, type QueueCallback } from "./scheduler.js";
6
6
  export * from "./constants.js";
@@ -2,7 +2,6 @@ import type { Computed, Signal } from "./core.js";
2
2
  import { type Heap } from "./heap.js";
3
3
  export declare let clock: number;
4
4
  export declare let activeTransition: Transition | null;
5
- export declare let unobserved: Signal<unknown>[];
6
5
  export type QueueCallback = (type: number) => void;
7
6
  type QueueStub = {
8
7
  _queues: [QueueCallback[], QueueCallback[]];
@@ -149,7 +149,7 @@ export declare function createTrackedEffect(compute: () => void | (() => void),
149
149
  *
150
150
  * @description https://docs.solidjs.com/reference/secondary-primitives/create-reaction
151
151
  */
152
- export declare function createReaction(effect: EffectFunction<undefined> | EffectBundle<undefined>, options?: EffectOptions): void;
152
+ export declare function createReaction(effectFn: EffectFunction<undefined> | EffectBundle<undefined>, options?: EffectOptions): (tracking: () => void) => void;
153
153
  /**
154
154
  * Returns a promise of the resolved value of a reactive expression
155
155
  * @param fn a reactive expression to resolve
@@ -1,4 +1,4 @@
1
- import { type Signal } from "../core/index.js";
1
+ import { type Computed, type Signal } from "../core/index.js";
2
2
  export type Store<T> = Readonly<T>;
3
3
  export type StoreSetter<T> = (fn: (state: T) => T | void) => void;
4
4
  export type StoreOptions = {
@@ -8,7 +8,7 @@ export type StoreOptions = {
8
8
  type DataNode = Signal<any>;
9
9
  type DataNodes = Record<PropertyKey, DataNode>;
10
10
  export declare const $TRACK: unique symbol, $DEEP: unique symbol, $TARGET: unique symbol, $PROXY: unique symbol, $DELETED: unique symbol;
11
- export declare const STORE_VALUE = "v", STORE_OVERRIDE = "o", STORE_NODE = "n", STORE_HAS = "h", STORE_WRAP = "w", STORE_LOOKUP = "l";
11
+ export declare const STORE_VALUE = "v", STORE_OVERRIDE = "o", STORE_NODE = "n", STORE_HAS = "h", STORE_WRAP = "w", STORE_LOOKUP = "l", STORE_FIREWALL = "f";
12
12
  export type StoreNode = {
13
13
  [$PROXY]: any;
14
14
  [STORE_VALUE]: Record<PropertyKey, any>;
@@ -17,6 +17,7 @@ export type StoreNode = {
17
17
  [STORE_HAS]?: DataNodes;
18
18
  [STORE_WRAP]?: (value: any, target?: StoreNode) => any;
19
19
  [STORE_LOOKUP]?: WeakMap<any, any>;
20
+ [STORE_FIREWALL]?: () => Computed<any>;
20
21
  };
21
22
  export declare namespace SolidStore {
22
23
  interface Unwrappable {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidjs/signals",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",