Skip to content

@sqlrooms/discuss / DiscussSliceState

Type Alias: DiscussSliceState

DiscussSliceState = object

Properties

discuss

discuss: object

NameTypeDescription
userIdstring-
configDiscussSliceConfig-
submitEdit()(text) => voidSubmit content based on current UI state (add discussion, reply to discussion/comment, or edit). This automatically handles state management and is the preferred way to submit content.
replyToItemReplyToItem | undefinedCurrent discussion or comment being replied to. Used by the form to determine context when submitting.
setReplyToItem()(replyToItem) => voidSets the discussion or comment being replied to. Will clear editing state if set.
editingItemEditingItem | undefinedCurrent discussion or comment being edited. Used by the form to determine context when submitting.
setEditingItem()(editingItem) => voidSets the discussion or comment being edited. Will clear replyTo state if set.
itemToDeleteDeleteItem | undefinedItem currently targeted for deletion. Used by the delete confirmation dialog.
setItemToDelete()(item) => voidSets the discussion or comment to be deleted. Should be used before showing the confirmation dialog.
highlightedDiscussionIdstring | undefinedCurrently highlighted discussion. Used to visually highlight a discussion in the UI.
setHighlightedDiscussionId()(discussionId) => voidSets the highlighted discussion.
handleDeleteConfirm()() => voidHandles the confirmation of a delete operation. Should be called after the user confirms deletion in the UI.
setConfig()(config) => voidSets the config for the discuss slice.
getReplyToUserId()() => stringHelper function to get the user ID of the entity being replied to. Returns '' if no reply context is set, or the user ID if a valid reply context exists.
getEditingItemText()() => stringHelper function to get the text of the item being edited. Returns '' if no editing context is set, or the text content if a valid editing context exists.
addDiscussion()(text, anchorId?) => void-
editDiscussion()(id, text) => void-
removeDiscussion()(id) => void-
addComment()(discussionId, text, parentId?) => void-
editComment()(discussionId, commentId, text) => void-
removeComment()(discussionId, commentId) => void-