Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommended way to use redux #87

Closed
merunga opened this issue Apr 3, 2018 · 5 comments
Closed

Recommended way to use redux #87

merunga opened this issue Apr 3, 2018 · 5 comments
Labels
question Ask us a question

Comments

@merunga
Copy link

merunga commented Apr 3, 2018

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.

@M1chaelTran
Copy link

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.

@nidsharm nidsharm added the question Ask us a question label Apr 10, 2018
manueliglesias added a commit to manueliglesias/aws-mobile-appsync-sdk-js that referenced this issue Apr 16, 2018
Allows the usage of:

- Custom link
- Custom cache
- Custom cache options

Fixes awslabs#3
Fixes awslabs#21
Fixes awslabs#24
Fixes awslabs#36
Fixes awslabs#52
Fixes awslabs#70
Fixes awslabs#87
Closes awslabs#62
@manueliglesias
Copy link
Contributor

Hi @merunga , @M1chaelTran

Soon it should be possible to use apollo-link-state for your local state needs, see #24 (comment)

@merunga
Copy link
Author

merunga commented Apr 17, 2018

amazing @manueliglesias !
and what aboux redux?

@manueliglesias
Copy link
Contributor

@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.

manueliglesias added a commit that referenced this issue Apr 19, 2018
* Use custom link cache and cache options

Allows the usage of:

- Custom link
- Custom cache
- Custom cache options

Fixes #3
Fixes #21
Fixes #24
Fixes #36
Fixes #52
Fixes #70
Fixes #87
Closes #62

* Pass store to OfflineLink when using createAppSyncLink

* Fix eslint rules violations

* Fix typo. Address CR comment.
@richardzyx
Copy link

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’t 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Ask us a question
Projects
None yet
Development

No branches or pull requests

5 participants