feat(pagination): add updateItem for in-place list updates and optimize notifications
Add `updateItem` function to cursor pagination hook for updating single items without full list refresh. Use this in NotificationsScreen to mark messages as read locally instead of refetching. Also add `is_blocked` detection in postService and userProfile to show blocked state in profile screen.
This commit is contained in:
@@ -240,6 +240,8 @@ export interface CursorPaginationActions<T> {
|
||||
reset: () => void;
|
||||
/** 设置数据(用于外部数据注入) */
|
||||
setList: (list: T[], nextCursor: string | null, prevCursor: string | null, hasMore: boolean) => void;
|
||||
/** 就地更新单条数据 */
|
||||
updateItem: (id: string, updates: Partial<T>) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user