nostr-infinite-scroll

Create reusable infinite-scroll feeds for Nostr kind 1 events in React using timestamp-based pagination and a hook interface.

Updated Jan 29, 2026
One-click install
npx skills add https://github.com/samthomson/treasure-board --skill nostr-infinite-scroll
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nostr-infinite-scroll
Source: https://github.com/samthomson/treasure-board/tree/main/.claude/skills/nostr-infinite-scroll
Command: npx skills add https://github.com/samthomson/treasure-board --skill nostr-infinite-scroll

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the challenge of building smooth, scroll-driven feeds for Nostr by providing a reusable infinite-scroll pattern.

Core Features & Use Cases

  • Pagination-based loading of Nostr kind 1 events using timestamp offsets
  • Intersection observer driven automatic loading for seamless UX
  • A React hook (useGlobalFeed) that exposes data, error, and fetchNextPage for easy integration

Quick Start

Use the nostr-infinite-scroll skill to initialize a global feed and render it with automatic pagination.

Frequently Asked Questions about nostr-infinite-scroll

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement infinite scroll for a Nostr feed in React?

To implement infinite scroll for a Nostr feed in React, you can use a hook that combines useInfiniteQuery with an intersection observer. This setup automatically loads more kind 1 events as the user scrolls, using timestamp-based pagination for seamless data fetching.

What is the best way to paginate Nostr kind 1 events?

The best way to paginate Nostr kind 1 events is by using timestamp offsets. This approach fetches older events based on their creation time, ensuring chronological order and allowing the feed to load previous pages dynamically as the user scrolls down.

Does useInfiniteQuery work with Nostr feeds?

Yes, useInfiniteQuery works with Nostr feeds by managing the fetchNextPage function for subsequent pages. It integrates smoothly with React UIs to handle data loading states, errors, and the deduplication of events retrieved through timestamp-based pagination schemes.

How do I handle duplicate events when loading more data in a Nostr feed?

To handle duplicate events in a Nostr feed, the infinite scroll workflow includes built-in deduplication logic. This ensures that even when fetching overlapping timestamp-based pages, identical kind 1 events are automatically filtered out before rendering.

Can I use an intersection observer to load Nostr events automatically?

Yes, you can use an intersection observer to load Nostr events automatically. By attaching an observer to the bottom of your feed list, it detects when the user reaches the scroll boundary and triggers the fetchNextPage function to request the next batch.