spaceninja + fetch   8

javascript - Trying to use fetch and pass in mode: no-cors - Stack Overflow
But if a site sends no Access-Control-Allow-Origin header in its responses, there’s no way your frontend code can directly access responses from that site. In particular, you can’t fix it by specifying mode: 'no-cors' (in fact that’ll ensure your frontend code can’t access the response contents).
fetch  cors  no-cors  access-control-allow-origin  frontend  javascript 
8 weeks ago by spaceninja
Working with GraphQL using Vanilla JS
Let’s build a simple form that can communicate with a GraphQL API and search titles of books. We will only use HTML5, CSS3 and ES6 JavaScript.
javascript  es6  graphql  fetch  async  vanilla 
12 weeks ago by spaceninja
let's make a list of quest structures that invert/subvert/pervert(?) the "fetch quest"
let's make a list of quest structures that invert/subvert/pervert(?) the "fetch quest"

- go here and destroy an object of great value
- go here and prevent others from taking an object of great value (please don't take it yourself)
- prove an object is not found in this place
games  rpgs  fetch  quests  dnd  writing 
january 2020 by spaceninja
Error handing when using the vanilla JS fetch() method with async and await | Go Make Things
Today, we’re going to look at how to handle errors when using the fetch() method with async and await.
javascript  fetch  async  await  catch  errors 
december 2019 by spaceninja
You may not need Axios - Dan Levy's Programming Blog
Despite using fetch for 2 years (including for non-trivial tasks: file uploads & error/retry support) I still had misconceptions of fetch’s abilities and limits. (Specifically regarding progress updates or canceling requests.)
youdontneed  youmightnotneed  axios  api  javascript  fetch 
december 2019 by spaceninja
SoFetch JS Function vs Axios
If the Fetch API seems a little cumbersome and you don’t want to reach for Axios, you can always make a handy little function that applies your defaults (assumes JSON) and can be overwritten if needed
javascript  fetch  axios  ajax  json 
november 2018 by spaceninja
The Evolution of Async JavaScript: From Callbacks, to Promises, to Async/Await
We’ve invented “patterns” for handling fetching external data for our apps. Like most things, these patterns each have tradeoffs that have changed over time. In this post we’ll break down the pros and cons of three of the most common patterns, Callbacks, Promises, and Async/Await and talk about their significance and progression from a historical context.
fridayfrontend  video  javascript  ajax  callbacks  promises  async  await  fetch 
november 2018 by spaceninja
How to fetch data in React
However, at some point you want to request real world data from an own or a third-party API. The article gives you a walkthrough on how to fetch data in React. There is no external state management solution, such as Redux or MobX, involved to store your fetched data. Instead you will use React’s local state management.
react  javascript  tutorials  ajax  fetch  async  await 
november 2018 by spaceninja

Copy this bookmark: