Hi,
I want to use redux to manage my app state.
As appsync client is already using redux as its offline cache, what should I do? Should I create a new store? Or should I try to use the aacStore?
I'd rather prefer to have only one store, but I found no hooks to plug my own reducers and middlewares.
I too have the same question.
I was thinking of using the apollo-link-state but then i don't get the full benefits of using the AppSync.
Hi @merunga , @M1chaelTran
Soon it should be possible to use apollo-link-state for your local state needs, see https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/24#issuecomment-382066010
amazing @manueliglesias !
and what aboux redux?
@merunga
It is not recommended to use the same store as the AppSync client as it is an implementation detail, in the future redux might not be used by the client at all.
I'm still quite confused about this. We raised a support ticket on our AWS account in July 2018, and the support team just got back to us stating:
According to service team, state management is up to you and you can choose to use whatever you like. That being said, there are issues with using Apollo Link State today and we don鈥檛 recommend using that with aws-appsync-sdk (your local updates might not be persisted under certain circumstances).
I guess that leaves just MobX as a mainstream option for state management? I'm not saying it's required or needed with the latest React hooks, Context API, Apollo render props etc. but it would be nice to know what's the recommended practice.
Most helpful comment
@merunga
It is not recommended to use the same store as the AppSync client as it is an implementation detail, in the future
reduxmight not be used by the client at all.