Conversation
|
Maybe just my personal taste, but if this is purely for aesthetics I find using -- All of these
lume.all({ hasLowHealth, isEnemy, wasJustDamaged })
-- Any of these
lume.any({ hasLowHealth, isEnemy, wasJustDamaged }) |
|
Right, but |
|
No sorry that's my fault as I didn't read the diff all the way through before commenting. Your approach makes perfect sense then for your scenario since you're providing those predicate functions to On a deeper level, I don't know what @rxi's criteria is for accepting new functions to this library. Being this library and your change is tiny there is little worry about bloat, but I can also see the argument in perhaps splitting lume's monolith up into separate rocks ala lodash where you can either require the entire library ( |
Hey! Thanks for creating this library, it's awesome!
I have added some "functional" versions of the logical operations
and,orandnot. These can for example be used together withlume.filter. To get all enemies with low health that have just been damaged we might callI realize the capital letter in
Andis a bit at odds with the naming convention of the library. However I was not allowed to name them in all lowercase letters (which makes sense I guess). If you have any suggestions about naming or anything else I'm happy to change things.If these functions end up being part of the library I'll of course write some documentation as well. If not then that's of course totally fair :))
Cheers!