export default connect(state => ({
api: state.api,
changed: state.filterParams,
params: state.filterAjaxParams
}), matchDispatchToProps)(Catalog);
const filterParams = (state = initialState, action) => {
switch( action.type ){
case "UPDATE_CHANGED":
console.log( initialState )
console.log( Object.assign({}, state, action.payload ) )
return Object.assign({}, state, action.payload );
default : return state;
}
}
export const updateChanged = (object) => {
return {type: 'UPDATE_CHANGED', payload: object}
}
const initialState = {
page: null,
sort: null,
period: null
}
const filterParams = (state = initialState, action) => {
switch( action.type ){
case "UPDATE_CHANGED":
return Object.assign({}, state, action.payload );
default : return state;
}
}
то вернет false, но мне нужно только 1 свойство this.props.changed.page проверить изменилось ли оно