Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e78cd02

Browse files
authored
Merge pull request #1611 from swami-sanapathi/fix/docs
chore(docs): enhanced documentation quality.
2 parents 084f4fa + d948e90 commit e78cd02

28 files changed

+88
-88
lines changed

apps/docs/docs/cdk/coalescing/coalescing.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ In RxAngular coalescing is used for merging multiple emissions, streams or calls
5959

6060
The next example shows the effect of coalescing visualized in flame charts.
6161

62-
![coalesceWith - micro taks duration selector](https://raw.githubusercontent.com/rx-angular/rx-angular/main/libs/cdk/coalescing/docs/images/rx-angular-cdk-coalescing_duration-selector-micro-task.png)
62+
![coalesceWith - micro tasks duration selector](https://raw.githubusercontent.com/rx-angular/rx-angular/main/libs/cdk/coalescing/docs/images/rx-angular-cdk-coalescing_duration-selector-micro-task.png)
6363
_no coalescing vs. coalescing on microtask. visualized in flame charts_
6464

65-
The non-coalesced component has three consequetive heavy computations in the template whilest the coalesced component only has to do the same computation once in order to complete the same job.
65+
The non-coalesced component has three consecutive heavy computations in the template while the coalesced component only has to do the same computation once in order to complete the same job.
6666
Even on a small components scale the difference in performance can be significant.
6767

6868
## Available approaches
@@ -137,7 +137,7 @@ As these situations typically occur across multiple components or are hard to sc
137137
</div>
138138
```
139139

140-
**Event Bubbling of smae event on multiple elements**
140+
**Event Bubbling of same event on multiple elements**
141141

142142
```html
143143
<div (click)="doStuff()">
@@ -205,7 +205,7 @@ from([1, 2, 3]).pipe(coalesceWith()).subscribe(doStuff); // 1 x doStuff logs 3
205205
By default, the duration in which values get united is derived from a micro task which executes immediately after the synchronous code got executed.
206206

207207
See the diagram for details:
208-
![coalesceWith - macro taks duration selector](https://raw.githubusercontent.com/rx-angular/rx-angular/main/libs/cdk/coalescing/docs/images/rx-angular-cdk-coalescing_duration-selector-micro-task-flames.png)
208+
![coalesceWith - macro task duration selector](https://raw.githubusercontent.com/rx-angular/rx-angular/main/libs/cdk/coalescing/docs/images/rx-angular-cdk-coalescing_duration-selector-micro-task-flames.png)
209209

210210
To have more fine-grained control over the duration of coalescing an optional parameter `durationSelector` is provided.
211211
`durationSelector` is of type `Observable<unknown>` and the first emission of it terminates the coalescing duration.
@@ -249,7 +249,7 @@ from([1, 2, 3]).pipe(coalesceWith()).subscribe(doStuff); // 1 x doStuff logs 3
249249
```
250250

251251
It makes sense because we want to render only the last update to the component. To do this, `coalesceWith` maintains a flag for each subscription.
252-
The wanted bevavior should execute change detection only once per component.
252+
The wanted behavior should execute change detection only once per component.
253253

254254
This can be achieved by scoping the flag that maintains coalescing to a specific thing. e.g. the component.
255255

@@ -269,7 +269,7 @@ The following diagram illustrates change detection in component level:
269269
![coalesceWith - multiple components with component scope](https://raw.githubusercontent.com/rx-angular/rx-angular/main/libs/cdk/coalescing/docs/images/rx-angular-cdk-coalescing__coalesceWith-on-component-component-scope.png)
270270

271271
> **⚠ Notice:**
272-
> Be cautious with globally shared coalescing scopes. It could lead to unwanted behaviour and loss of updates when used incorrectly.
272+
> Be cautious with globally shared coalescing scopes. It could lead to unwanted behavior and loss of updates when used incorrectly.
273273
274274
![coalesceWith - multiple components with global scope](https://raw.githubusercontent.com/rx-angular/rx-angular/main/libs/cdk/coalescing/docs/images/rx-angular-cdk-coalescing__coalesceWith-on-component-global-scope.png)
275275

@@ -301,7 +301,7 @@ The example below shows multiple components rendering the same or parts of the s
301301

302302
**The different usages are as follows:**
303303

304-
- As operator in the compomponent class
304+
- As operator in the component class
305305
- As pipe in the component's template
306306
- As structural directive in the component's template
307307

apps/docs/docs/cdk/coercing/coercing.mdx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ Another type where we also can apply coercing is the `Observable` type.
5656

5757
In practice you can apply this technique in 2 ways:
5858

59-
- **explicitly** e.g. `Number(string)` coercres a string to a number
60-
- **implicitely** e.g. `!!string` coerces a string to a boolean
59+
- **explicitly** e.g. `Number(string)` coerces coerce a string to a number
60+
- **implicitly** e.g. `!!string` coerces a string to a boolean
6161

62-
In general when we apply those techniques our code base starts to maintain repetative patterns which either bloten up the codebase or just makes it harder to read.
62+
In general when we apply those techniques our code base starts to maintain repetitive patterns which either bloten up the codebase or just makes it harder to read.
6363

6464
As an example let's look at this snippet of code here:
6565

@@ -68,16 +68,16 @@ const num =
6868
!isNaN(parseFloat(valueFromInput)) && !isNaN(Number(valueFromInput));
6969
```
7070

71-
Because we receive the value from an input the type is always string. We have to care every time the when we want to pass the value to get a propper number type of it.
71+
Because we receive the value from an input the type is always string. We have to care every time the when we want to pass the value to get a proper number type of it.
7272

7373
Furthermore, in version 10 of Angular the team announced strict type checking as opt-in configuration.
74-
Since then, developers where encurraged to match the types exaclty. This especially needs attention when it comes to templates.
74+
Since then, developers where encouraged to match the types exactly. This especially needs attention when it comes to templates.
7575

7676
For this very reason the team later on shipped a sub package under the Angular CDK to provide some helpers for the important cases.
77-
The included helpers can be used whenever coercing is needed to obtain a propper value.
77+
The included helpers can be used whenever coercing is needed to obtain a proper value.
7878

79-
RxAngular also spotted a often used pattern of cosercing.
80-
When trying out the different reactive architectures we realized for a nice to use mix of reactive and imperative programming we needed to accept statis values as well as Observables on many places.
79+
RxAngular also spotted a often used pattern of coercing.
80+
When trying out the different reactive architectures we realized for a nice to use mix of reactive and imperative programming we needed to accept static values as well as Observables on many places.
8181

8282
A common scenario would be to pass an Observable as input binding of components or directives to bypass changes from change detection.
8383

@@ -138,7 +138,7 @@ yarn add @rx-angular/cdk
138138

139139
### Usage
140140

141-
In the following we will sketch some usecases where coercing operators can be used.
141+
In the following we will sketch some use cases where coercing operators can be used.
142142

143143
**coerceObservable**
144144

@@ -226,12 +226,12 @@ To get a quick understanding of the difference of an first-order and higher-orde
226226
![rxjs_order-of-observables_michael-hladky](https://user-images.githubusercontent.com/10064416/129426892-64ff26e7-3271-412f-ba29-b7bd940ff0d3.png)
227227

228228
As we can see the upper half of the image represents a stream of single values, where the lower part represents a stream of streams of single values.
229-
The order (first, second, thrid) is determined by the level of "nesting" of the streams.
229+
The order (first, second, third) is determined by the level of "nesting" of the streams.
230230

231231
Where the above operators where solving only the coercing to observables, the factory here helps to process them.
232232

233-
The question to answer here is if we receive a series of observables, how do we deat with all the streams?
234-
Should we merge them all togeather aor should we stop the previouse and start the new one? Or should we even queu them up?
233+
The question to answer here is if we receive a series of observables, how do we dealt with all the streams?
234+
Should we merge them all together aor should we stop the previous and start the new one? Or should we even queue them up?
235235

236236
A minimal implementation if it would look like this:
237237

@@ -253,10 +253,10 @@ export class AppComponent {
253253
}
254254
```
255255

256-
Here we apply the `switchAll` operator to unsubscribe the previouse observable and subscribe to the new one.
256+
Here we apply the `switchAll` operator to unsubscribe the previous observable and subscribe to the new one.
257257
![switchAll](https://user-images.githubusercontent.com/10064416/129447011-ca4fb691-faa7-4a58-b7fb-8f64ec249729.png)
258258

259-
by using the `coerceAllFactory` function we can compose this pattern with less code and still have the option to decide on the way of compostion.
259+
by using the `coerceAllFactory` function we can compose this pattern with less code and still have the option to decide on the way of composition.
260260

261261
```typescript
262262
@Component({

apps/docs/docs/cdk/render-strategies/render-strategies.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ yarn add @rx-angular/cdk
5353

5454
## Motivation
5555

56-
Angulars change detection is pull-based and implicit.
56+
Angular's change detection is pull-based and implicit.
5757
This affects not only the performance but also forces us into specific ways of architecting and thinking.
5858

5959
Render strategies serve as the core of the new change detection system.
@@ -74,12 +74,12 @@ This architecture enables modern features like:
7474
- [x] Render Callback
7575
- [x] Performance best practices as default
7676

77-
`@rx-angular/cdk` comes preconfigured with two sets of strategies.
77+
`@rx-angular/cdk` comes pre-configured with two sets of strategies.
7878

7979
**BasicStrategies**
8080

8181
[BasicStrategies](strategies/basic-strategies.md) wrap modern ivy APIs like `ɵmarkDirty` and `ɵdetectChanges` as well as a strategy to "noop" change detection.
82-
As a fallback for the migration process or comparison testing, Angulars default change detection behaviour is also provided as a strategy.
82+
As a fallback for the migration process or comparison testing, Angular's default change detection behavior is also provided as a strategy.
8383

8484
This set aims to get the first option for zone-less rendering (`ɵmarkDirty`), more control on the top-down process, and improve performance drastically by only rendering components that received updates.
8585

@@ -149,14 +149,14 @@ yarn add @rx-angular/cdk
149149

150150
## Configuration
151151

152-
By default, RxAngular render strategies are preconfigured in a way they are still way more performant than native Angular but focusing on being as non-breaking as possible.
152+
By default, RxAngular render strategies are pre-configured in a way they are still way more performant than native Angular but focusing on being as non-breaking as possible.
153153
In the majority of cases, you can just drop in the new features, and everything works as before.
154154

155155
You can then partially enable more performance features of RxAngular.
156156

157-
Configurations are done with Angular best practies and based on `InjectionToken`'s.
157+
Configurations are done with Angular best practices and based on `InjectionToken`'s.
158158

159-
> As all configurtion are controlled by `RxStrategyProvider`, an Angular service, we can apply
159+
> As all configuration are controlled by `RxStrategyProvider`, an Angular service, we can apply
160160
> all knowledge of Angular DI on global and local level including all life cycles.
161161
162162
We can configure on the following levels:
@@ -335,7 +335,7 @@ Again, `RxStrategyProvider` needs to get imported, and the scheduling APIs needs
335335

336336
```typescript
337337
@Injectable({
338-
profidedIn: 'root',
338+
providedIn: 'root',
339339
})
340340
export class AnyService {
341341
constructor(

apps/docs/docs/cdk/render-strategies/strategies/basic-strategies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ In a simple setup the pull might be a quick solution and you just `.get()` the v
7474

7575
Compare it with HTTP calls vs WebSockets.
7676

77-
If we apply this concepts to our change detection mechanics we can directly apply changes where they are needd and skip nearly all the unnessecary work.
77+
If we apply this concepts to our change detection mechanics we can directly apply changes where they are need and skip nearly all the unnecessary work.
7878

7979
In combination with Observables, and EmbeddedViews change detection can be speed up dramatically by this architecture.
8080

apps/docs/docs/cdk/render-strategies/strategies/concurrent-strategies.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ There are 5 core concepts of the concurrent strategies:
1717

1818
The Browser has only one UI thread (main thread), meaning things happen one after another.
1919

20-
Users constantly interract with our site and this means if our main thread is busy, they can't interact whit the page. The events like scroll or click will get delayed until the main thread is unblocked from work again and can process those interactions.
20+
Users constantly interact with our site and this means if our main thread is busy, they can't interact whit the page. The events like scroll or click will get delayed until the main thread is unblocked from work again and can process those interactions.
2121

2222
![Render Strategies - Frame Drop Overview](https://user-images.githubusercontent.com/10064416/145212039-b4b20fe5-19c9-4062-aba3-b5749cca978d.png)
2323

@@ -73,7 +73,7 @@ A simple way to schedule work is using `setTimeout`.
7373

7474
```typescript
7575
function work(): viod {
76-
concole.log('work done!');
76+
console.log('work done!');
7777
}
7878

7979
const asyncId = setTimeout(work);
@@ -122,7 +122,7 @@ All scheduled tasks will end up in the same task of the main thread.
122122

123123
![Render Strategies-chunking-animation-frame](https://user-images.githubusercontent.com/10064416/145215060-56d037a7-ec51-4846-9e78-a0f358128c61.png)
124124

125-
The image shows that all AnimatioFrame events end up in the same task.
125+
The image shows that all AnimationFrame events end up in the same task.
126126

127127
This scenario gets to a problem depending on:
128128

@@ -134,7 +134,7 @@ This scenario gets to a problem depending on:
134134
![concurrent scheduling - abstract diagram](https://user-images.githubusercontent.com/10064416/145228577-6b8f0bb7-6547-4835-aecc-13d7e07baf02.png)
135135

136136
Concurrent scheduling is a marketing term and simply means that there is a mechanism in place that knows how much time is spent in the current task.
137-
This number is called frame budget and measured in milliseconds. As a result of this technique we're getting prioritized user-centric scheduling behaviours.
137+
This number is called frame budget and measured in milliseconds. As a result of this technique we're getting prioritized user-centric scheduling behavior's.
138138

139139
This enables:
140140

@@ -159,7 +159,7 @@ Instead all remaining work will get executed as fast as possible. This means in
159159
![Render Strategies - concurrent anatomy png](https://user-images.githubusercontent.com/10064416/146287356-023836c8-a697-4640-a4ae-7d567bc02bf0.png)
160160
Every strategy has a different render deadline. Strategies are designed from the perspective of how important the work is for the user. see: [RAIL model](https://web.dev/rail/)
161161

162-
What concurrent scheduling does under the hood is is cunking up work in cycles of scheduling, prioritization and execution based on different settings.
162+
What concurrent scheduling does under the hood is is chunking up work in cycles of scheduling, prioritization and execution based on different settings.
163163

164164
![Render Strategies - task flow](https://user-images.githubusercontent.com/10064416/146287195-89e22ed8-12ba-4099-9379-430a41469b9c.png)
165165

@@ -185,7 +185,7 @@ Urgent work that must happen immediately is initiated and visible by the user. T
185185
| ----------------- | ------------- | --------------- |
186186
| 🠗 `detectChanges` | `postMessage` | 0ms |
187187

188-
![render-strategies-concurrent-immediate-diagramm](https://user-images.githubusercontent.com/10064416/146285874-684230bf-f38d-4150-a803-fdf896a57c8a.png)
188+
![render-strategies-concurrent-immediate-diagram](https://user-images.githubusercontent.com/10064416/146285874-684230bf-f38d-4150-a803-fdf896a57c8a.png)
189189

190190
**Usecase:**
191191

@@ -248,7 +248,7 @@ Critical work that must be done in the current frame, is initiated and visible b
248248
| ----------------- | ------------- | --------------- |
249249
| 🠗 `detectChanges` | `postMessage` | 250ms |
250250

251-
![render-strategies-concurrent-userBlocking-diagramm](https://user-images.githubusercontent.com/10064416/146285898-c60e4ab6-98bd-4c0a-8c1f-a2ecbc829f88.png)
251+
![render-strategies-concurrent-userBlocking-diagram](https://user-images.githubusercontent.com/10064416/146285898-c60e4ab6-98bd-4c0a-8c1f-a2ecbc829f88.png)
252252

253253
**Usecase:**
254254

@@ -311,7 +311,7 @@ Heavy work visible to the user. For example, since it has a higher timeout, it i
311311
| ----------------- | ------------- | --------------- |
312312
| 🠗 `detectChanges` | `postMessage` | 5000ms |
313313

314-
![render-strategies-concurrent-normal-diagramm](https://user-images.githubusercontent.com/10064416/146285895-ec045bf7-5c68-4359-a723-032c963b80b5.png)
314+
![render-strategies-concurrent-normal-diagram](https://user-images.githubusercontent.com/10064416/146285895-ec045bf7-5c68-4359-a723-032c963b80b5.png)
315315

316316
<!-- In most cases it is a rendering from user interaction that depends on network and can be delayed by the couple of frames to the point where requested data is available. It should not delay current frame but should target next available frame. -->
317317

@@ -351,7 +351,7 @@ Work that is typically not visible to the user or initiated by the user.
351351
| ----------------- | ------------- | --------------- |
352352
| 🠗 `detectChanges` | `postMessage` | 10000ms |
353353

354-
![render-strategies-concurrent-low-diagramm](https://user-images.githubusercontent.com/10064416/146285894-8d2992f3-6e5f-49db-8c45-d54424cc4a3e.png)
354+
![render-strategies-concurrent-low-diagram](https://user-images.githubusercontent.com/10064416/146285894-8d2992f3-6e5f-49db-8c45-d54424cc4a3e.png)
355355

356356
**Usecase:**
357357

@@ -407,7 +407,7 @@ Urgent work that should happen in the background and is not initiated but visibl
407407
| ----------------- | ------------- | --------------- |
408408
| 🠗 `detectChanges` | `postMessage` ||
409409

410-
![render-strategies-concurrent-idle-diagramm](https://user-images.githubusercontent.com/10064416/146285892-c996b043-c1c0-411b-abbd-1d2867e36711.png)
410+
![render-strategies-concurrent-idle-diagram](https://user-images.githubusercontent.com/10064416/146285892-c996b043-c1c0-411b-abbd-1d2867e36711.png)
411411

412412
**Usecase:**
413413

apps/docs/docs/cdk/render-strategies/strategies/strategies.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Black triangles show us components with `OnPush` change detection. They weren't
2121
![rx-angular-cdk-render-strategies__vanilla-angular-overrendering](https://user-images.githubusercontent.com/10064416/116155426-5bf0d500-a6ea-11eb-9cbc-5274a3bd0578.png)
2222

2323
As we can see in the diagram, the yellowish components get re-evaluated (if no re-rendered). This is unneeded work that slows down the performance of Angular.
24-
In many cases, this leads to heavy refactorings to get the performance flaw out or even end up in situations where we can't fix the performance issues.
24+
In many cases, this leads to heavy refactoring to get the performance flaw out or even end up in situations where we can't fix the performance issues.
2525

2626
Strategies give us a way to control how Angular's rendering is executed and which render method is used.
2727

apps/docs/docs/cdk/transformations/array/insert.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class ListComponent {
6464
}
6565

6666
// Imperative implementation
67-
insertCeature(): void {
67+
insertCreature(): void {
6868
const creatureToAdd = {
6969
id: generateId(),
7070
name: 'newCreature',

apps/docs/docs/cdk/transformations/object/delete-prop.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ _Example_
1515
```typescript
1616
const cat = { id: 1, type: 'cat', name: 'Fluffy' };
1717

18-
const anonymusCat = deleteProp(cat, 'name');
18+
const anonymousCat = deleteProp(cat, 'name');
1919

20-
// anonymusCat will be:
20+
// anonymousCat will be:
2121
// {id: 1, type: 'cat'};
2222
```
2323

apps/docs/docs/cdk/transformations/object/patch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ interface Creature {
1919

2020
const cat = { id: 1, type: 'cat' };
2121

22-
const catWithname = patch(cat, { name: 'Fluffy' });
22+
const catWithName = patch(cat, { name: 'Fluffy' });
2323

24-
// catWithname will be:
24+
// catWithName will be:
2525
// {id: 1, type: 'cat', name: 'Fluffy'};
2626
```
2727

0 commit comments

Comments
 (0)