This commit is contained in:
azizziy
2025-05-20 17:02:10 +05:00
commit c01e852a59
257 changed files with 27766 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import { LocalStore } from '@/services/local-store';
import { setCookie, getCookie, deleteCookie, hasCookie } from 'cookies-next';
export class CookiesStore implements LocalStore {
get(key: string) {
if (hasCookie(key)) {
return getCookie(key);
} else {
return undefined;
}
}
save(key: string, data: string) {
setCookie(key, data, {
expires: new Date('2099.01.01'),
});
}
delete(key: string) {
deleteCookie(key);
}
resetStore() {
document.cookie = '';
}
}