8caeb0d439
* reselect added * Added Reselect Sorting * Refactor App * added svgs * Refactor * Fixed Issues * re: #789, update sorting styling, create sorting actions and reducers, add sort by sketch name * re #789, change names of svg icons * re: #789, use orderBy instead of sortBy, fix styling jumps
27 lines
478 B
JavaScript
27 lines
478 B
JavaScript
import * as ActionTypes from '../../../constants';
|
|
|
|
export const DIRECTION = {
|
|
ASC: 'ASCENDING',
|
|
DESC: 'DESCENDING'
|
|
};
|
|
|
|
export function setSorting(field, direction) {
|
|
return {
|
|
type: ActionTypes.SET_SORTING,
|
|
payload: {
|
|
field,
|
|
direction
|
|
}
|
|
};
|
|
}
|
|
|
|
export function resetSorting() {
|
|
return setSorting('createdAt', DIRECTION.DESC);
|
|
}
|
|
|
|
export function toggleDirectionForField(field) {
|
|
return {
|
|
type: ActionTypes.TOGGLE_DIRECTION,
|
|
field
|
|
};
|
|
}
|