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

Dependency Injection? #14

Open
stottle-uk opened this issue Jun 5, 2022 · 1 comment
Open

Dependency Injection? #14

stottle-uk opened this issue Jun 5, 2022 · 1 comment
Labels
question Further information is requested

Comments

@stottle-uk
Copy link

stottle-uk commented Jun 5, 2022

Hi

Many thanks for putting this repo together, it is an excellent example.

What are your thoughts on using a Dependency Injection library like tsyringe? Could 'newing up' several dependencies in your todo service lead to a lot of boilerplate setup for each handler when more abstractions are created around IO and Business Logic?

I've forked your repo, created a branch and refactored the todo service with a few tests as a basic example - https://github.com/stottle-uk/nx-serverless/tree/dependency_injection.

Any thoughts or ideas you have would be much appreciated.

Kind regards

@NetanelBasal
Copy link
Member

NetanelBasal commented Jun 5, 2022

I didn't use DI and chose pure exported functions to benefit from tree-shaking. By doing so, each lambda bundles the minimum it needs.

@NetanelBasal NetanelBasal added the question Further information is requested label Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants