Adding, Emptying, and Subtracting Elements and Folding Contexts

Learn how to add, empty, or subtract elements from a context or fold a context.

Adding contexts

What makes CoroutineContext truly useful is the ability to merge two of them.

The resulting context responds to both keys when we add two elements with different keys.

Get hands-on with 1200+ tech skills courses.