Created
February 18, 2014 03:44
-
-
Save GirlBossRush/9064328 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Remove completed and skipped items. | |
| // REFACTOR: Consider doing this in the visual. | |
| // Different visuals may want to use these items. | |
| var removedCompletedItems = 0, | |
| removedSkippedItems = 0; | |
| _.values(MemoryBank.items).forEach(function (item) { | |
| if (item.memories.completed) { | |
| delete MemoryBank.items[item.id]; | |
| removedCompletedItems += 1; | |
| } | |
| if (item.memories.skipped) { | |
| delete MemoryBank.items[item.id]; | |
| removedSkippedItems += 1; | |
| } | |
| }); | |
| Logger.info("MemoryBank", removedCompletedItems + " completed items removed.", | |
| removedSkippedItems + " skipped items removed.", | |
| _.size(MemoryBank.items) + " items remain."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment