LocalDataSource - add option to find by predicate
Abierto
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.6k
- Forks
- 867
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
like:
findBy(predicate:any): Promise;
this can be the code:
```
LocalDataSource.prototype.findBy = function (predicate){
if (typeof predicate !== 'function') {
throw new TypeError('predicate must be a function');
}
const found = this.data.find(predicate);
if (found) {
return Promise.resolve(found);
}
return Promise.reject(new Error('Element was not found in the dataset'));
}
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.