mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Update redux type of combineReducers (#41429)
* Update redux-first-router:redux type of combineReducers It now returns CombinedState<State> instead of just State. * Also fix @tinajs/tina-redux * remove unused import in tests
This commit is contained in:
@@ -127,7 +127,7 @@ const action: ReduxFirstRouterAction = {
|
||||
};
|
||||
redirect(action); // $ExpectType Action
|
||||
|
||||
// $ExpectType Store<State, AnyAction>
|
||||
// $ExpectType Store<CombinedState<State>, AnyAction>
|
||||
store;
|
||||
|
||||
store.getState().location.routesMap; // $ExpectType RoutesMap<Keys, State>
|
||||
|
||||
Vendored
+3
-3
@@ -4,7 +4,7 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tinajs__tina-redux
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { Store, Dispatch } from "redux";
|
||||
import { Store, Dispatch, Action } from "redux";
|
||||
|
||||
type MapStateToProps = (state: any) => any;
|
||||
type mapDispatchToProps = (dispatch: Dispatch) => any;
|
||||
@@ -15,8 +15,8 @@ interface HOC {
|
||||
methods: object;
|
||||
}
|
||||
|
||||
declare class TinaRedux {
|
||||
constructor(reduxStore: Store);
|
||||
declare class TinaRedux<S, A extends Action> {
|
||||
constructor(reduxStore: Store<S, A>);
|
||||
connect(mapState?: MapStateToProps, mapDispatch?: mapDispatchToProps): HOC;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,14 +9,14 @@ interface Todo {
|
||||
|
||||
interface TodoAction extends Action, Todo {}
|
||||
|
||||
const intialState: Todo[] = [
|
||||
const initialState: Todo[] = [
|
||||
{ id: 1, text: "Star Tina.js", completed: false },
|
||||
{ id: 2, text: "Star Tina-Redux", completed: true },
|
||||
{ id: 3, text: "Build a mini-program with Tina.js", completed: false },
|
||||
{ id: 4, text: "Add to Showcase of Tina.js", completed: false }
|
||||
];
|
||||
|
||||
const todos = (state = intialState, action: TodoAction) => {
|
||||
const todos = (state = initialState, action: TodoAction) => {
|
||||
switch (action.type) {
|
||||
case "ADD_TODO":
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user