Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
subscribe(searchFiltersDidUpdate$, ({ action, dispatch, getState }) => {
const { filters } = action;
const { query } = getCurrentRoute(getState());
const { s: searchPhrase, sort } = query;
dispatch(fetchSearchResults({
filters,
searchPhrase,
sort,
}));
});
subscribe(categoryFiltersDidUpdate$, ({ action, dispatch, getState }) => {
const { params, state: { offset = 0 } } = getCurrentRoute(getState());
const categoryId = hex2bin(params.categoryId);
const { filters } = action;
dispatch(fetchCategoryProducts({
categoryId,
filters,
offset,
}));
});
}
const mapStateToProps = state => ({
route: getCurrentRoute(state),
});
const mapStateToProps = state => ({
route: getCurrentRoute(state),
});
subscribe(categoryFiltersDidUpdate$, ({ action, dispatch, getState }) => {
const { params, state: { offset = 0 } } = getCurrentRoute(getState());
const categoryId = hex2bin(params.categoryId);
const { filters } = action;
dispatch(fetchCategoryProducts({
categoryId,
filters,
offset,
}));
});
}