the Adaptor Function
Often, an application's state takes the form of a complex object with multiple layers. For example, it might include user profile information, settings, and other nested objects within them. In such situations, if you try to change only a specific part of the state using the setValue function, writing code to update only the desired value while keeping the rest unchanged can be cumbersome. This is because you might need to use the spread operator (...) multiple times to maintain immutability or worry about deep copying.
To alleviate this inconvenience, caro-kann provides the adaptor utility function. The adaptor function is internally implemented using Immer library's produce function, allowing developers to write code as if they are directly modifying a 'draft' version of the state object. Internally, it maintains immutability while creating a new state object, so developers can intuitively update the state without complex spread operators.