Skip to content

Commit

Permalink
Merge branch 'main' into remove-let-module
Browse files Browse the repository at this point in the history
  • Loading branch information
timdeschryver authored Oct 24, 2023
2 parents 96f7b08 + d54af4a commit a6ece02
Show file tree
Hide file tree
Showing 24 changed files with 174 additions and 53 deletions.
18 changes: 0 additions & 18 deletions modules/component/spec/push/push.module.spec.ts

This file was deleted.

1 change: 0 additions & 1 deletion modules/component/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export { RenderScheduler } from './core/render-scheduler';
export { LetDirective } from './let/let.directive';
export { PushPipe } from './push/push.pipe';
export { PushModule } from './push/push.module';
11 changes: 0 additions & 11 deletions modules/component/src/push/push.module.ts

This file was deleted.

2 changes: 0 additions & 2 deletions modules/component/src/push/push.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { createRenderEventManager } from '../core/render-event/manager';
type PushPipeResult<PO> = PotentialObservableResult<PO, undefined>;

/**
* @ngModule PushModule
*
* @description
*
* The `ngrxPush` pipe serves as a drop-in replacement for the `async` pipe.
Expand Down
50 changes: 49 additions & 1 deletion modules/signals/rxjs-interop/spec/rx-method.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { Injectable, signal } from '@angular/core';
import {
createEnvironmentInjector,
EnvironmentInjector,
Injectable,
signal,
} from '@angular/core';
import { TestBed } from '@angular/core/testing';
import { BehaviorSubject, pipe, Subject, tap } from 'rxjs';
import { rxMethod } from '../src';
Expand Down Expand Up @@ -174,4 +179,47 @@ describe('rxMethod', () => {
tick();
expect(results).toEqual([1, 1, 1]);
});

it('unsubscribes from method and all instances on provided injector destroy', () => {
const injector = createEnvironmentInjector(
[],
TestBed.inject(EnvironmentInjector)
);
const results: number[] = [];
let destroyed = false;

const method = rxMethod<number>(
tap({
next: (value) => results.push(value),
finalize: () => (destroyed = true),
}),
{ injector }
);

const subject$ = new BehaviorSubject(1);
const sig = signal(1);

method(subject$);
method(sig);
method(1);

TestBed.flushEffects();
expect(results).toEqual([1, 1, 1]);

injector.destroy();
expect(destroyed).toBe(true);

subject$.next(2);
sig.set(2);
method(2);

TestBed.flushEffects();
expect(results).toEqual([1, 1, 1]);
});

it('throws an error when it is called out of injection context', () => {
expect(() => rxMethod(($) => $)).toThrow(
/NG0203: rxMethod\(\) can only be used within an injection context/
);
});
});
8 changes: 0 additions & 8 deletions projects/ngrx.io/content/guide/component/push.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ import { PushPipe } from '@ngrx/component';
export class MyStandaloneComponent {}
```

<div class="alert is-critical">

The `ngrxPush` pipe can be also used by importing the `PushModule`.
However, the `PushModule` is deprecated in favor of the standalone `PushPipe`.
See the [migration guide](guide/migration/v16#pushmodule) for more information.

</div>

## Comparison with `async` Pipe

The current way of binding an observable to the view looks like this:
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/architecture-overview.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# Architecture overview

You describe your entity model to NgRx Data in a few lines of [entity metadata](guide/data/entity-metadata) and let the library do the rest of the work.
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/entity-actions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# Entity Actions

The [`EntityCollectionService`](guide/data/entity-services) dispatches an `EntityAction` to the _NgRx store_ when you call one of its commands to query or update entities in a cached collection.
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/entity-change-tracker.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# EntityChangeTracker

NgRx Data tracks entity changes that haven't yet been saved on the server.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# EntityCollectionService

An **`EntityCollectionService`** is a facade over the NgRx Data **dispatcher** and **selectors$** that manages an entity `T` collection cached in the _NgRx store_.
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/entity-collection.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# Entity Collection

The NgRx Data library maintains a _cache_ (`EntityCache`) of
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/entity-dataservice.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# Entity DataService

The NgRx Data library expects to persist entity data with calls to a REST-like web api with endpoints for each entity type.
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/entity-effects.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# Entity Effects

**Work in Progress**
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/entity-metadata.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# Entity Metadata

The NgRx Data library maintains a **_cache_** of entity collection data in the _NgRx store_.
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/entity-reducer.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# Entity Reducer

The _Entity Reducer_ is the _master reducer_ for all entity collections in the stored entity cache.
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/entity-services.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# EntityServices

`EntityServices` is a facade over the NgRx Data services and the NgRx Data `EntityCache`.
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/extension-points.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# Extension Points

**Work in progress**
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/faq.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# NgRx Data FAQs

<a id="no-boilerplate-claim"></a>
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# @ngrx/data

NgRx Data is an extension that offers a gentle introduction to NgRx by simplifying management of **entity data** while reducing the amount of explicitness.
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/install.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# Installation

## Installing with `ng add`
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/limitations.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# NgRx Data Limitations

The NgRx Data library lacks many capabilities of a [full-featured entity management](#alternatives) system.
Expand Down
7 changes: 7 additions & 0 deletions projects/ngrx.io/content/guide/data/save-entities.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<div class="alert is-critical">

The `@ngrx/data` package is in <a href="https://github.com/ngrx/platform/issues/4011" target="_blank">maintenance mode</a>.
Changes to this package are limited to critical bug fixes.

</div>

# Saving Multiple Entities

Many apps must save several entities at the same time in the same transaction.
Expand Down
2 changes: 1 addition & 1 deletion projects/ngrx.io/content/guide/migration/v15.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ The `MinimalActivatedRouteSnapshot` interface contains the required `title` prop

#### Removal of ReactiveComponentModule

The `ReactiveComponentModule` is removed in favor of `LetModule` and [`PushModule`](/api/component/PushModule).
The `ReactiveComponentModule` is removed in favor of `LetModule` and `PushModule`.

BEFORE:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{% if doc.ngModules.length == 1 %}<h2>NgModule</h2>{% else %}<h2>NgModules</h2>{% endif %}
<ul class="ngmodule-list">
{% for ngModule in doc.ngModules %}
<li>
<a href="{$ ngModule.path $}">
<code-example language="ts" hideCopy="true" linenums="false" class="no-box">{$ ngModule.name | escape $}</code-example>
</a>
</li>
{% endfor %}
</ul>

{% if doc.ngModules.length %}
{% if doc.ngModules.length == 1 %}<h2>NgModule</h2>{% else %}<h2>NgModules</h2>{% endif %}
<ul class="ngmodule-list">
{% for ngModule in doc.ngModules %}
<li>
<a href="{$ ngModule.path $}">
<code-example language="ts" hideCopy="true" linenums="false" class="no-box">{$ ngModule.name | escape $}</code-example>
</a>
</li>
{% endfor %}
</ul>
{% endif %}

0 comments on commit a6ece02

Please sign in to comment.