Jun 4, 2023
You would use `.value` if you wanted to entirely overwrite the previous state. `.update` is used when you have concerns about multiple thread access and atomic updates.
Having said that, you can safely always use `.update`. There's a very slight performance loss with the `compareAndSet` function being called every time so it's up to you if you feel that's worth it.