I’m trying to practice “functional” programming with the quotes machine project. Below is my codepen, and the issues I’m having:
I’m not sure how to trigger the Twitter button properly. Is the click handler in the right place? I’m not sure if passing the author and quote from the getQuotes function is proper organization.
Also it seems like I’m calling the buttons.tweet function every time the page is loaded, or I request a new quote. You can see this in action in the console. It keeps calling buttons.tweet even when the button isn’t clicked.
Lastly, I’m stuck with the twitter url. I can’t seem to put in double quotes, and escaping it properly. I assume I have to use window.open once the url is organized.
Thanks in advance! I would put this in the Project Feedback, but since it’s not finished, I feel like this is the appropriate forum(?)