UNPKG

@knowmax/genericlist-core

Version:

Knowmax Generic list with basic CRUD support without any user interface implementation.

44 lines (32 loc) 1.78 kB
# Knowmax Generic list with basic CRUD support Core implementation for Knowmax Generic list with basic CRUD support without any user interface. Strongly opinionated, but flexible enough to be used in a variety of scenarios. ## Features - **Create, Read, Update, Delete (CRUD)** operations - **Restore functionality** for deleted items - **Filtering, sorting, and pagination** support - **Observable state management** with MobX - **TypeScript support** with full type safety - **Flexible endpoint configuration** - **Error handling** for all operations - **Simple list hook** for lightweight read-only scenarios ## Hooks ### useSimpleList (Recommended for new projects) A lightweight React hook for fetching paginated list data without complex state management or CRUD operations. **Key Features:** - Simple pagination support - Built-in loading and error states - TypeScript support - Manual refetch capability - Automatic request abortion **Use when:** - You need read-only data lists - You want simple pagination without complex state management - You don't need caching functionality - You prefer lightweight components See [SIMPLE_LIST_HOOK.md](./SIMPLE_LIST_HOOK.md) for detailed documentation. ### useList (Legacy - will be deprecated) The original full-featured hook with MobX state management, caching, and CRUD operations. **Note:** This hook will be deprecated in future versions. New projects should use `useSimpleList` for simple scenarios or wait for the upcoming replacement for complex scenarios. ## Restore Functionality The `GenericCudList` class now includes restore functionality to restore previously deleted items. See [RESTORE_FUNCTIONALITY.md](./RESTORE_FUNCTIONALITY.md) for detailed usage instructions.