@@ -17,7 +17,7 @@ We have a component that:
17
17
## Imperative
18
18
19
19
** State** :
20
- The components' state is a simple object ` state: { count: number } = {}; ` .
20
+ The component's state is a simple object ` state: { count: number } = {}; ` .
21
21
22
22
** Display** :
23
23
To display the value we use a template expression ` {{ state.count }} ` .
@@ -52,8 +52,8 @@ export class MyComponent {
52
52
## Reactive reading
53
53
54
54
** State** :
55
- The components' state gets managed with ` RxState ` by extending the class. ` export class MyComponent extends RxState<{ count: number }> { `
56
- The components' state is a simple interface: ` { count: number } ` .
55
+ The component's state gets managed with ` RxState ` by extending the class. ` export class MyComponent extends RxState<{ count: number }> { `
56
+ The component's state is a simple interface: ` { count: number } ` .
57
57
Inside the class we expose our state as Observable ` readonly state$ = this.select(); `
58
58
59
59
** Display** :
@@ -90,7 +90,7 @@ export class MyComponent extends RxState<{ count: number }> {
90
90
## Reactive Writing
91
91
92
92
** State** :
93
- The components' state gets managed with ` RxState ` by extending the class. ` export class MyComponent extends RxState<{ count: number }> { `
93
+ The component's state gets managed with ` RxState ` by extending the class. ` export class MyComponent extends RxState<{ count: number }> { `
94
94
The components state is a simple interface ` { count: number } ` .
95
95
Inside the class we expose our state as Observable ` readonly state$ = this.select(); `
96
96
@@ -104,7 +104,7 @@ The state gets incremented by one whenever the button gets clicked.
104
104
In the class we use a Subject to track clicks ` btn$ = new Subject(); ` .
105
105
The click binding is set-up over an event binding ` (click) ` and fires the Subjects ` next ` method.
106
106
107
- This Observable gets connected to the components' state in the constructor ` this.connect(btn$, (oldState, clickEvent) => ({ count: s.count + 1 })); ` .
107
+ This Observable gets connected to the component's state in the constructor ` this.connect(btn$, (oldState, clickEvent) => ({ count: s.count + 1 })); ` .
108
108
Whenever the Subject emits, we apply the increment logic passed as a function.
109
109
The function signature looks like this: ` (oldState: T, newValue: T[K]) => T ` .
110
110
@@ -134,7 +134,7 @@ export class MyComponent extends RxState<{ count: number }> {
134
134
135
135
In this section we use the ` zoneless ` directive to get control over rendering.
136
136
137
- The sections State ans Action are identical.
137
+ The sections State and Action are identical.
138
138
The Display has a small difference. We use the ` zoneless ` directive to get rid of renderings caused by the button eventListener.
139
139
140
140
Rendering:
0 commit comments