@ngrx/store installiert
authorKai Moritz <kai@juplo.de>
Fri, 26 Jun 2020 07:14:59 +0000 (09:14 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 27 Jun 2020 21:22:41 +0000 (23:22 +0200)
Mit dem Befehl:

    ng add @ngrx/store --minimal false

package-lock.json
package.json
src/app/app.module.ts
src/app/reducers/index.ts [new file with mode: 0644]

index 18f04f5..af60c21 100644 (file)
         }
       }
     },
+    "@ngrx/store": {
+      "version": "9.2.0",
+      "resolved": "https://registry.npmjs.org/@ngrx/store/-/store-9.2.0.tgz",
+      "integrity": "sha512-V8AI3mxbMztVpbZpALkLZYlGkofKcu9GaOCY5e+sZ1VcJ90oxhFjBpnmd6MuVdmhep1XAHALb1B8ZbBFn+xsgQ=="
+    },
     "@ngtools/webpack": {
       "version": "9.1.4",
       "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-9.1.4.tgz",
index dc57a18..dbd8a35 100644 (file)
@@ -19,6 +19,7 @@
     "@angular/platform-browser": "~9.1.5",
     "@angular/platform-browser-dynamic": "~9.1.5",
     "@angular/router": "~9.1.5",
+    "@ngrx/store": "^9.2.0",
     "rxjs": "~6.5.5",
     "tslib": "^1.10.0",
     "zone.js": "~0.10.2"
index a8cb5c1..0a56826 100644 (file)
@@ -3,6 +3,8 @@ import { NgModule } from '@angular/core';
 
 import { AppComponent } from './app.component';
 import { VorgangComponent } from './vorgang/vorgang.component';
+import { StoreModule } from '@ngrx/store';
+import { reducers, metaReducers } from './reducers';
 
 @NgModule({
   declarations: [
@@ -10,7 +12,10 @@ import { VorgangComponent } from './vorgang/vorgang.component';
     VorgangComponent
   ],
   imports: [
-    BrowserModule
+    BrowserModule,
+    StoreModule.forRoot(reducers, {
+      metaReducers
+    })
   ],
   providers: [],
   bootstrap: [AppComponent]
diff --git a/src/app/reducers/index.ts b/src/app/reducers/index.ts
new file mode 100644 (file)
index 0000000..4f57bb0
--- /dev/null
@@ -0,0 +1,19 @@
+import {
+  ActionReducer,
+  ActionReducerMap,
+  createFeatureSelector,
+  createSelector,
+  MetaReducer
+} from '@ngrx/store';
+import { environment } from '../../environments/environment';
+
+export interface State {
+
+}
+
+export const reducers: ActionReducerMap<State> = {
+
+};
+
+
+export const metaReducers: MetaReducer<State>[] = !environment.production ? [] : [];