TLDR Web Dev · ARTICLES & TUTORIALS

SUPPORTING OFFLINE MODE IN TANSTACK QUERY

lucas-barake.github.io11 min read

Summary from the TLDR Web Dev newsletter

Effect Schema, a validation library, can be used for achieving full offline support with TanStack Query. It allows for bi-directional parsing, eliminating the need for separate schemas for encoding and decoding data. This article goes through how to store data locally (using IndexedDB or LocalStorage), implement cache removal, set cached data, and handle mutations.