Skip to content

Add shouldNotifyObservers to ObservableState #3751

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

Merged
merged 11 commits into from
Aug 19, 2025

Conversation

rcarver
Copy link
Contributor

@rcarver rcarver commented Aug 12, 2025

This adds shouldNotifyObservers to ObservableState. It's basically copied from Perception, then merged with ObservationRegistrar

TODO

  • Fix testCopyMutation_WithPerturbation
  • Determine if there are other cases to handle when considering identity

Demo

https://github.com/rcarver/tca-sharing-observation-tests

The TCA case in this app shows that a noop assignment no longer causes a view update. This all started by working on observation for Shared, but I thought it might be informative to first refine this piece within TCA.

@stephencelis
Copy link
Member

@rcarver Thanks for looking into this! Are your TODOs still pending or is this ready to review?

@rcarver rcarver marked this pull request as draft August 14, 2025 19:20
@rcarver
Copy link
Contributor Author

rcarver commented Aug 14, 2025

@stephencelis np! Still todo (switched the PR to a draft).

Could you take a look at testCopyMutation_WithPerturbation? I can't quite figure out whether it's not important, or extremely important and points to a whole set of issues to solve around identity. That leads to the second TODO..

Any insights you can provide would be super helpful; I'll take another pass at it.

@rcarver
Copy link
Contributor Author

rcarver commented Aug 15, 2025

@mbrandonw thanks for that. Demo still looks good.

  1. do you think there are more cases to look into?
  2. do you want to add new integration tests for it?

@stephencelis stephencelis marked this pull request as ready for review August 18, 2025 18:03
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 af60ed2 into pointfreeco:main Aug 19, 2025
9 of 10 checks passed
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.

3 participants