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

[RFC]Let's Document: How to normalize data using Rematch? #533

Open
haysclark opened this issue Oct 1, 2018 · 7 comments
Open

[RFC]Let's Document: How to normalize data using Rematch? #533

haysclark opened this issue Oct 1, 2018 · 7 comments

Comments

@haysclark
Copy link

@haysclark haysclark commented Oct 1, 2018

I was curious if there is an example of normalizing data with Rematch?

There was a pretty good discussion on this subject in #337; however, I was hoping a more general topic title would get more feedback and ideally examples. I would love to see a Rematch example similar to the user/articles/comments example in normalizr's readme.

@ShMcK ShMcK added the question label Oct 2, 2018
@ShMcK
Copy link
Member

@ShMcK ShMcK commented Oct 2, 2018

The Redux docs provide some best practices: Normalizing State Shape & Updating Normalized Data.

@d3dc
Copy link
Collaborator

@d3dc d3dc commented Oct 2, 2018

I tote this example around a lot: https://codesandbox.io/s/ql6m574l84

This uses normalizr and reselect (@rematch/select) to closely follow the links @ShMcK posted.

Instead of relying on multiple reducers to store each type of entity, a single reducer handles the abstraction by passing Normalizr schemas This reducer handles all our "database tables".

This was just a demo for complex selectors; it definitely could have warts removed. I know delete has several ways it could be handled better. It might be worth it to scale this to the example @haysclark mentioned.

@stale stale bot added the wontfix label Dec 31, 2018
@d3dc d3dc removed the wontfix label Jan 10, 2019
@d3dc
Copy link
Collaborator

@d3dc d3dc commented Jan 10, 2019

Sticking a pin here, because if there's one guide that needs to exist for Rematch, it's CRUD.

@d3dc d3dc pinned this issue Jan 10, 2019
@d3dc
Copy link
Collaborator

@d3dc d3dc commented Jan 10, 2019

I've worked on an implementation of the TodoMVC app using the toolkit I've been hacking on

@rematch rematch deleted a comment from stale bot Jan 10, 2019
@d3dc d3dc changed the title How to normalize data using Rematch? [RFC]Let's Document: How to normalize data using Rematch? Jan 10, 2019
@ShMcK ShMcK unpinned this issue Mar 2, 2019
@stale
Copy link

@stale stale bot commented Apr 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 10, 2019
@stale stale bot closed this May 10, 2019
@mathieutu
Copy link
Contributor

@mathieutu mathieutu commented Sep 4, 2019

@d3dc This issue was automaticaly closed. Could we reopen it? I've exactly the same question.

@th3d0g
Copy link

@th3d0g th3d0g commented Apr 19, 2020

Second that.

@ShMcK ShMcK reopened this Apr 19, 2020
@stale stale bot removed the wontfix label Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.