This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

refactor: implement singleton pattern for in-memory repositories

Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>

+20
+10
src/modules/atproto/tests/infrastructure/InMemoryAppPasswordSessionRepository.ts
··· 7 7 export class InMemoryAppPasswordSessionRepository 8 8 implements IAppPasswordSessionRepository 9 9 { 10 + private static instance: InMemoryAppPasswordSessionRepository; 10 11 private sessions: Map<string, SessionWithAppPassword> = new Map(); 12 + 13 + private constructor() {} 14 + 15 + public static getInstance(): InMemoryAppPasswordSessionRepository { 16 + if (!InMemoryAppPasswordSessionRepository.instance) { 17 + InMemoryAppPasswordSessionRepository.instance = new InMemoryAppPasswordSessionRepository(); 18 + } 19 + return InMemoryAppPasswordSessionRepository.instance; 20 + } 11 21 12 22 async saveSession( 13 23 did: string,
+10
src/modules/user/tests/infrastructure/InMemoryTokenRepository.ts
··· 5 5 } from '../../domain/repositories/ITokenRepository'; 6 6 7 7 export class InMemoryTokenRepository implements ITokenRepository { 8 + private static instance: InMemoryTokenRepository; 8 9 private tokens: Map<string, RefreshToken> = new Map(); 10 + 11 + private constructor() {} 12 + 13 + public static getInstance(): InMemoryTokenRepository { 14 + if (!InMemoryTokenRepository.instance) { 15 + InMemoryTokenRepository.instance = new InMemoryTokenRepository(); 16 + } 17 + return InMemoryTokenRepository.instance; 18 + } 9 19 10 20 async saveRefreshToken(token: RefreshToken): Promise<Result<void>> { 11 21 try {