Skip to content

Commit 4a4b7a5

Browse files
authored
Merge pull request tomalaforge#591 from svenson95/docs-pipes-changes
Extend docs text for pipe challenges & refactor pipe-easy component
2 parents fef38f8 + d8ed81b commit 4a4b7a5

File tree

3 files changed

+55
-16
lines changed

3 files changed

+55
-16
lines changed

docs/src/content/docs/challenges/angular/10-pipe-utility.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,27 @@ sidebar:
88
order: 202
99
---
1010

11-
The goal of this series of 3 pipe challenges is to master **pipe** in Angular.
11+
## Information
1212

13-
Pure pipes are a very useful way to transform data from your template. The difference between calling a function and a pipe is that pure pipes are memoized. So they won't be recalculated every change detection cycle if their inputs haven't changed.
13+
This is the third of three `@Pipe()` challenges, the goal of this series is to master **pipes** in Angular.
1414

15-
## Information:
15+
Pipes are a very powerful way to transform data in your template. The difference between calling a function and a pipe is that pure pipes are memoized. So they won't be recalculated every change detection cycle if their inputs haven't changed.
1616

17-
In this third exercise, you want to access utils functions. Currently you cannot access them directly from your template. The goal is to create a specific pipe for this utils file where you will need to pass the name of the function you want to call and the needed arguments.
17+
Pipes are designed to be efficient and optimized for performance. They use change detection mechanisms to only recalculate the value if the input changes, to minimize unnecessary calculations and improving rendering performance.
1818

19-
## Constraints:
19+
By default a pipe is pure, you should be aware that setting `pure` to false is prone to be inefficient, because it increases the amount of rerenders.
2020

21-
- must be strongly typed
21+
:::note
22+
A **pure** pipe is only called when the value changes.\
23+
A **impure** pipe is called every change detection cycle.
24+
:::
25+
26+
There are some useful predefined pipes like the DatePipe, UpperCasePipe and CurrencyPipe. To learn more about pipes in Angular, check the API documentation [here](https://angular.io/guide/pipes).
27+
28+
## Statement
29+
30+
In this exercise, you want to access utils functions. Currently you cannot access them directly from your template. The goal is to create a specific pipe for this utils file, where you will need to pass the name of the function you want to call and the needed arguments.
31+
32+
## Constraints
33+
34+
- Must be strongly typed

docs/src/content/docs/challenges/angular/8-pipe-pure.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,27 @@ sidebar:
99
order: 3
1010
---
1111

12-
The goal of this series of 3 pipe challenges is to master **pipe** in Angular.
12+
## Information
1313

14-
Pure pipes are a very useful way to transform data from your template. The difference between calling a function and a pipe is that pure pipes are memoized. So they won't be recalculated every change detection cycle if their inputs haven't changed.
14+
This is the first of three `@Pipe()` challenges, the goal of this series is to master **pipes** in Angular.
1515

16-
## Information
16+
Pipes are a very powerful way to transform data in your template. The difference between calling a function and a pipe is that pure pipes are memoized. So they won't be recalculated every change detection cycle if their inputs haven't changed.
17+
18+
Pipes are designed to be efficient and optimized for performance. They use change detection mechanisms to only recalculate the value if the input changes, to minimize unnecessary calculations and improving rendering performance.
19+
20+
By default a pipe is pure, you should be aware that setting `pure` to false is prone to be inefficient, because it increases the amount of rerenders.
21+
22+
:::note
23+
A **pure** pipe is only called when the value changes.\
24+
A **impure** pipe is called every change detection cycle.
25+
:::
26+
27+
There are some useful predefined pipes like the DatePipe, UpperCasePipe and CurrencyPipe. To learn more about pipes in Angular, check the API documentation [here](https://angular.io/guide/pipes).
28+
29+
## Statement
1730

18-
In this first exercise, you call a simple function inside your template. The goal is to convert it to a pipe.
31+
In this exercise, you need to refactor a transform function inside a component, which is called inside your template. The goal is to convert this function to a pipe.
1932

2033
## Constraints
2134

22-
- must be strongly typed
35+
- Must be strongly typed

docs/src/content/docs/challenges/angular/9-pipe-wrapFn.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,28 @@ sidebar:
99
order: 103
1010
---
1111

12-
The goal of this series of 3 pipe challenges is to master **pipe** in Angular.
12+
## Information
1313

14-
Pure pipes are a very useful way to transform data from your template. The difference between calling a function and a pipe is that pure pipes are memoized. So they won't be recalculated every change detection cycle if their inputs haven't changed.
14+
This is the second of three `@Pipe()` challenges, the goal of this series is to master **pipes** in Angular.
1515

16-
## Information:
16+
Pipes are a very powerful way to transform data in your template. The difference between calling a function and a pipe is that pure pipes are memoized. So they won't be recalculated every change detection cycle if their inputs haven't changed.
1717

18-
In this second exercise, you are calling multiple functions inside your template. You can create a specific pipe for each of the functions but this will be too cumbersome.
18+
Pipes are designed to be efficient and optimized for performance. They use change detection mechanisms to only recalculate the value if the input changes, to minimize unnecessary calculations and improving rendering performance.
19+
20+
By default a pipe is pure, you should be aware that setting `pure` to false is prone to be inefficient, because it increases the amount of rerenders.
21+
22+
:::note
23+
A **pure** pipe is only called when the value changes.\
24+
A **impure** pipe is called every change detection cycle.
25+
:::
26+
27+
There are some useful predefined pipes like the DatePipe, UpperCasePipe and CurrencyPipe. To learn more about pipes in Angular, check the API documentation [here](https://angular.io/guide/pipes).
28+
29+
## Statement
30+
31+
In this exercise, you are calling multiple functions inside your template. You can create a specific pipe for each of the functions but this will be too cumbersome.
1932
The goal is to create a `wrapFn` pipe to wrap your callback function though a pipe. Your function MUST remain inside your component. **`WrapFn` must be highly reusable.**
2033

2134
## Constraints:
2235

23-
- must be strongly typed
36+
- Must be strongly typed

0 commit comments

Comments
 (0)