m-h-c-t / mh-helper-extension

A Chrome / Firefox browser extension that helps collect data for HitGrab's MouseHunt game
https://www.mhct.win
MIT License
14 stars 15 forks source link

Modularize this anonymous function #215

Open AardWolf opened 1 year ago

AardWolf commented 1 year ago

https://github.com/m-h-c-t/mh-helper-extension/blob/bc35755c5ce2e16b75255a931fa93f964fcb2b08/src/scripts/main.js#L920

If we pull out this functionality into its own function we can more easily test the logic of the function with automated testing -- or from the console.

SyndicateGit commented 3 weeks ago

Hi, I'm new to mh-helper but I have experience working with chrome extension before. If this ticket is still relevant I'd like to take a crack at it.

Edit: To clarify, did you want to modularize the entire journal_enteries markup handling (pass journal_enteries as param) or individual markup (pass markup as param)? I'd feel like markup would be easier to test and read with journal_enteries.forEach( markup => handleJournalEnteriesMarkup(markup);

hymccord commented 2 weeks ago

The whole thing needs to be modularized but the loop would be a great point to start with something small. Similar to the ajax handlers.