-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
toLazySignal broken with Angular 18.1.x #474
Comments
or we just add a generic type too |
Typing a generic type doesn't always work. for example: toLazySignal<string>(..., {
requireSync: true
}); Infers as I believe this update was caused by a typescript update. Looking at Angular's code, they changed the type definitions of toSignal to use export declare function toLazySignal<T>(source: Observable<T> | Subscribable<T>): Signal<T | undefined>;
export declare function toLazySignal<T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T | undefined> & {
initialValue?: undefined;
requireSync?: false;
}>): Signal<T | undefined>;
export declare function toLazySignal<T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T | null> & {
initialValue?: null;
requireSync?: false;
}>): Signal<T | null>;
export declare function toLazySignal<T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T> & {
initialValue?: undefined;
requireSync: true;
}>): Signal<T>;
export declare function toLazySignal<T, const U extends T>(source: Observable<T> | Subscribable<T>, options: NoInfer<ToSignalOptions<T | U> & {
initialValue: U;
requireSync?: false;
}>): Signal<T | U>; So a better workaround than rolling back would be using patch-package with these changes, or creating your local copy of FYI, |
cc @e-oz |
I'm on it |
as soon as ngx-tension update its deps to 18.1+, tests in this PR will stop failing: #484 (comment) |
ToSignalOptions in @angular/core/rxjs-interop now requires a generic type, which breaks toLazySignal because it's
options
doesn't have a type.Only workaround I can think of is to roll back to Angular 18.0.x
The text was updated successfully, but these errors were encountered: