Skip to content

Commit 8fa3283

Browse files
docs(state): fix usage.md
2 parents 72e315f + 4914db7 commit 8fa3283

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libs/state/docs/usage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ export class StatefulComponent {
7272
providers: [RxState],
7373
})
7474
export class StatefulComponent {
75-
readonly title$ = this.select('title');
75+
readonly title$ = this.state.select('title');
7676

7777
@Input() set title(title: string) {
78-
this.state.setState({ title });
78+
this.state.set({ title });
7979
}
8080

8181
constructor(private state: RxState<{ title: string }>) {}
@@ -149,7 +149,7 @@ Often it is needed to get the previous state to calculate the new one.
149149
providers: [RxState]
150150
})
151151
export class StatefulComponent {
152-
readonly items$ = this.select('items');
152+
readonly items$ = this.state.select('items');
153153
readonly btnClick$ = new Subject();
154154

155155
constructor(private state: RxState<{list: {id: number}}>) {

0 commit comments

Comments
 (0)