@replyke/core
Version:
Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.
37 lines (36 loc) • 1.03 kB
TypeScript
import type { List } from "../../interfaces/models/List";
export interface UseListsProps {
}
export interface UseListsValues {
currentList: List | null;
subLists: List[];
loading: boolean;
openList: (list: List) => void;
goBack: () => void;
goToRoot: () => void;
isEntityInList: (selectedEntityId: string) => boolean;
createList: (props: {
listName: string;
}) => Promise<void>;
updateList: (props: {
listId: string;
update: Partial<{
name: string;
}>;
}) => Promise<void>;
deleteList: (props: {
list: List;
}) => Promise<void>;
addToList: (props: {
entityId: string;
}) => Promise<void>;
removeFromList: (props: {
entityId: string;
}) => Promise<void>;
}
/**
* Redux-powered hook that provides the exact same interface as useListsData()
* This is a drop-in replacement for the Context-based hook
*/
declare function useLists(_?: UseListsProps): UseListsValues;
export default useLists;