function useLifecycles view code
Given an array of lifecycles, uses all lifecycles as dependencies. When the root is started, all providers with each lifecycle's method will have it registered.
Parameters
root: Root
The root that should use the lifecycles.
lifecycles: { Lifecycle }
The lifecycles to be used.
Returns
Root
The same root for convenience.