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

bind is violating unidirectional flow of State #4

Open
SwiftyJunnos opened this issue Nov 14, 2024 · 0 comments
Open

bind is violating unidirectional flow of State #4

SwiftyJunnos opened this issue Nov 14, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@SwiftyJunnos
Copy link
Member

bind method used for SwiftUI binding:

https://github.com/musicspot24/Dripper/blob/be997a6c5bfb4735290c01fc59be6b239c00cbec/Sources/Dripper/Station.swift#L105-L121

The current bind method implementation creates multiple paths to modify Station's state, violating the unidirectional data flow pattern.
To resolve this issue, introducing a dedicated Action to handle state updates should be available just like using pour method.

station.counter.bind(\.counterUpdated)
@SwiftyJunnos SwiftyJunnos added the enhancement New feature or request label Nov 14, 2024
@SwiftyJunnos SwiftyJunnos self-assigned this Nov 14, 2024
@SwiftyJunnos SwiftyJunnos changed the title bind is violating single entrance to access State. bind is violating unidirectional flow of State. Nov 14, 2024
@SwiftyJunnos SwiftyJunnos changed the title bind is violating unidirectional flow of State. bind is violating unidirectional flow of State Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant