creada store de usuario

This commit is contained in:
2025-11-14 15:37:37 -03:00
parent a2da01b29c
commit 50187910b4
2 changed files with 24 additions and 0 deletions

11
src/lib/stores/usuario.ts Normal file
View File

@@ -0,0 +1,11 @@
import { writable } from 'svelte/store';
import type { User } from '../../types';
export const currentUser = writable<User | null>(null);
export const userStore = {
subscribe: currentUser.subscribe,
set: currentUser.set,
update: currentUser.update,
reset: () => currentUser.set(null)
};

13
src/types.d.ts vendored
View File

@@ -12,3 +12,16 @@ export interface Post {
visibility: string;
hashtags?: string[];
}
export interface User {
_id: string;
displayName: string;
username: string;
email: string;
passwordHash: string;
bio?: string;
profileImageUrl?: string;
createdAt: Date;
followersCount: number;
followingCount: number;
refreshTokens: RefreshToken[];
}