mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-01 13:10:44 -03:00
creada store de usuario
This commit is contained in:
11
src/lib/stores/usuario.ts
Normal file
11
src/lib/stores/usuario.ts
Normal 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
13
src/types.d.ts
vendored
@@ -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[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user