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;
}
}
const filterParams = (state = initialState, action) => {
switch( action.type ){
case "UPDATE_CHANGED":
console.log( state )
console.log( Object.assign({}, state, action.payload ) )
return Object.assign({}, state, action.payload );
default : return state;
}
}
componentDidUpdate(prevProps){
console.log(prevProps.changed === this.props.changed)
}
const takeLatest = request => {
let last = 0;
return async (params, cb) => {
const current = ++last;
const response = await request(params);
if (current === last) {
cb(response);
}
};
};
const latestRequest = _.debounce(takeLatest(request), 300);
search.addEventListener('input', (e) => {
latestRequest(e.target.value, console.log);
});
По поводу префиксов. Попробуйте разделить разделы как-нибудь так: