1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-29 07:00:16 +02:00

🐛 Signal&ddeSignal type

- in elements use ddSignal for better compatibility with ponetially another implementation
- fixed incorrect detection of `S(()=> any)` and `S(non-function, any)`
This commit is contained in:
2024-06-03 16:23:05 +02:00
parent 8dc3e49d98
commit 4f788459b9
2 changed files with 13 additions and 13 deletions

8
signals.d.ts vendored
View File

@@ -6,6 +6,10 @@ type Actions<V>= Record<string | SymbolOnclear, Action<V>>;
type OnListenerOptions= Pick<AddEventListenerOptions, "signal"> & { first_time?: boolean };
interface signal{
_: Symbol
/**
* Computations signal. This creates a signal which is computed from other signals.
* */
<V extends ()=> any>(computation: V): Signal<ReturnType<V>, {}>
/**
* Simple example:
* ```js
@@ -31,10 +35,6 @@ interface signal{
* by `S.clear`.
* */
<V, A extends Actions<V>>(value: V, actions?: A): Signal<V, A>;
/**
* Computations signal. This creates a signal which is computed from other signals.
* */
<V>(computation: ()=> V): Signal<V, {}>
action<S extends Signal<any, Actions<any>>, A extends (S extends Signal<any, infer A> ? A : never), N extends keyof A>(
signal: S,
name: N,