wp-commentspackage to your project:
@comments/:idhandler to fetch all the comments of a specific post (
state.source.get("@comments/60")to get the ID's of these comments.
state.comments.forms[postId]to store the data of the comment and the submission status.
state.comments.forms[postId]can be updated through the action
state.comments.forms[postId]and if there are errors they will be available at the properties
wp-sourcehandler gets all comments published in the specified post (using its ID) and creates a tree structure with comments and their replies in the data object.
frontity.state.source.data["@comments/60/"]) with a tree structure of comments and replies, sorted by date (most recent first).
wp-commentspackage stores a map of objects by post ID in
state.comments.forms. Each of these objects represents one comment form. These objects are intended to be used as the state of React
<form>components and contain the input values as well as the submission status. They have the following properties:
updateFields()action described later.
postId. This action simply updates what is stored in
state.comments.forms[postId].fieldswith the given values.
postId. It submits the fields stored in the respective form (i.e.
state.comments.forms[postId]) or the fields passed as a second argument. If fields are passed, those replace the current values stored in
state.comments.forms[postId].isSubmittedproperty (described above) to determine the submission status.