mirror of
https://github.com/kremalicious/umami.git
synced 2025-01-12 14:11:10 +01:00
21 lines
394 B
JavaScript
21 lines
394 B
JavaScript
import create from 'zustand';
|
|
import produce from 'immer';
|
|
|
|
const store = create(() => ({}));
|
|
|
|
export function setDateRange(websiteId, dateRange) {
|
|
store.setState(
|
|
produce(state => {
|
|
if (!state[websiteId]) {
|
|
state[websiteId] = {};
|
|
}
|
|
|
|
state[websiteId].dateRange = { ...dateRange, modified: Date.now() };
|
|
|
|
return state;
|
|
}),
|
|
);
|
|
}
|
|
|
|
export default store;
|