Impure pipes should be avoided because they are invoked on each change-detection cycle. Impure pipes can’t leverage caching, instance re-use and simple tests.
An impure pipe executes every time irrespective of whether the source value has changed or not. This can lead to performance degradation; it is one of the reasons pipes are not preferred for filtering data.
@Pipe({
name: 'test',
pure: false
})
class Test {}
@Pipe({
name: 'test',
pure: true
})
class Test {}
@Pipe({
name: 'test'
})
class Test {}