I'm looking to export two service providers from one package - one to handle a normal service, one to handle the mocked variation. Trouble is, both would need to use the same context in order to enable reuse of existing parts throughout the code. That is, I want to be able to switch the provider <MyService> with a mocked version <MyMockedService>.
I'm thinking the following workflow would work well:
They would essentially be the same process, differing only in whether context is provided or created. Alternatively, we could just re-use createService in these ways:
I'm looking to export two service providers from one package - one to handle a normal service, one to handle the mocked variation. Trouble is, both would need to use the same context in order to enable reuse of existing parts throughout the code. That is, I want to be able to switch the provider
<MyService>
with a mocked version<MyMockedService>
.I'm thinking the following workflow would work well:
They would essentially be the same process, differing only in whether context is provided or created. Alternatively, we could just re-use createService in these ways: