Allow callback finding all data.
- Dominant language
- JavaScript
- Stars
- 327
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
Hi there,
The current version does not allow set a callback when we use the find function with no parameters.
An enhancement maybe,
``` javascript
find: function (obj, callback) {
if (!obj) {
if(callback){
callback(err, cache);
} else{
return cache;
}
} else {
var result = [];
for (var key in obj) {
for (var i = 0; i < cache.length; i++) {
if (cache[i][key] == obj[key]) {
result.push(cache[i]);
}
}
}
if (callback)
callback(err, result);
else
return result;
}
},
```
What do you think @djyde? By the way, awsome work!!!
Cheers
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.