-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
improvementImprovements to existing featuresImprovements to existing featuresrefactorRefactoring codeRefactoring code
Description
VS Code API call caching, computed value memoization.
class CacheManager {
get<T>(key: CacheKey): T | undefined;
set<T>(key: CacheKey, value: T, ttl?: number): void;
invalidate(pattern: string | RegExp): void;
}
// Cached Config Reader Decorator
class CachedConfigReader implements ConfigReader {
getButtons(): ButtonConfig[] {
const cached = this.cache.get<ButtonConfig[]>("buttons:current");
if (cached) return cached;
const buttons = this.reader.getButtons();
this.cache.set("buttons:current", buttons, 5000); // 5s TTL
return buttons;
}
}
Reason: Performance + Consistency
Current: Calling the VS Code API every time getButtons() is called
Improvement: Cache + Invalidation Strategy
- Eliminate unnecessary API calls
- Ensure state consistency
Metadata
Metadata
Assignees
Labels
improvementImprovements to existing featuresImprovements to existing featuresrefactorRefactoring codeRefactoring code
Projects
Status
Backlog