Created
November 4, 2019 10:13
-
-
Save finki001/e61ac85f79a8d1da66873a40eea5cbff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class TrashComponent implements OnInit, OnDestroy { | |
const subscription: Subscription; | |
constructor(private service: TrashService) { } | |
ngOnInit() { | |
this.store.dispatch(new UsersActions.Load()); | |
this.subscription = this.service.subscribe(greetings => console.log(greetings)); | |
} | |
ngOnDestroy() { | |
this.subscription.unsubscribe(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable({ | |
providedIn: "root" | |
}) | |
export class TrashService { | |
userDetails:Observable<NoIdeaWhatTypeThisIsBecauseYourQuestionWasNotFormedWell>; | |
constructor(private store: Store<fromUsersReducer.State>) { | |
store.dispatch(new UsersActions.Load()); | |
this.userDetails = store.pipe(select(fromUsersReducer.getUsersDetails)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment