When Should You Use Importing JSON Instead of Fetching It?

0
6
Asked By CuriousCoder92 On

Now that importing JSON is supported by all web browsers, I'm wondering when it would be better to use this feature instead of the traditional `fetch()` method or bundling the data. What are the practical use cases for importing JSON directly?

1 Answer

Answered By DataDabbler77 On

Importing JSON could be super handy for accessing external datasets like demographic information or zip code data that's hosted by others. Instead of fetching these files manually, you can import them directly, which saves you from having to integrate updates into your project. It's especially useful when users of your app might need to get their own remote JSON datasets, which can be unpredictable. I've developed analytics applications that lay demographic data over maps, which really showcases the added value of incorporating outside JSON datasets without having to manage synchronization.

JSNerd25 -

But if users can pick new data sources, wouldn't you want to make sure the original data can be garbage collected?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.