alien-signals
Advanced tools
Comparing version 1.0.1 to 1.1.0-alpha.0
{ | ||
"name": "alien-signals", | ||
"version": "1.0.1", | ||
"version": "1.1.0-alpha.0", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -0,6 +1,7 @@ | ||
export * as pullmodel from './pullmodel/index.js'; | ||
export * from './system.js'; | ||
type WriteableSignal<T> = { | ||
interface WriteableSignal<T> { | ||
(): T; | ||
(value: T): void; | ||
}; | ||
} | ||
export declare function startBatch(): void; | ||
@@ -7,0 +8,0 @@ export declare function endBatch(): void; |
export interface Dependency { | ||
version?: number; | ||
subs: Link | undefined; | ||
@@ -11,2 +12,3 @@ subsTail: Link | undefined; | ||
export interface Link { | ||
version?: number; | ||
dep: Dependency | (Dependency & Subscriber); | ||
@@ -29,3 +31,3 @@ sub: Subscriber | (Dependency & Subscriber); | ||
} | ||
export declare function createReactiveSystem({ updateComputed, notifyEffect, }: { | ||
export declare function createReactiveSystem({ updateComputed, notifyEffect, checkDirty, }: { | ||
/** | ||
@@ -54,2 +56,13 @@ * Updates the computed subscriber's value and returns whether it changed. | ||
notifyEffect(effect: Subscriber): boolean; | ||
/** | ||
* Recursively checks and updates all computed subscribers marked as pending. | ||
* | ||
* It traverses the linked structure using a stack mechanism. For each computed | ||
* subscriber in a pending state, updateComputed is called and shallowPropagate | ||
* is triggered if a value changes. Returns whether any updates occurred. | ||
* | ||
* @param link - The starting link representing a sequence of pending computeds. | ||
* @returns `true` if a computed was updated, otherwise `false`. | ||
*/ | ||
checkDirty?(link: Link): boolean; | ||
}): { | ||
@@ -134,2 +147,5 @@ /** | ||
processEffectNotifications(): void; | ||
checkDirty: (link: Link) => boolean; | ||
shallowPropagate: (link: Link) => void; | ||
isValidLink: (checkLink: Link, sub: Subscriber) => boolean; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
86019
28
2485
2