Dmitry Dagadin
Dmitry Dagadin

Reputation: 19

Purpose of using impure pipe in Angular

What is purpose of impure pipes in Angular? If we use immutable approach and use objects as input values, the pure pipe will change output, and at the same time it will not be called on each change detection, as the impure pipe. Then, some state properties (as cache) we can use in impure and in pure pipe together.

Can you tell me the purpose of impure pipes?

Upvotes: 0

Views: 834

Answers (1)

Jake Smith
Jake Smith

Reputation: 2813

the async pipe is a good example. You are passing an Observable in as the input of the async pipe, which is probably not going to be changing its instance of Observable, so we would want the async pipe to update its output more often then the instance changing.

Upvotes: 3

Related Questions