Skip to content

Commit 3df8ba5

Browse files
authored
Merge branch 'main' into docs-remove-used-by-table
2 parents 85ac64c + e7e4661 commit 3df8ba5

File tree

397 files changed

+13984
-6825
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

397 files changed

+13984
-6825
lines changed

.codecov.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ coverage:
2222
target: 90%
2323
flags:
2424
- eslint-plugin
25+
isr:
26+
target: 90%
27+
flags:
28+
- isr
2529

2630
flags:
2731
state:
@@ -40,6 +44,10 @@ flags:
4044
paths:
4145
- libs/eslint-plugin
4246
carryforward: true
47+
isr:
48+
paths:
49+
- libs/isr
50+
carryforward: true
4351

4452
comment:
4553
layout: diff, flags, files

.commitlintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"demos",
1414
"schematics",
1515
"ci",
16-
"eslint"
16+
"eslint",
17+
"isr"
1718
]
1819
],
1920
"type-empty": [2, "never"],

.eslintrc.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
{
22
"root": true,
33
"ignorePatterns": ["**/*"],
4-
"plugins": ["@nrwl/nx"],
4+
"plugins": ["@nx"],
55
"overrides": [
66
{
77
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
88
"rules": {
9-
"@nrwl/nx/enforce-module-boundaries": [
9+
"@nx/enforce-module-boundaries": [
1010
"error",
1111
{
12+
"allowCircularSelfDependency": false,
13+
"banTransitiveDependencies": true,
14+
"checkDynamicDependenciesExceptions": [],
15+
"checkNestedExternalImports": true,
1216
"enforceBuildableLibDependency": true,
1317
"allow": [],
1418
"depConstraints": [
@@ -38,7 +42,7 @@
3842
"extends": [
3943
"prettier",
4044
"eslint:recommended",
41-
"plugin:@nrwl/nx/typescript",
45+
"plugin:@nx/typescript",
4246
"plugin:@angular-eslint/recommended",
4347
"plugin:@typescript-eslint/recommended"
4448
],
@@ -61,7 +65,7 @@
6165
"extends": [
6266
"prettier",
6367
"plugin:@angular-eslint/template/recommended",
64-
"plugin:@nrwl/nx/javascript"
68+
"plugin:@nx/javascript"
6569
],
6670
"rules": {
6771
"@typescript-eslint/no-non-null-assertion": "off"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ Thumbs.db
4747
# Generated Docusaurus files
4848
.docusaurus/
4949
.cache-loader/
50+
51+
.angular

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@
66
/**/images/**/*
77
.docusaurus/
88
CHANGELOG.md
9+
10+
.angular

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,9 @@ To learn more about @rx-angular/template and its capabilities, check out the off
4747

4848
### Using `@rx-angular/state`
4949

50-
In this example, we're creating a fully reactive counter component. We define the state using an interface and use the `RxState` service to manage it. We also define two actions to increment and decrement the count and use the `connect` method to update the state in response to these actions. Finally, we use the `select` method to display the count property of the state in the template.
50+
In this example, we're creating a fully reactive counter component. We use the `rxState` functional API to create the state. We also define two actions to increment and decrement the count and use the `connect` function to update the state in response to these actions. Finally, we use the `select` function to display the count property of the state in the template.
5151

5252
```ts
53-
interface CounterState {
54-
count: number;
55-
}
56-
57-
interface CounterActions {
58-
increment: void;
59-
decrement: void;
60-
}
61-
6253
@Component({
6354
selector: 'app-counter',
6455
standalone: true,
@@ -68,24 +59,29 @@ interface CounterActions {
6859
<button (click)="actions.increment()">Increment</button>
6960
<button (click)="actions.decrement()">Decrement</button>
7061
`,
71-
providers: [RxState, RxActionFactory],
62+
providers: [RxActionFactory],
7263
})
7364
export class CounterComponent {
74-
readonly count$ = this.state.select('count');
75-
readonly actions = this.actionFactory.create();
76-
77-
constructor(
78-
private readonly state: RxState<CounterState>,
79-
private readonly actionFactory: RxActionFactory<CounterActions>
80-
) {
81-
this.state.set({ count: 0 });
82-
this.state.connect(this.actions.increment$, (state) => ({
65+
private readonly actions = inject<
66+
RxActionFactory<{
67+
increment: void;
68+
decrement: void;
69+
}>
70+
>(RxActionFactory).create();
71+
72+
private readonly state = rxState<{
73+
count: number;
74+
}>(({ set, connect }) => {
75+
set({ count: 0 });
76+
connect(this.actions.increment$, (state) => ({
8377
count: state.count + 1,
8478
}));
85-
this.state.connect(this.actions.decrement$, (state) => ({
79+
connect(this.actions.decrement$, (state) => ({
8680
count: state.count - 1,
8781
}));
88-
}
82+
});
83+
84+
readonly count$ = this.state.select('count');
8985
}
9086
```
9187

@@ -104,3 +100,7 @@ We welcome contributions from the community to help improve RxAngular! To get st
104100
## License
105101

106102
This project is MIT licensed.
103+
104+
---
105+
106+
made with ❤ by [push-based.io](https://www.push-based.io)

apps/demos/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
}
113113
},
114114
"test": {
115-
"executor": "@nrwl/jest:jest",
115+
"executor": "@nx/jest:jest",
116116
"options": {
117117
"jestConfig": "apps/demos/jest.config.ts",
118118
"passWithNoTests": true

apps/demos/src/app/app-component/app-control-panel/app-control-panel.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/materia
99
import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';
1010
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
1111
import { MatLegacyListModule as MatListModule } from '@angular/material/legacy-list';
12-
import { LetModule } from '@rx-angular/template/let';
12+
import { RxLet } from '@rx-angular/template/let';
1313
import { MatLegacyCheckboxModule as MatCheckboxModule } from '@angular/material/legacy-checkbox';
1414
import { StrategySelectModule } from '../../shared/debug-helper/strategy-select';
1515
import { MatLegacySlideToggleModule as MatSlideToggleModule } from '@angular/material/legacy-slide-toggle';
@@ -25,7 +25,7 @@ import { MatLegacySlideToggleModule as MatSlideToggleModule } from '@angular/mat
2525
MatFormFieldModule,
2626
MatSelectModule,
2727
MatButtonModule,
28-
LetModule,
28+
RxLet,
2929
MatListModule,
3030
MatCheckboxModule,
3131
StrategySelectModule,

apps/demos/src/app/app-shell/app-shell.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { AppShellComponent } from './app-shell-component/app-shell.component';
1717
import { AppShellSideNavItemDirective } from './side-nav/side-nav-item.directive';
1818
import { AppShellSideNavComponent } from './side-nav/side-nav.component';
1919
import { RxLetModule } from '../rx-angular-pocs/template/directives/let';
20-
import { IfModule } from '@rx-angular/template/if';
20+
import { RxIf } from '@rx-angular/template/if';
2121

2222
const exportedDeclarations = [
2323
AppShellHeaderContent,
@@ -40,7 +40,7 @@ const exportedDeclarations = [
4040
MatSelectModule,
4141
CdkTreeModule,
4242
RxLetModule,
43-
IfModule,
43+
RxIf,
4444
],
4545
exports: exportedDeclarations,
4646
})

apps/demos/src/app/features/concepts/coalescing/coalescing.module.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
33
import { RouterModule } from '@angular/router';
4-
import { PushModule } from '@rx-angular/template/push';
5-
import { UnpatchModule } from '@rx-angular/template/unpatch';
4+
import { RxPush } from '@rx-angular/template/push';
5+
import { RxUnpatch } from '@rx-angular/template/unpatch';
66

77
import { ROUTES } from './coalescing.routes';
88
import { CoalescingComponent } from './coalescing/coalescing.component';
@@ -19,9 +19,9 @@ const DECLARATIONS = [CoalescingComponent];
1919
RouterModule.forChild(ROUTES),
2020
VisualizerModule,
2121
StrategySelectModule,
22-
UnpatchModule,
22+
RxUnpatch,
2323
MatButtonModule,
24-
PushModule,
24+
RxPush,
2525
],
2626
providers: [],
2727
exports: [DECLARATIONS],

0 commit comments

Comments
 (0)