createAsyncThunk
Explore five bizarre browser APIs that open up opportunities for delightful interfaces, unexpected interactions, and thoughtful accessibility enhancements.

Compare the top AI development tools and models of December 2025. View updated rankings, feature breakdowns, and find the best fit for you.

Fixing AI code, over-engineering JavaScript, and more: discover what’s new in The Replay, LogRocket’s newsletter for dev and engineering leaders, in the December 10th issue.

TOON is a lightweight format designed to reduce token usage in LLM prompts. This post breaks down how it compares to JSON, where the savings come from, and when it actually helps.
Would you be interested in joining LogRocket's developer community?
Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up now
7 Replies to "Using Redux Toolkit’s <code>createAsyncThunk</code>"
Thanks so much
You just saved me man
Thanks a lot
You’re welcome man. Glad I could help (:
While you correctly describe the payloadCreator as the second parameter of the async request, your use of the pseudocode “async (thunkAPI)” misleadingly may guide a reader into believing the thunkAPI is first parameter. (I certainly was fooled.) Perhaps clearer pseudocode would be “async (_, thunkAPI)”?
While redux might be a hard topic to understand, you made it easy to understand.
Good afternoon!
Excellent article, I learned a lot, but I didn’t understand how you use the getPosts function and you didn’t export it from the file, where am I going wrong?
You forgot an “export” in front of the definition of the getPosts createAsyncThunk. That’s how you can run it as a function within the dispatch() operation.
I thought I had a fundamental misunderstanding of Redux for a second there. Finally figured out it was a typo when I checked out the official docs.
https://redux-toolkit.js.org/api/createAsyncThunk
We’ve now fixed this typo — thanks for catching that, Jared!