Describe the bug
When passing in New function into
app.Register(
environment.New
// ...dependencies
)
When requesting endpoints , the New function will run again. Shouldn't the result of the new constructor be stored in some kind of bean factory instead ?
To Reproduce
Steps to reproduce the behavior:
- Create a Iris project.
- Setup mvc.
- in the Dependencies new function fmt.Println some sentences
- register dependencies in the mvc
- register the controller and use the dependencies in that controller
- start the application and request the endpoint
- should see println in New function print out everytime when requesting endpoint.
Expected behavior
New function should be called once only , but not everytime when there is request.
Screenshots

the Json is the configuration I printed from environment struct new function.
the line beneath it is the log in controller method
Desktop (please complete the following information):
Describe the bug
When passing in New function into
When requesting endpoints , the New function will run again. Shouldn't the result of the new constructor be stored in some kind of bean factory instead ?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
New function should be called once only , but not everytime when there is request.
Screenshots

the Json is the configuration I printed from environment struct new function.
the line beneath it is the log in controller method
Desktop (please complete the following information):