Skip to content

feat: Signal interface#104

Open
mfulton26 wants to merge 1 commit intostackblitz:masterfrom
mfulton26:feat--Signal-interface
Open

feat: Signal interface#104
mfulton26 wants to merge 1 commit intostackblitz:masterfrom
mfulton26:feat--Signal-interface

Conversation

@mfulton26
Copy link

improves inferred types and developer experience for signals

before:

completed: {
    (): boolean;
    (value: boolean): void;
}

after:

completed: Signal<boolean>

improves inferred types and developer experience for signals

before:

```
completed: {
    (): boolean;
    (value: boolean): void;
}
```

after:

```
completed: Signal<boolean>
```
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@mfulton26
Copy link
Author

❓ Would it be feasible to have interfaces for Computed, Effect, and EffectScope too? If so, it could be valuable to have is{Signal,Computed,Effect,EffectScope}() be typed as type assertion functions (e.g. something like function isSignal<T = void>(fn: () => T): fn is Signal<T>).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant