Save audit list into storage so it's kept for the next run#595
Save audit list into storage so it's kept for the next run#595paulirish merged 4 commits intoGoogleChrome:masterfrom
Conversation
|
|
||
| aggregations.forEach(aggregation => { | ||
| frag.appendChild(createOptionItem(aggregation.name)); | ||
| frag.appendChild(createOptionItem(aggregation.name, selectedAudits.indexOf(aggregation.name) > -1)); |
There was a problem hiding this comment.
actually, have to hold off until we're node 6 only :)
| audits = window.getListOfAudits().map(aggregation => aggregation.name); | ||
| } | ||
| // create list of default audits | ||
| const listOfAudits = window.getListOfAudits().map(aggregation => aggregation.name); |
There was a problem hiding this comment.
Can't really follow this bit too closely. Whatcha thinkin?
There was a problem hiding this comment.
window.getListOfAudits() gives me the array with all available audits (checkboxes in the extension). I fetch the name for every bit and than make an object that has the audit as key and value as a boolean. For the list of default audits i put it on true and let the user overwrite it with whatever is in storage.
This gives us the possibility to add more audits without changing storage key with a version in the name.
when looking at that piece of code I can reduce a few lines.
There was a problem hiding this comment.
yah agree. looks like you can do the map and reduce in the same pass. might as well move it to forEach.
|
Once you clarify that map/reduce/assign deal at the end, I think we're good to go. |
|
Updated |
20b9d3c to
d1c7177
Compare
|
nice thx! |

Saves audit list in extension
perhaps tests should be added to the extension as well?