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

Allow preparing dependency multiple times in same scope #298

Merged
merged 15 commits into from
Nov 7, 2024

Conversation

mbrandonw
Copy link
Member

This PR is based on #288 and fixes a few problems with preparing a dependency multiple times in the same lexical scope. We need to allow this in order for it to be useful.

It still does not allow for a dependency to be prepared from multiple prepareDependencies. Even if the dependency was never accessed. We may weaken that restriction in the future if it proves to be useful.

@mbrandonw mbrandonw changed the title Fix multi prepare Allow preparing dependency multiple times in same scope Nov 4, 2024
@mbrandonw mbrandonw merged commit bdde9fb into prepare-dependencies Nov 7, 2024
1 of 5 checks passed
@mbrandonw mbrandonw deleted the fix-multi-prepare branch November 7, 2024 21:56
stephencelis added a commit that referenced this pull request Nov 7, 2024
* Add `prepareDependencies`

Right now, dependencies can only be overridden using scoped operations
like `withDependencies` or attached to object livecycles
(`withDependencies(from:)`). This introduces a new top-level way of
preparing global dependencies so that they are accessible in the
top-level scope of your application.

* wip

* wip

* wip

* Add failing test for preparing dependency twice in the same prepareDependencies{}

* another failing test

* wip

* Allow preparing dependency multiple times in same scope (#298)

* Attempted fix of preparing dependency in multiple lines.

* fixes

* fix

* tests

* wip

* fixes

* clean up

* clean up

* clean up

* wip

* wip

* fix

* wip

* wip

* wip

---------

Co-authored-by: Brandon Williams <[email protected]>
Co-authored-by: Brandon Williams <[email protected]>
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