akveo / akveo/ng2-smart-table

LocalDataSource - add option to find by predicate

Abierto
#1,081 0 comentarios 1 reacción 0 asignados Ver en GitHub
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.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.