How do you handle fetching data from REST API and caching?

This page summarizes the projects mentioned and recommended in the original post on /r/SwiftUI

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • Pigeon

    Async state management for SwiftUI (and UIKit) 🐦 (by fmo91)

  • Pigeon is a library that comes pretty close to what I had in mind as it is even inspired by React Query, however, it still seems a bit unfinished and the project might even be more or less dead already, so I'm a bit worried building my app around it.

  • Kingfisher

    A lightweight, pure-Swift library for downloading and caching images from the web.

  • Image loading, displaying and caching is a very similar problem and it seems there are some pretty good solutions available (e.g. Kingfisher), so I'm quite surprised that I'm struggling to find a popular/reliable/stable solution for (REST) API data.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • react-query

    Discontinued 🤖 Powerful asynchronous state management, server-state utilities and data fetching for TS/JS, React, Solid, Svelte and Vue. [Moved to: https://github.com/TanStack/query]

  • In a React (JavaScript) environment I found React Query does a fantastic job. Basically, you tell it how to fetch data and it automatically re-renders the component (view) whenever the state changes, e.g. idle, fetching, error, or the actual result data. In addition you can easily define caching behaviour globally or for each query (API endpoint) individually, how long stale data is acceptable etc., plus, data is shared between all views/components that require it. The library abstracts away a lot of common yet pretty hard to manage tasks whilst still being flexible.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Load Dynamic SVG in SwiftUI as an Image

    1 project | /r/swift | 1 Jul 2023
  • Question about Apple's review

    6 projects | /r/iOSProgramming | 17 May 2023
  • Storage of 1000's of images for Travel app

    1 project | /r/SwiftUI | 1 May 2023
  • Best way to extract text and images from html code in order?

    1 project | /r/iOSProgramming | 30 Jan 2023
  • Collection view downloading wrong image

    1 project | /r/swift | 26 Dec 2022