mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Refactored forms and pages.
This commit is contained in:
parent
1325abe31d
commit
6253d55790
57 changed files with 209 additions and 208 deletions
9
src/store/cache.js
Normal file
9
src/store/cache.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { create } from 'zustand';
|
||||
|
||||
const store = create(() => ({}));
|
||||
|
||||
export function setValue(key, value) {
|
||||
store.setState({ [key]: value });
|
||||
}
|
||||
|
||||
export default store;
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
import { create } from 'zustand';
|
||||
|
||||
const store = create(() => ({}));
|
||||
|
||||
export function saveQuery(key, data) {
|
||||
store.setState({ [key]: data });
|
||||
}
|
||||
|
||||
export function getQuery(key) {
|
||||
return store.getState()[key];
|
||||
}
|
||||
|
||||
export default store;
|
||||
|
|
@ -4,10 +4,6 @@ import { DateRange } from 'lib/types';
|
|||
|
||||
const store = create(() => ({}));
|
||||
|
||||
export function getWebsiteDateRange(websiteId: string) {
|
||||
return store.getState()?.[websiteId];
|
||||
}
|
||||
|
||||
export function setWebsiteDateRange(websiteId: string, dateRange: DateRange) {
|
||||
store.setState(
|
||||
produce(state => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue