github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/webapp/javascript/redux/async-thunk.ts (about) 1 /* eslint-disable import/prefer-default-export */ 2 import { 3 createAsyncThunk as libCreateAsyncThunk, 4 SerializedError, 5 } from '@reduxjs/toolkit'; 6 7 // eslint-disable-next-line @typescript-eslint/ban-ts-comment 8 // @ts-ignore 9 export const createAsyncThunk: typeof libCreateAsyncThunk = ( 10 ...args: Parameters<typeof libCreateAsyncThunk> 11 ) => { 12 const [typePrefix, payloadCreator, options] = args; 13 return libCreateAsyncThunk(typePrefix, payloadCreator, { 14 ...options, 15 // Return the error as is (without) 16 // So that the components can use features like instanceof, and accessing other fields that would otherwise be ignored 17 // https://github.com/reduxjs/redux-toolkit/blob/db0d7dc20939b62f8c59631cc030575b78642296/packages/toolkit/src/createAsyncThunk.ts#L94 18 serializeError: (x) => x as SerializedError, 19 }); 20 };