Skip to content
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

Use createAsyncThunk.withTypes<>() from RTK 1.9 for pre-typed createAsyncThunk #1056

Merged
merged 2 commits into from
Dec 12, 2022

Conversation

nelsonni
Copy link
Member

Switch to using a pre-typed createAppAsyncThunk to avoid having to manually define AsyncThunkConfig type fields for each call to createAsyncThunk. This change takes advantage of the new createAsyncThunk.withTypes<>() introduced in RTK 1.9.

This PR resolves #1055.

Changes:

This PR makes the following changes:

  • Add pre-typed createAppAsyncThunk and remove AppThunkAPI type definition
  • Switch all createAsyncThunk calls to use the pre-typed createAppAsyncThunk

@nelsonni nelsonni added the feature Feature requests or improvements label Dec 12, 2022
@nelsonni nelsonni merged commit 21cda19 into main Dec 12, 2022
@nelsonni nelsonni deleted the fix/createAsyncThunk.withTypes branch December 12, 2022 22:14
@nelsonni nelsonni self-assigned this Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature requests or improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use createAsyncThunk.withTypes<>() from RTK 1.9 for pre-typed createAsyncThunk
1 participant