A TypeScript plugin for BetterScroll that provides enhanced mouse wheel scrolling capabilities with configurable speed, direction, easing, and boundary damping on PC platforms.
Overall
score
98%
Build a mobile-friendly news feed web application that implements pull-to-refresh functionality to load new content.
@generates
/**
* Initializes the news feed with pull-to-refresh functionality
* @param container - The DOM element that will contain the scrollable news feed
* @param options - Configuration options for the feed
* @returns An object with methods to control the news feed
*/
export function initNewsFeed(
container: HTMLElement,
options: NewsFeedOptions
): NewsFeedController;
interface NewsFeedOptions {
/** Callback function to fetch new news items, should return a Promise that resolves when items are loaded */
onRefresh: () => Promise<void>;
/** Initial array of news items to display */
initialItems: NewsItem[];
}
interface NewsItem {
id: string;
title: string;
content: string;
timestamp: number;
}
interface NewsFeedController {
/** Programmatically trigger a refresh */
refresh(): void;
/** Destroy the news feed and clean up resources */
destroy(): void;
/** Add new items to the top of the feed */
prependItems(items: NewsItem[]): void;
}Provides smooth scrolling with pull-to-refresh support for mobile web applications.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-better-scroll--mouse-wheeldocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10