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

Deprecate the EffectHandler protocol #210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kmcbride
Copy link
Collaborator

@kmcbride kmcbride commented Apr 23, 2024

I propose deprecating EffectHandler and removing it in a future release because I believe it leads to frequent misuse of the API without providing any obvious advantages. This removal will ideally encourage users to be more intentional about which type of handler they route to.

@kmcbride kmcbride force-pushed the deprecate-effect-handler-protocol branch 6 times, most recently from fd8cb51 to 6dfa6ac Compare April 24, 2024 04:36
Copy link

@erikprice erikprice left a comment

Choose a reason for hiding this comment

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

Some great refactoring in this PR. I think I agree with the deprecation as well.

private var output: Consumer<Event>?

private let lock = Lock()

// Keep track of each received effect's state.
// When an effect has completed, it should be removed from this dictionary.
// When disposing this effect handler, all entries must be removed.
private var handlingEffects: [Int64: EffectHandlingState<Event>] = [:]
private var ongoingEffects: [Int64: EffectHandlingState<Event>] = [:]

Choose a reason for hiding this comment

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

💯 this rename

@kmcbride kmcbride force-pushed the deprecate-effect-handler-protocol branch from 6dfa6ac to d5c2d36 Compare April 25, 2024 03:25
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