How to use isType with async properties
See original GitHub issueHi, I have the following:
interface ILanguage {
first: string
second?: string
}
const actionCreator = actionCreatorFactory( '[Language]' )
export const addLangAction = actionCreator.async<
ILanguage, { success: number }, { error: number }>( 'ADD_DATA' )
export function langReducer( state: ILanguage, action: Action ) {
if ( isType( action, addLangAction) ) {
return action.payload
}
return state
}
The addLangAction generates the following error:
ERROR in language.store.ts (90,24): Argument of type 'AsyncAction
Creators<ILanguage, { success: number; }, { error: number; }>' is not assignable to parameter of type 'ActionCreator<{}>'.
Type 'AsyncActionCreators<ILanguage, { success: number; }, { error: number; }>' provides no match for the signature '(payload
: {}, meta?: Object): Action<{}>')
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
.net - The proper way to await databound property getters c#
I have a blog post and MSDN article on "async properties" for data binding. I do take the stance that they are not...
Read more >async function - JavaScript - MDN Web Docs - Mozilla
Use of async and await enables the use of ordinary try / catch blocks around asynchronous code. Note: The await keyword is only...
Read more >Type 'typeof ResultAsync' is not a valid async function return ...
I'm having trouble with my very first steps with this library. I'm trying something very simple like: async function foo(): Promise { return...
Read more >Documentation - Utility Types - TypeScript
Constructs an object type whose property keys are Keys and whose property values are Type . This utility can be used to map...
Read more >Unit test controller logic in ASP.NET Core - Microsoft Learn
Unit testing controllers · Mocks the IBrainstormSessionRepository service using the GetTestSessions method. GetTestSessions creates two mock ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would love to see one for redux-thunk, thanks. great library and great work!
@clool #19 is an issue that tracks the progress of a 3rd party helper library for the
redux-thunk
.The good news is that there is a new project now available!
I think this issue can be closed now.