79354401

Date: 2025-01-14 08:47:39
Score: 1
Natty:
Report link

I encountered the same issue. Take a look at the function signature:

export declare function toSignal<T>(source: Observable<T> | Subscribable<T>): Signal<T | undefined>;

If you want to specify an initialValue, you need to avoid explicitly adding the generic type like . Instead, write it as follows:

this.scrollLimit = toSignal(this.scrollDispatcher.scrolled(), { initialValue: true });

By removing , TypeScript can correctly infer the type, and the initialValue option becomes functional.

Regards

Reasons:
  • Blacklisted phrase (1): Regards
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Yohann Daniel Carter