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

PWA: Make 1 call to the spreadsheet instead of scattered calls #54

Open
Alex-Cannon opened this issue Oct 29, 2019 · 2 comments
Open

PWA: Make 1 call to the spreadsheet instead of scattered calls #54

Alex-Cannon opened this issue Oct 29, 2019 · 2 comments
Assignees
Labels

Comments

@Alex-Cannon
Copy link
Collaborator

Right now there are separate calls for the google spreadsheet. In order to make the app easier to migrate to a PWA, we need to make 1 or a few calls to the google spreadsheet instead of calls scattered around.

For example, the search page pulls the google sheet and the home page does as well. These can both share the google sheet state (which should be similar to a commander-style design pattern).

Results

The google spreadsheet should be a single source of truth, or in other words, there should be exclusively 1 place where the sheet state exists and should only be pulled if necessary.

@Alex-Cannon
Copy link
Collaborator Author

Alex-Cannon commented Oct 29, 2019

Great! Thanks to a happy coincidence, I was able to request and be assigned to a work task today: "Investigate a global state management solution." So there should be at least some overlap between that task and #54.

But going into it, I strongly suspect that the built-in React Context API will be the best/simplest solution.. We use it now at work, and I've also used Redux on a few other projects, but Redux seems like overkill for this.

@Alex-Cannon and @Vpr99, do you have experience with (or a preference for) using the Context API, Redux, MobX, and/or Apollo Client?

@airandfingers yes, I've used redux and useContext in place of redux. We should use useContext and useReducer to have the same result as using redux.

State can be managed is specific components if and only if that component uses that state exclusively. Otherwise, everything else should be in a giant state object.

  • Message me on slack if you want more background / direction on this.

@Alex-Cannon
Copy link
Collaborator Author

I'll start work on this this weekend.

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

Successfully merging a pull request may close this issue.

1 participant