<aside> 📍 src/components/ReadingListButton.jsx

</aside>

Functions

add

asynchronous member function of ReadingListButton

Parameters:

none. However, takes id from props.**

Action:

appends id to ReadingList using function pushReadingList from src/utils/readingList, then updates bookmarked. This will re-render the component and update the bookmark icon.

Returns:

none.

Source Code:

const add = async () => {
    const { id } = props;
    await pushReadingList(id);
    setBookmarked(true);
  };

remove

asynchronous member function of ReadingListButton

Parameters:

none. However, takes id from props.**

Action:

removes id from ReadingList using function removeFromReadingList from src/utils/readingList, then updates bookmarked. This will re-render the component and update the bookmark icon.

Returns:

none.

Source Code:

const remove = async () => {
    const { id } = props;
    await removeFromReadingList(id);
    setBookmarked(false);
  };

Components