You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even though AsyncActionCreatorBuilder can be easily used by providing set and fixed types, it can't be used when trying to retrieve generics.
Mandatory info
Did you checked compatibility notes and migration guides?
How to Reproduce
functionasyncActionEnhancer<TRequestType,TRequestValue,TResponseType,TResponseValue,TError>(asyncAction: AsyncActionCreatorBuilder<[TRequestType,TRequestValue],[TResponseType,TResponseValue],[TError,Error]>): TRequestValue{/** Logic here */}
Current behaviour
TS shows an error on the line [TRequestType, TRequestValue]:
Type 'TRequestValue' is not assignable to type '[TRequestType, TRequestValue] extends [TRequestType, [any, any]] ? ([any, any] & TRequestValue)[0] : TRequestValue'.
Expected behaviour
TS should be able to infer the function generics from asyncAction
Suggested solution(s)
It already worked previously in v4 with the type AsyncActionCreator from src/create-async-action, which was typed with much less type constraints than the currentAsyncActionCreatorBuilder
Description
Even though AsyncActionCreatorBuilder can be easily used by providing set and fixed types, it can't be used when trying to retrieve generics.
Mandatory info
How to Reproduce
Current behaviour
TS shows an error on the line
[TRequestType, TRequestValue]
:Expected behaviour
TS should be able to infer the function generics from
asyncAction
Suggested solution(s)
It already worked previously in v4 with the type
AsyncActionCreator
fromsrc/create-async-action
, which was typed with much less type constraints than the currentAsyncActionCreatorBuilder
Project Dependencies
The text was updated successfully, but these errors were encountered: