codyswanner / Meme-Cataloger

Learning ReactJS and Django while building something that I want to use
1 stars 1 forks source link

Refactor FilterConsumer.update_tags? #84

Open codyswanner opened 4 months ago

codyswanner commented 4 months ago

In attempting to write tests for FilterConsumer methods, I have found the update_tags method to be extremely unwieldy and not up to the standards for focus of purpose that I'd like to have for functions/methods. From the perspective of FilterConsumer, the only purpose the update_tags method serves is to route data into the add_tag, remove_tag and create_tag methods, and if it were simply given that data directly as a WebSocket message with either "addTag", "removeTag" or "createTag" as the "type" then the update_tags method could be completely removed. The current "updateTags" messages are coming from TagPopperContent.js, which would need to be refactored to know whether a tag addition, removal or creation is warranted and pass that to the FilterConsumer.

Is it worth refactoring TagPopperContent.js so that FilterConsumer can be cleaned up?