Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve UIKit case studies: ListsOfState #3220

Merged

Conversation

takehilo
Copy link
Contributor

@takehilo takehilo commented Jul 2, 2024

I have improved the ListsOfState example.
The tableView(_:cellForRowAt:) delegate method can be called multiple times for the same indexPath, and in the current code, the observe(_:) method is executed multiple times for the same indexPath.
When the observe(_:) method is executed multiple times, the closure is called unnecessarily many times when the Counter model at the corresponding index is changed.
To prevent this, I have added the observation cancellation logic.

Copy link
Member

@stephencelis stephencelis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@stephencelis stephencelis merged commit 10e5506 into pointfreeco:main Jul 12, 2024
junbangg pushed a commit to junbangg/swift-composable-architecture that referenced this pull request Jul 14, 2024
@takehilo takehilo deleted the improve-uikit-lists-of-state-example branch July 16, 2024 12:20
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