SuddenDevelopment / json-collection-decorator

efficiently run a collection of records by conditions and decorate them when conditions match, return results - filtered items
MIT License
0 stars 0 forks source link

refactor decorate() for performace #3

Open SuddenDevelopment opened 7 years ago

SuddenDevelopment commented 7 years ago

if there are any validation steps left in decorate, move them to the config function

convert all _.for to normal INCREMENTING for loops

convert all hasOwnProperty to typeof var something ==='undefined'

anderfjord commented 7 years ago

Can you clarify what you mean by "validation steps"? Does this essentially mean any instance of "self.config" that's in the decorator() function?

SuddenDevelopment commented 7 years ago

anything in the decorate function that can be moved to the config function.

some checks against self.config are necessary to know if it needs to performa an action. decorate isn;t that complex, I actually did some refactoring today (already committed)