@manyducks.co/dolla 1.0.0 → 1.1.0
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/lib/index.js +6 -7
- package/lib/index.js.map +2 -2
- package/lib/signals.d.ts +4 -10
- package/package.json +1 -1
package/lib/signals.d.ts
CHANGED
|
@@ -41,16 +41,10 @@ export interface Signal<T> {
|
|
|
41
41
|
*/
|
|
42
42
|
watch(callback: (value: T) => void, options?: SignalWatchOptions<T>): StopFunction;
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
(value: O): void;
|
|
49
|
-
/**
|
|
50
|
-
* Takes a callback that receives the signal's current value and returns a new one.
|
|
51
|
-
*/
|
|
52
|
-
(callback: (current: I) => O): void;
|
|
53
|
-
}
|
|
44
|
+
/** A new value for a signal, or a callback that receives the current value and returns a new one. */
|
|
45
|
+
export type SetSignalAction<I, O = I> = O | ((current: I) => O);
|
|
46
|
+
/** Callback that updates the value of a signal. */
|
|
47
|
+
export type SignalSetter<I, O = I> = (value: SetSignalAction<I, O>) => void;
|
|
54
48
|
export type MaybeSignal<T> = Signal<T> | T;
|
|
55
49
|
/**
|
|
56
50
|
* A signal and setter in one. Useful for passing signals that are intended to be updated by subviews.
|