Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(component-store): add alert about NgRx Signals #4629

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions projects/ngrx.io/content/guide/component-store/comparison.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<div class="alert is-helpful">

**<a href="/guide/signals"><b>NgRx Signals</b></a> is the new default.**

The NgRx team recommends using the `@ngrx/signals` library for local state management in Angular.
While ComponentStore remains supported, we encourage using `@ngrx/signals` for new projects and considering migration for existing ones.

</div>

# Comparison of ComponentStore and Store

Both ComponentStore and Store are designed to manage the state in an Angular application, however
Expand Down
9 changes: 9 additions & 0 deletions projects/ngrx.io/content/guide/component-store/effect.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<div class="alert is-helpful">

**<a href="/guide/signals"><b>NgRx Signals</b></a> is the new default.**

The NgRx team recommends using the `@ngrx/signals` library for local state management in Angular.
While ComponentStore remains supported, we encourage using `@ngrx/signals` for new projects and considering migration for existing ones.

</div>

# Effects

Effects are designed to extract any side-effects (such as Network calls) from components and
Expand Down
9 changes: 9 additions & 0 deletions projects/ngrx.io/content/guide/component-store/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<div class="alert is-helpful">

**<a href="/guide/signals"><b>NgRx Signals</b></a> is the new default.**

The NgRx team recommends using the `@ngrx/signals` library for local state management in Angular.
While ComponentStore remains supported, we encourage using `@ngrx/signals` for new projects and considering migration for existing ones.

</div>

# @ngrx/component-store

ComponentStore is a stand-alone library that helps to manage local/component state. It's an alternative to reactive push-based "Service with a Subject" approach.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<div class="alert is-helpful">

**<a href="/guide/signals"><b>NgRx Signals</b></a> is the new default.**

The NgRx team recommends using the `@ngrx/signals` library for local state management in Angular.
While ComponentStore remains supported, we encourage using `@ngrx/signals` for new projects and considering migration for existing ones.

</div>

# Initialization

ComponentStore can be initialized in 2 ways:
Expand Down
9 changes: 9 additions & 0 deletions projects/ngrx.io/content/guide/component-store/install.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<div class="alert is-helpful">

**<a href="/guide/signals"><b>NgRx Signals</b></a> is the new default.**

The NgRx team recommends using the `@ngrx/signals` library for local state management in Angular.
While ComponentStore remains supported, we encourage using `@ngrx/signals` for new projects and considering migration for existing ones.

</div>

# Installation

## Installing with `ng add`
Expand Down
9 changes: 9 additions & 0 deletions projects/ngrx.io/content/guide/component-store/lifecycle.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<div class="alert is-helpful">

**<a href="/guide/signals"><b>NgRx Signals</b></a> is the new default.**

The NgRx team recommends using the `@ngrx/signals` library for local state management in Angular.
While ComponentStore remains supported, we encourage using `@ngrx/signals` for new projects and considering migration for existing ones.

</div>

# Lifecycle

NgRx ComponentStore comes with lifecycle hooks and observables for performing tasks after the ComponentStore is initially instantiated, after the initial state is first set, and when the ComponentStore is destroyed. You can use these lifecycle hooks to set up long-running effects, wire up additional logic, and other tasks outside the constructor of the ComponentStore.
Expand Down
9 changes: 9 additions & 0 deletions projects/ngrx.io/content/guide/component-store/read.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<div class="alert is-helpful">

**<a href="/guide/signals"><b>NgRx Signals</b></a> is the new default.**

The NgRx team recommends using the `@ngrx/signals` library for local state management in Angular.
While ComponentStore remains supported, we encourage using `@ngrx/signals` for new projects and considering migration for existing ones.

</div>

# Reading state

## `select` method
Expand Down
9 changes: 9 additions & 0 deletions projects/ngrx.io/content/guide/component-store/usage.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<div class="alert is-helpful">

**<a href="/guide/signals"><b>NgRx Signals</b></a> is the new default.**

The NgRx team recommends using the `@ngrx/signals` library for local state management in Angular.
While ComponentStore remains supported, we encourage using `@ngrx/signals` for new projects and considering migration for existing ones.

</div>

# Usage

## Types of State
Expand Down
9 changes: 9 additions & 0 deletions projects/ngrx.io/content/guide/component-store/write.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<div class="alert is-helpful">

**<a href="/guide/signals"><b>NgRx Signals</b></a> is the new default.**

The NgRx team recommends using the `@ngrx/signals` library for local state management in Angular.
While ComponentStore remains supported, we encourage using `@ngrx/signals` for new projects and considering migration for existing ones.

</div>

# Updating state

ComponentStore can be updated in 3 ways:
Expand Down
2 changes: 1 addition & 1 deletion projects/ngrx.io/content/marketing/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ NgRx packages are divided into a few main categories
- [Effects](guide/effects) - Side effect model for @ngrx/store.
- [Router Store](guide/router-store) - Bindings to connect the Angular Router to @ngrx/store.
- [Entity](guide/entity) - Entity State adapter for managing record collections.
- [ComponentStore](guide/component-store) - Standalone library for managing local/component state.
- [Signals](guide/signals) - Reactive store and set of utilities for Angular Signals.
- [ComponentStore](guide/component-store) - Standalone library for managing local/component state.
- [Operators](guide/operators) - Shared RxJS operators for NgRx libraries.

### Data
Expand Down
92 changes: 46 additions & 46 deletions projects/ngrx.io/content/navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,52 +225,6 @@
}
]
},
{
"title": "@ngrx/component-store",
"children": [
{
"title": "Overview",
"url": "guide/component-store"
},
{
"title": "Installation",
"url": "guide/component-store/install"
},
{
"title": "Architecture",
"children": [
{
"title": "Initialization",
"url": "guide/component-store/initialization"
},
{
"title": "Read",
"url": "guide/component-store/read"
},
{
"title": "Write",
"url": "guide/component-store/write"
},
{
"title": "Effects",
"url": "guide/component-store/effect"
}
]
},
{
"title": "Lifecycle",
"url": "guide/component-store/lifecycle"
},
{
"title": "ComponentStore vs Store",
"url": "guide/component-store/comparison"
},
{
"title": "Usage",
"url": "guide/component-store/usage"
}
]
},
{
"title": "@ngrx/signals",
"children": [
Expand Down Expand Up @@ -341,6 +295,52 @@
}
]
},
{
"title": "@ngrx/component-store",
"children": [
{
"title": "Overview",
"url": "guide/component-store"
},
{
"title": "Installation",
"url": "guide/component-store/install"
},
{
"title": "Architecture",
"children": [
{
"title": "Initialization",
"url": "guide/component-store/initialization"
},
{
"title": "Read",
"url": "guide/component-store/read"
},
{
"title": "Write",
"url": "guide/component-store/write"
},
{
"title": "Effects",
"url": "guide/component-store/effect"
}
]
},
{
"title": "Lifecycle",
"url": "guide/component-store/lifecycle"
},
{
"title": "ComponentStore vs Store",
"url": "guide/component-store/comparison"
},
{
"title": "Usage",
"url": "guide/component-store/usage"
}
]
},
{
"title": "@ngrx/operators",
"children": [
Expand Down
Loading