function which seems very boilerplatey and annoying to work with on a bigger scale (I might be wrong here, this is just what I'm getting from the documentation)
However with the zustand-x library (formerly known as zustood), a lot of boilerplate is removed, and you can persist individual stores.
Example (pay attention that you don't need to create getters or setters when writing your stores either - but you can extend both the selectors and actions on the store if you need to):