recent-data

Manage recently accessed topics, resources, and pages across user sessions.

81.4k|15.8k|Updated May 21, 2023
One-click install
npx skills add https://github.com/lobehub/lobehub --skill recent-data-lobehub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: recent-data
Source: https://github.com/lobehub/lobehub/tree/main/.agents/skills/recent-data
Command: npx skills add https://github.com/lobehub/lobehub --skill recent-data-lobehub

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Recent Data Skill provides a simple, centralized approach to manage and access items that a user has recently interacted with, across a session, improving navigation and responsiveness.

Core Features & Use Cases

  • Session-persistent recent lists: Tracks recent topics, resources, and pages in a session store for instant recall.
  • Easy integration: Initialize three hooks at app root to preload data and expose it through selectors or return values.
  • Use Cases: Build dashboards or bookmarks where users quickly re-open recently viewed items.

Quick Start

  1. Initialize in app root:
    • Call useInitRecentTopic(), useInitRecentResource(), and useInitRecentPage() to populate the store.
  2. Read or render recent data using selectors or the hook's return value.

Frequently Asked Questions about recent-data

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

FAQPage Schema
How do I track recently viewed items in a React dashboard?

To track recently viewed items in a React dashboard, use a session store to manage recent topics, resources, and pages, enabling instant recall and seamless navigation across user sessions.

What is the best way to persist recent user data across sessions in React?

Persisting recent user data across sessions in React involves using initialization hooks at the app root to preload items into a session store, which then exposes the data via selectors for deterministic loading.

How do I implement type-safe state management for recent pages?

Implement type-safe state management for recent pages by utilizing a session store with initialization hooks and selectors, ensuring deterministic data loading and type safety for recent topics and resources.

Can I use React hooks to preload recent resources when the app starts?

Yes, you can use React hooks to preload recent resources by calling initialization hooks like useInitRecentResource() at the app root, which populates the store before rendering the dashboard.

How do I access recent topics from a session store in my UI components?

Access recent topics from a session store in UI components by using selectors or the return values of initialization hooks, allowing your components to read and render recently accessed data instantly.