Conversation
MatusMistrik
approved these changes
Oct 1, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR implements type-erased mutations in the GoodReactor framework by introducing an AnyReactor wrapper that erases both the concrete Reactor type and its Mutation type. This allows views to work with different reactor implementations that share the same action/state interface but have different internal mutation types.
- Introduces
AnyMutationstruct for type-erased mutations - Implements
AnyReactorwith dynamic member lookup for state access - Adds comprehensive test coverage for the new type-erased functionality
Reviewed Changes
Copilot reviewed 12 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
Tests/GoodReactorTests/GoodReactorTests.swift |
Updates test assertions to use direct property access instead of .state property |
Tests/GoodReactorTests/AnyReactorTests.swift |
New comprehensive test suite for AnyReactor functionality |
Sources/GoodReactor/Utils/EventTaskCounter.swift |
Extracts EventTaskCounter into separate file, removes unrelated Event code |
Sources/GoodReactor/Core/Reactor.swift |
Removes deprecated currentState property |
Sources/GoodReactor/Core/Identifier.swift |
Moves EventIdentifier to Event.swift file |
Sources/GoodReactor/Core/Event.swift |
New file containing Event class and type-erasure utilities |
Sources/GoodReactor/Core/Erased/AnyReactorBoxProtocol.swift |
Protocol defining interface for type-erased reactor boxes |
Sources/GoodReactor/Core/Erased/AnyReactorBox.swift |
Implementation of reactor box that forwards calls to concrete reactor |
Sources/GoodReactor/Core/Erased/AnyReactor.swift |
Main AnyReactor class with dynamic member lookup and type erasure |
Sources/GoodReactor/Core/Erased/AnyMutation.swift |
Type-erased mutation wrapper |
Sources/GoodReactor/AnyReactor.swift |
Removes old AnyReactor implementation |
README.md |
Updates test coverage percentage from 69% to 83% |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
e003268 to
82823ad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type-erasure now erases
Mutationtype as well as original concreteReactorclass type.