Skip to content

refactor(console-catcher): convert to class with singleton pattern#132

Merged
Dobrunia merged 14 commits intomasterfrom
refactor/js-console-catcher
Nov 15, 2025
Merged

refactor(console-catcher): convert to class with singleton pattern#132
Dobrunia merged 14 commits intomasterfrom
refactor/js-console-catcher

Conversation

@Dobrunia
Copy link
Copy Markdown
Member

@Dobrunia Dobrunia commented Nov 5, 2025

Changes:

  • Converted createConsoleCatcher() factory function to ConsoleCatcher class
  • Implemented singleton pattern via static getInstance() method
  • Moved internal state (consoleOutput, isInitialized) to private class fields
  • Converted all internal functions to private/public class methods
  • Integrated ConsoleCatcher into Catcher class via instance property
  • Replaced direct function imports with class instance usage in catcher.ts

Benefits:

  • Better code organization and encapsulation
  • Easier to test and maintain
  • Consistent with other class-based modules in the codebase
  • Preserves all existing functionality without breaking changes

@Dobrunia Dobrunia merged commit 001c8ab into master Nov 15, 2025
2 checks passed
@Dobrunia Dobrunia deleted the refactor/js-console-catcher branch November 15, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants