How to create a reusable cleanup logic by using the DestroyRef provider. — Angular v16 brought a lot of new features, such as Angular signals, required component inputs, takeUntilDestroyed, DestroyRef, and more. In this short article, we will focus on DestroyRef and — spoiler alert — how to use it to create a reusable function to unsubscribe from observables. Let’s get started! What is DestroyRef?