11ty/eleventy-fetch

Can this plugin be used with Axios together?

winston0410 opened this issue · 6 comments

Can this plugin be used with Axios together? Is there any example I can set this up properly?

Hey @winston0410,
I know it’s old, but did you end up finding a solution?

:)

So i made it work:
here is an example with a graphql Api, but the idea is the same, just make sure that you wait the resolve of the promise so the data is actually updated, otherwise it will not update the site.

(also, having an option in the config to allow/disallow the cache is not a bad idea imho :-D

https://gitlab.coko.foundation/julientaq/flax-aperture/-/blob/master/src/data/articleQuery.js

For the record, the idea here is to use axios behind the scenes instead of node-fetch right?

Putting this one in the enhancement queue

I think it would be awesome to pull out the fetching code to allow adapters here, especially since Node is getting first class fetch.

This repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open.

View the enhancement backlog here. Don’t forget to upvote the top comment with 👍!

Removing this one from the enhancement queue. Subscribe to #19 instead.