Skip to content

Commit e63e787

Browse files
bcabanesvsavkin
authored andcommitted
fix(schematics): use ngrx pipe select operator
This update the way the Facade select a slice of the Store using the select operator through the pipe, contrary to the `.select()` which is now deprecated.
1 parent 4ed154d commit e63e787

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/schematics/src/collection/ngrx/files/__directory__/__fileName__.facade.ts__tmpl__

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Injectable } from '@angular/core';
22

3-
import { Store } from '@ngrx/store';
3+
import { select, Store } from '@ngrx/store';
44

55
import { <%= className %>State } from './<%= fileName %>.reducer';
66
import { <%= propertyName %>Query } from './<%= fileName %>.selectors';
@@ -9,9 +9,9 @@ import { Load<%= className %> } from './<%= fileName %>.actions';
99
@Injectable()
1010
export class <%= className %>Facade {
1111

12-
loaded$ = this.store.select(<%= propertyName %>Query.getLoaded);
13-
all<%= className %>$ = this.store.select(<%= propertyName %>Query.getAll<%= className %>);
14-
selected<%= className %>$ = this.store.select(<%= propertyName %>Query.getSelected<%= className %>);
12+
loaded$ = this.store.pipe(select(<%= propertyName %>Query.getLoaded));
13+
all<%= className %>$ = this.store.pipe(select(<%= propertyName %>Query.getAll<%= className %>));
14+
selected<%= className %>$ = this.store.pipe(select(<%= propertyName %>Query.getSelected<%= className %>));
1515

1616
constructor( private store: Store<{<%= propertyName %>: <%= className %>State}> ) { }
1717

0 commit comments

Comments
 (0)