2
2
2Ernest52021-08-27 10:23:12
Angular
2Ernest5, 2021-08-27 10:23:12

Can pipes be used to filter large arrays?

I wondered how correct and appropriate it would be to use pipes for filtering, sorting and pagination?
Please do not write about the fact that all this needs to be done on the backend, situations are different.

PS By pipe I mean those that are used to transform data https://angular.io/guide/pipes .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2021-08-27
@Xuxicheta

It is possible if you have OnPush and the component is only detected when the array changes.
And the array itself is immutable so that the pipe is pure.
It’s also a good idea if the array is in an observable, and the pipe works as an operator and comes before async

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question