Answer the question
In order to leave comments, you need to log in
What does the as operator mean?
Urgently studying React in relation to the project, I met the as operator in the line "import {routerReducer as routing} from 'react-router-redux';"
Can anyone tell me what this operator does? Here is a listing of the src/routes/index.tsx file:
import {combineReducers} from "redux";
import {Location} from "history";
import {routerReducer as routing} from 'react-router-redux';
import routes, {RoutesState} from "routes/reducer";
import connections, {ConnectionStates} from './connections';
import session, {SessionState} from './session';
import authToken from "./authToken";
export interface RootState {
routing: {
locationBeforeTransitions: Location;
};
connections: ConnectionStates;
session: SessionState;
authToken: string;
routes: RoutesState;
}
export function getRootReducer() {
return combineReducers<RootState>({
routing,
connections,
session,
authToken,
routes,
});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question