Home > Back-end >  Purpose of using impure pipe in Angular
Purpose of using impure pipe in Angular

Time:08-04

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?

CodePudding user response:

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.

  • Related