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

Refactor AJAX with Fetch API #18

Open
digilou opened this issue Mar 20, 2018 · 9 comments
Open

Refactor AJAX with Fetch API #18

digilou opened this issue Mar 20, 2018 · 9 comments
Assignees

Comments

@digilou
Copy link
Collaborator

digilou commented Mar 20, 2018

It sounds like ES6 promises open a whole new door for API calls. It may even offer better performance and security. I'd like to give it a shot later on in the project, once all the functionality has been worked out.

@digilou digilou self-assigned this Mar 20, 2018
@digilou
Copy link
Collaborator Author

digilou commented Mar 20, 2018

Note: this has the potential of opening up a can of worms, like installing Babel into our project....

@ddcornwall
Copy link
Owner

Promises for APIs? I'm intrigued. I'll probably want to take the udacity course you took so I'm sorta up to speed. But yeah, let's think about this for a future release.

Speaking of AJAX, I wanted to let you know that the json scripts now throw cross domain errors when working locally. It works in Edge locally and is still working on our GitHub pages. I'm guessing that's an update from Chrome.

@digilou digilou removed the question label Mar 25, 2018
@ddcornwall
Copy link
Owner

@digilou Do you expect promises to only affect our current JSON block? Might it have implications for the displayResults function? I'm thinking of doing some refactoring of the display code based on what I've learned in Practical JavaScript. I'm deciding whether I need to take the promises course before or after.

@digilou
Copy link
Collaborator Author

digilou commented Mar 29, 2018

That's a good question @ddcornwall. I'm not sure, as I haven't evaluated your JS code all that closely. Refactoring is always a work in progress. I say, refactor, then worry about promises later.

@digilou digilou changed the title Refactor AJAX into Promises Refactor AJAX with Fetch API Jun 23, 2018
@digilou
Copy link
Collaborator Author

digilou commented Jun 23, 2018

Recently learned more about this in my Mobile Web Specialist class. The Fetch API is the modern way to handle these requests. It is not supported by IE 11 or Opera Mini, but there is a fetch polyfill available here on Github.

@digilou
Copy link
Collaborator Author

digilou commented Jun 23, 2018

Looks like the non-nanodegree version for learning is available as a 3-week course: Asynchronous JavaScript Requests, which looks like the lessons I'm currently going through. Once I finish the Fetch lesson, I will have a better idea about how to implement this.

@digilou
Copy link
Collaborator Author

digilou commented Aug 19, 2018

@ddcornwall I'm working on this right now, while Fetch is fresh in my mind from my Google/Udacity coursework.

@digilou
Copy link
Collaborator Author

digilou commented Nov 13, 2018

Finished my nanodegree! So now I'm ready to get back to personal projects (like this) and apply what I've successfully learned.

@ddcornwall
Copy link
Owner

ddcornwall commented Nov 13, 2018 via email

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

2 participants