recent-data

Retrieve recent topics, resources, and pages from a React session store.

Updated Dec 12, 2024
One-click install
npx skills add https://github.com/kingmacth/lobe-chat --skill recent-data-kingmacth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: recent-data
Source: https://github.com/kingmacth/lobe-chat/tree/main/.agents/skills/recent-data
Command: npx skills add https://github.com/kingmacth/lobe-chat --skill recent-data-kingmacth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Recent data (recentTopics, recentResources, recentPages) is stored in session store.

Core Features & Use Cases

  • Auto login detection: Only loads when user is logged in
  • Data caching: Stored in store, no repeated loading
  • Auto refresh: SWR refreshes on focus (5-minute interval)
  • Type safe: Full TypeScript types

Quick Start

Load and display the most recently accessed topics, resources, and pages from the session store.

Frequently Asked Questions about recent-data

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

FAQPage Schema
How do I manage recently used data in a React dashboard without reloading it on every navigation?

Manage recently used data by storing recentTopics, recentResources, and recentPages in a shared session store. This caches the data so components can read it directly without repeated loading when users navigate between views.

What is the best way to keep recent items accessible across multi-component views?

Keeping recent items accessible requires using shared session store selectors. Selectors provide stable reads and consistent UI states across multi-component dashboard views, ensuring users can quickly revisit recent pages and resources.

Does this recent data access pattern require a specific frontend environment to work?

This recent data access pattern requires a React-based UI environment. It also relies on a shared session store and TypeScript to enable type-safe access patterns, lazy loading, and optional auto-refresh capabilities.

How does auto refresh work for cached session data when a user returns to the dashboard?

Auto refresh for cached session data works using SWR. It automatically refreshes the recent topics, resources, and pages when the user focuses on the window, operating on a 5-minute interval to keep the cached data updated.

Can I lazy load recent topics and resources only after login detection?

Yes, you can lazy load recent topics and resources after login detection. The session store only loads this data when the user is logged in, preventing unnecessary fetches and ensuring data caching happens only for authenticated sessions.