debian-mirror-gitlab/app/assets/javascripts/search/store/state.js
2023-04-23 21:23:45 +05:30

24 lines
536 B
JavaScript

import { cloneDeep } from 'lodash';
import { GROUPS_LOCAL_STORAGE_KEY, PROJECTS_LOCAL_STORAGE_KEY } from './constants';
const createState = ({ query, navigation }) => ({
urlQuery: cloneDeep(query),
query,
groups: [],
fetchingGroups: false,
projects: [],
fetchingProjects: false,
frequentItems: {
[GROUPS_LOCAL_STORAGE_KEY]: [],
[PROJECTS_LOCAL_STORAGE_KEY]: [],
},
sidebarDirty: false,
navigation,
aggregations: {
error: false,
fetching: false,
data: [],
},
});
export default createState;