Skip to content

Commit 70847fa

Browse files
committed
docs(www): try fix FAQ page 2
1 parent 340291e commit 70847fa

File tree

1 file changed

+0
-53
lines changed
  • projects/www/src/app/pages/guide/signals

1 file changed

+0
-53
lines changed

projects/www/src/app/pages/guide/signals/faq.md

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -26,71 +26,18 @@
2626

2727
To define a class-based SignalStore, create a new class and extend from `signalStore`.
2828

29-
<ngrx-code-example>
30-
31-
```ts
32-
@Injectable()
33-
export class CounterStore extends signalStore(
34-
{ protectedState: false },
35-
withState({ count: 0 })
36-
) {
37-
readonly doubleCount = computed(() => this.count() * 2);
38-
39-
increment(): void {
40-
patchState(this, { count: this.count() + 1 });
41-
}
42-
}
43-
```
44-
45-
</ngrx-code-example>
46-
4729
</details>
4830

4931
<details>
5032
<summary><b>#4</b> How can I get the type of a SignalStore?</summary>
5133

5234
To get the type of a SignalStore, use the `InstanceType` utility type.
5335

54-
<ngrx-code-example>
55-
56-
```ts
57-
const CounterStore = signalStore(withState({ count: 0 }));
58-
59-
type CounterStore = InstanceType<typeof CounterStore>;
60-
61-
function logCount(store: CounterStore): void {
62-
console.log(store.count());
63-
}
64-
```
65-
66-
</ngrx-code-example>
67-
6836
</details>
6937

7038
<details>
7139
<summary><b>#5</b> Can I inject a SignalStore via the constructor?</summary>
7240

7341
Yes. To inject a SignalStore via the constructor, define and export its type with the same name.
7442

75-
<ngrx-code-example>
76-
77-
```ts
78-
// counter-store.ts
79-
export const CounterStore = signalStore(withState({ count: 0 }));
80-
81-
export type CounterStore = InstanceType<typeof CounterStore>;
82-
83-
// counter.ts
84-
import { CounterStore } from './counter.store';
85-
86-
@Component({
87-
/* ... */
88-
})
89-
export class Counter {
90-
constructor(readonly store: CounterStore) {}
91-
}
92-
```
93-
94-
</ngrx-code-example>
95-
9643
</details>

0 commit comments

Comments
 (0)