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

Fix providable bugs #243

Merged
merged 3 commits into from May 18, 2022
Merged

Fix providable bugs #243

merged 3 commits into from May 18, 2022

Conversation

keithamus
Copy link
Member

A couple of bugs that came through extended testing of providable.

fix bug in providable where it should only dispose of older disposers

This was causing values to be discarded after the first change which is
a mistake. The disposer should be called only if it recieves a new one
(meaning a different provider has entered the ring).

fix nested & partial providers

If a provider cannot supply a value it should not, and so we need to
check if it has the available @provide name.

If a provider can supply a value it should stopPropagation to avoid
letting other providers assign and callback.

This was causing values to be discarded after the first change which is
a mistake. The disposer should be called only if it recieves a new one
(meaning a different provider has entered the ring).
If a provider cannot supply a value it should not, and so we need to
check if it has the available `@provide` name.

If a provider _can_ supply a value it should stopPropagation to avoid
letting other providers assign and callback.
@keithamus keithamus marked this pull request as ready for review May 18, 2022 07:52
@keithamus keithamus requested a review from a team as a code owner May 18, 2022 07:52
@keithamus keithamus enabled auto-merge May 18, 2022 08:06
@keithamus keithamus merged commit c12f5b7 into main May 18, 2022
@keithamus keithamus deleted the fix-providable-bugs branch May 18, 2022 12:51
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.

None yet

2 participants