You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In comments.js, the toggling listener starting at line 51 gets its own state by examining textContent.
Which is a nice quick way to avoid extra code, but is viewed as bad practice, compared to having a state toggle. Whether or not it actually is in this case is a matter for debate ;)
In code with more folks working on it, the textContent may end up being changed without knowing that this functionality depends on it.
It may also hold a wrong status in unusual cases, such as before your async function has called back, or if there is an error. Again though, in this case, not so important, since you display 'hide comments' once there are comments loaded to hide.
The text was updated successfully, but these errors were encountered:
In comments.js, the toggling listener starting at line 51 gets its own state by examining textContent.
Which is a nice quick way to avoid extra code, but is viewed as bad practice, compared to having a state toggle. Whether or not it actually is in this case is a matter for debate ;)
In code with more folks working on it, the textContent may end up being changed without knowing that this functionality depends on it.
It may also hold a wrong status in unusual cases, such as before your async function has called back, or if there is an error. Again though, in this case, not so important, since you display 'hide comments' once there are comments loaded to hide.
The text was updated successfully, but these errors were encountered: