Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

combineEpics using TypeScript gives type error

I am getting this error when combining my epics:

TS2345: Argument of type 'Epic<SessionAction, GlobalState, any>' is not assignable to parameter of type 'Epic<EmployeeAction, GlobalState, any>'.
Type 'SessionAction' is not assignable to type 'EmployeeAction'.
Types of property 'type' are incompatible.
  Type 'SessionActionTypes' is not assignable to type 'EmployeeActionTypes'.

The following is the code:

import { combineEpics } from 'redux-observable';
import { fetchUserSession } from './sessionEpics';
import { fetchEmployee } from './employeeEpics';

export default combineEpics(
  fetchEmployee,
  fetchUserSession
);
like image 322
Juan Bernal Avatar asked Feb 12 '26 08:02

Juan Bernal


1 Answers

Or use combineEpics<any>:

export default combineEpics<any>(
  fetchEmployee,
  fetchUserSession
);
like image 50
Axel186 Avatar answered Feb 15 '26 18:02

Axel186



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!