You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, what is the best way to get shared Store? InstanceKeeper does not allow to get a store without Factory. But when we are sharing it, I think providing the Factory could lead to unexpected behavior.
The main reason why I need store is that the store creates state which is required by the Dialog. State could be big for serialization...
class CustomDialog : BottomSheetDialogFragment() {
private val sharedStore: SharedStore by lazy {
parentFragment?.instanceKeeper()?.getStore { ..require factory }
}
...
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
sharedStore ?: dismiss() // dismiss if store is not available
...
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there, what is the best way to get shared
Store
?InstanceKeeper
does not allow to get a store withoutFactory
. But when we are sharing it, I think providing theFactory
could lead to unexpected behavior.The main reason why I need store is that the store creates
state
which is required by theDialog
. State could be big for serialization...Beta Was this translation helpful? Give feedback.
All reactions