-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Typescript issue along with Redux 4.0.5 #3742
Comments
Without any code examples, I can't tell what's going on here. But I would look at the discussion in #3484 where this was changed. |
Please find below the code import { applyMiddleware, createStore, Store } from 'redux'
import { createEpicMiddleware } from 'redux-observable'
import { Persistor, persistReducer, persistStore } from 'redux-persist'
import storage from 'redux-persist/lib/storage'
import { composeWithDevTools } from 'remote-redux-devtools'
export class StoreServices {
public persistor: Persistor
public currentStore: Store<ReduxState>
constructor() {
const epicMiddleware = createEpicMiddleware(rootEpic, {
dependencies: epicDependencies
})
const persistConfig: any = {
key: 'root',
storage,
whitelist: ['mobileContent']
}
const persistedReducer = persistReducer<any, any>(persistConfig, reducer)
const composeEnhancers = composeWithDevTools({ realtime: EnvironmentSelector.currentEnv, hostname: 'localhost', port: 8080 })
const store = createStore<any, any, any, any>(
persistedReducer,
composeEnhancers(applyMiddleware(epicMiddleware))
)
this.currentStore = store
this.persistor = persistStore(store)
epicMiddleware.replaceEpic(rootEpic)
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am getting below errors after upgrading to redux 4.0.5
app/store/reducer.ts:58:7 - error TS2345: Argument of type 'AnyAction' is not assignable to parameter of type 'never'.
58 action
~~~~~~
app/store/reducer.ts:62:18 - error TS2345: Argument of type 'StateRoot' is not assignable to parameter of type 'CombinedState<{ [x: string]: unknown; }>'.
Type 'StateRoot' is not assignable to type '{ [x: string]: unknown; }'.
Index signature is missing in type 'StateRoot'.
62 return reducer(state, action)
~~~~~
Found 2 errors.
The text was updated successfully, but these errors were encountered: