Create an Owner interface so that we don't have to extend and call super() in this LazyOwner implementation.
We can refactor the Owner in this case, such that when the lookup() happens for a service, and the someService instanceof Service is true we can pass the owner into the constructor of the service, otherwise we use the existing instance defined in the service map.
Goals
service
become decorated by another service.Overall the service decorated by a service works.
The missing piece was instantiating services with the owner in the base class.
This aligns with the current ember implementation for a service since the constructor inherited CoreObject
Some things that should be done to improve this:
Owner
interface so that we don't have to extend and callsuper()
in this LazyOwner implementation.lookup()
happens for a service, and thesomeService instanceof Service
istrue
we can pass the owner into the constructor of the service, otherwise we use the existing instance defined in the service map.