//custom-slice.js
import { createCustomSlice } from '@my/data-toolkit';
/* ***********************For Managing all the divisions data****************************** */
export const divisionDataSlice = createCustomSlice({
name: 'divisiondata',
initialState: { status: 'loading' },
} )({
setDivisionData(state, { payload }) {
state.data = payload;
},
});
/**************------------------*******************************/
//@my/data-toolkit Module
interface CustomState<T> {
data?: T;
status: 'loading' | 'finished' | 'error';
}
type ObjectRecord = Record<string, any>;
export const createCustomSlice = <D extends ObjectRecord, T extends ObjectRecord>({
name = '',
initialState,
}: {
name: string;
initialState: CustomState<T>;
}) = {return //Reducers}
Upon running my code, I encountered the following error message. Is there a way to disable or configure settings to avoid such errors?
Error during bundling process: Error: custom-slice.js(4, 14): semantic error TS4023: Exported variable 'divisionDataSlice' is referencing external module "data-toolkit" and causing conflicts with the identifier 'GenericState'.
I have explored the possible options in tsConfig and attempted to resolve this issue without success.
If disabling the error reporting is not feasible, is there a workaround within the code to address this problem?