You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Custom transform functions for data normalization
14
+
- Full TypeScript support with proper type inference
15
+
- Error recovery and robust feed parsing
16
+
- HTTP configuration options for headers and timeouts
17
+
18
+
Both collection types provide seamless integration with TanStack DB's live queries and optimistic mutations, allowing you to sync RSS/Atom feed data and query it alongside other collection types.
Copy file name to clipboardExpand all lines: docs/overview.md
+66-2Lines changed: 66 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,8 +154,9 @@ There are a number of built-in collection types:
154
154
1.[`QueryCollection`](#querycollection) to load data into collections using [TanStack Query](https://tanstack.com/query)
155
155
2.[`ElectricCollection`](#electriccollection) to sync data into collections using [ElectricSQL](https://electric-sql.com)
156
156
3.[`TrailBaseCollection`](#trailbasecollection) to sync data into collections using [TrailBase](https://trailbase.io)
157
-
4.[`LocalStorageCollection`](#localstoragecollection) for small amounts of local-only state that syncs across browser tabs
158
-
5.[`LocalOnlyCollection`](#localonlycollection) for in-memory client data or UI state
157
+
4.[`RSSCollection` and `AtomCollection`](#rsscollection-and-atomcollection) to sync data from RSS and Atom feeds with automatic polling
158
+
5.[`LocalStorageCollection`](#localstoragecollection) for small amounts of local-only state that syncs across browser tabs
159
+
6.[`LocalOnlyCollection`](#localonlycollection) for in-memory client data or UI state
159
160
160
161
You can also use:
161
162
@@ -297,6 +298,69 @@ This collection requires the following TrailBase-specific options:
297
298
298
299
A new collections doesn't start syncing until you call `collection.preload()` or you query it.
299
300
301
+
#### `RSSCollection` and `AtomCollection`
302
+
303
+
RSS and Atom feeds are widely used syndication formats for publishing frequently updated content like blogs, news, and podcasts. TanStack DB provides dedicated collection types for both RSS 2.0 and Atom 1.0 feeds with automatic polling, deduplication, and type safety.
304
+
305
+
Use `rssCollectionOptions` for RSS feeds or `atomCollectionOptions` for Atom feeds to sync feed data into collections:
-`feedUrl` — the RSS or Atom feed URL to fetch from
353
+
-`getKey` — identifies the unique ID for feed items
354
+
-`pollingInterval` — how frequently to check for new items (default: 5 minutes)
355
+
356
+
Optional configuration includes:
357
+
358
+
-`transform` — custom function to normalize feed items to your desired format
359
+
-`httpOptions` — custom headers, timeout, and user agent settings
360
+
-`startPolling` — whether to begin polling immediately (default: true)
361
+
-`maxSeenItems` — maximum items to track for deduplication (default: 1000)
362
+
363
+
RSS and Atom collections automatically handle feed parsing, deduplication of items, and provide built-in error recovery. The collections will continue polling even after network failures or parsing errors.
0 commit comments