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

Replace fetch and global pending state #378

Open
rachelekm opened this issue Nov 12, 2021 · 0 comments
Open

Replace fetch and global pending state #378

rachelekm opened this issue Nov 12, 2021 · 0 comments

Comments

@rachelekm
Copy link
Contributor

This project currently uses a custom Conveyal library feature (woonerf’s fetch) as middleware to handle async logic/data fetching within action dispatches. Each call to fetch automatically dispatches another action to increment fetch state, which in turn updates a global pending state (this isLoading state functions as a global conditional for component display until load/state updates are complete). This causes issues as we implement new api calls and want to isolate the effects of a pending state to the component level (see PR #374). Switching to axios and replacing a global pending state dependent on the number of fetches will help us avoid this issue. In addition, we would be better served to replace fetch with axios for more intuitive data fetches and robust error handling.

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

No branches or pull requests

1 participant