Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

91
Views
how to use createAsyncThunk correctly

Anyone with redux toolkit knowledge? The code below is causing my entire app to crash. Can anyone spot the problem in my asyncThunk because I can't...

export const getBarbers = createAsyncThunk(
  "/barbers/fetchBarbers",
  async () => {
    return fetch("/api/barbers").then((res) => res.json());
  }
);

Removing the async keyword remedies the app failure but I'm pretty sure I need that.

7 months ago ยท Juan Pablo Isaza
Answer question
Find remote jobs