Moved logic to mark selected server to parent component in order to affect all children compo0nents on the same route

This commit is contained in:
Alejandro Celaya
2018-07-24 19:17:01 +02:00
parent 3eaa66435a
commit 78ba7c75ff
6 changed files with 72 additions and 41 deletions

View File

@@ -3,6 +3,7 @@ import { connect } from 'react-redux';
import Paginator from './Paginator';
import SearchBar from './SearchBar';
import ShortUrlsList from './ShortUrlsList';
import { assoc } from 'ramda';
export function ShortUrls(props) {
const { match: { params } } = props;
@@ -18,7 +19,4 @@ export function ShortUrls(props) {
);
}
export default connect(state => ({
shortUrlsList: state.shortUrlsList.shortUrls,
loading: state.shortUrlsList.loading,
}))(ShortUrls);
export default connect(state => assoc('shortUrlsList', state.shortUrlsList.shortUrls, state.shortUrlsList))(ShortUrls);