You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I looked a bit at the MortarScope code and I'm a bit surprised that scopes can be started at any time after the start of a mortarScope but can only end when the mortarscope is destroyed and not sooner...
Also services start with the mortarScope and end with it, so they can't be stopped or replaced in the same mortarScope
Why is that ? Is there something I don't see ?
Say, your want to store user settings and the user changes them, so you may have :
|-- settings : ONE ---| |------ settings : TWO ----| |------------------- settings:THREE----|
Sure, you can store a user settings holder that takes care of this sub-scoping but wouldn't it be simpler to allow getting a scope and to tear it down from the mortarScope while it is not destroyed ?
Because they can be destroyed, to achieve this, it might be possible too to create a child MortarScope with the name "settings" holding Setting:ONE as a service
... and then destroying it ... and creating another child mortarScope with the same name.....
But it's not simple too
Also, the scoped services that the root mortar scope holds can't be stopped/ replaced before the end of the process.... :/
Am I missing something ?
The text was updated successfully, but these errors were encountered:
I looked a bit at the MortarScope code and I'm a bit surprised that scopes can be started at any time after the start of a mortarScope but can only end when the mortarscope is destroyed and not sooner...
Also services start with the mortarScope and end with it, so they can't be stopped or replaced in the same mortarScope
Why is that ? Is there something I don't see ?
Say, your want to store user settings and the user changes them, so you may have :
|-- settings : ONE ---| |------ settings : TWO ----| |------------------- settings:THREE----|
Sure, you can store a user settings holder that takes care of this sub-scoping but wouldn't it be simpler to allow getting a scope and to tear it down from the mortarScope while it is not destroyed ?
Because they can be destroyed, to achieve this, it might be possible too to create a child MortarScope with the name "settings" holding Setting:ONE as a service
... and then destroying it ... and creating another child mortarScope with the same name.....
But it's not simple too
Also, the scoped services that the root mortar scope holds can't be stopped/ replaced before the end of the process.... :/
Am I missing something ?
The text was updated successfully, but these errors were encountered: