Created
May 6, 2016 15:32
-
-
Save belukov/2294fc4e0b0ba0cefe59a4d56010f6e1 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
| (function(localCallback) { | |
| if(curCategory) { | |
| curCategory.getChilds(function (err, childs) { | |
| // ... | |
| var conds = {}; | |
| // ... many code for cimplicated conds ... | |
| return localCallback(null, conds); | |
| }) | |
| } else { | |
| return localCallback(null, {}); | |
| } | |
| })(function(err, conditions) { | |
| if(err) // ... | |
| // some code for both cases | |
| SomeModel.find(conditions, function() { | |
| // ... | |
| }) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment