[WebsiteList] add preloader, move to components

This commit is contained in:
Sergey Nikiforov 2020-11-24 15:21:44 +03:00
parent 2d591a7906
commit 6cb85959b5
7 changed files with 210 additions and 95 deletions

View file

@ -2,7 +2,7 @@ import { createSlice } from '@reduxjs/toolkit';
const websites = createSlice({
name: 'websites',
initialState: {},
initialState: [],
reducers: {
updateWebsites(state, action) {
state = action.payload;
@ -27,3 +27,9 @@ export function setDateRange(websiteId, dateRange) {
);
};
}
export function setWebsitesData(data) {
return dispatch => {
return dispatch(updateWebsites([...data]));
};
}