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

Add convenience macros for defining providers #5

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

Conversation

stergiom
Copy link

@stergiom stergiom commented Oct 7, 2019

Context

Perhaps useful, this PR aims to add define_singleton_providers and define_providers macros to add both injectable and wrap (where applicable) functionality to classes, while honouring namespaces.

Considerations

Depends on the work over at #3

Copy link
Owner

@Bonemind Bonemind left a comment

Choose a reason for hiding this comment

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

I'm liking the Syringe.define_providers shortcut, It's a good addition to the api.
I'm still thinking about the define_singleton_providers shortcut, i'm torn between also adding Syringe.injectable_singleton, and leaving injectable singletons out of the shard entirely. I think there's merits to both, i'll think about it for a bit and get back to that today.

@Bonemind
Copy link
Owner

Bonemind commented Oct 7, 2019

I've thought about it and think this is a useful enough addition, if you could add a Syringe.injectable_singleton feature for symmetries sake, and readme documentation I'm happy.
Although, might be easier to wait for Elliotize's pr

@stergiom
Copy link
Author

👌 Happy to update once @elliotize's PR is merged.

@elliotize
Copy link
Contributor

My PR I think is ready

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