Hey folks how are others storing their state? For ...
# redux
t
Hey folks how are others storing their state? For example, are you using a
data class
, a Map, or something else entirely? I'm coming from the JS/TS ecosystem where libraries like ReduxToolkit/Immutable.JS make this a straightforward decision but I'm curious what 'best practice' looks like here in kotlin-land 🙏 In my first attempt I'm using data classes but finding that only 1 or 2 layers of nesting starts to cause issues in my reducers. So i could either go with Maps and forget data classes or reduce the nesting... or perhaps theres a better way altogether?
b
Data class with default values for all fields and sealed classes for actions
so i could do AppSTate() and exhaustive when on reducer
t
okay cool thats mostly where i've landed (although currently using data classes for actions
i assume you use dataClass.copy() inside your reducers?
b
Exactly
🙏 1