Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middleware type is incorrect for store parameter #8

Open
Scyfren opened this issue Dec 29, 2020 · 1 comment
Open

Middleware type is incorrect for store parameter #8

Scyfren opened this issue Dec 29, 2020 · 1 comment

Comments

@Scyfren
Copy link

Scyfren commented Dec 29, 2020

interface Middleware<DispatchExt = {}, S = any> {
	(nextDispatch: Dispatch<AnyAction>, store: S): (action: any) => any;
}

store's type is S which is the store's state, but it should use Rodux.Store.
I'm not sure how to fix this myself though. I tried by adding A extends Action = AnyAction as a type parameter and using that in store: Rodux.Store<S, A> and (action: A) but I came across issues with Rodux.loggerMiddleware not being usable due to Rodux.AnyAction incompatibility with my store's actions (I tried to intersect my store's action types with Rodux.AnyAction and it didn't fix anything).

@jackTabsCode
Copy link

Just ran into this, bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants