Closed goldenbearkin closed 5 years ago
Hi @goldenbearkin, of course, it is :)
~Why wouldn't you try to git pull the repo, and open the sandbox project in your IDE, there is a reason I have added it there :)~
Ah sorry I was too fast, my bad. It's not in the repo, I'm going to check it tomorrow! Cheers!
@goldenbearkin I believe it was working in the earlier version of TypeScript because the default type param was any
. Not long ago it was changed to unknown
in 3.5 or something, and now it is causing a type error in strict mode.
Unfortunately, it will not work anymore, I'll update the documentation.
Thanks for reporting.
Actually there is more, it seems the root issue is in the rxjs types because of
function is overloaded and it doesn't work well with the common pipe or compose implementations.
If you change of declaration to this declaration, it will work:
export declare function of<T>(a: T): Observable<T>;
Alternatively from
is working just fine:
catchError(
pipe(
loadTodosAsync.failure,
Array,
from,
)
)
Anyway, as a best alternative, I would just create a custom catchError wrapper to handle it more elegantly and actually there is a ticket for it somewhere in the repo that is WIP.
I use the syntax
catchError(pipe(fetchTodosAsync.failure, of))
follow the doc, but it doesn't work. I love the syntax, it is so clear, but is it legit?