Using Context to Swap Service Implementations in Testing

In the documentation, there is this sentence about "why effect"

Additionally, tracking context allows you to provide additional information to your functions without having to pass in everything as an argument. For example, you can swap out implementations of live external services with mocks during your tests without changing any core business logic.


And I often see Live used as a convention, but how exactly would someone use context to trigger a different "context of the service"? If thats the correct saying?

I think this is something I see as extremely valuable, i just can't articulate how it works.
Was this page helpful?