Attempting to access a section of my store within an ngrx effect in an Angular 5 project is proving challenging. Despite following advice from various threads on StackOverflow and blog posts, utilizing withLatestFrom and the injected store, I continue to encounter a type error. Currently, I am using Angular 5, ngrx 4.1.1, and rxjs 5.5.2.
The specific error message states:
error TS2339: Property 'withLatestFrom' does not exist on type 'Actions<Action>'.
The code snippet that is causing this issue is provided below. Any insights into what may be triggering this error?
import {Injectable} from '@angular/core';
import {Store} from '@ngrx/store';
import {Effect, Actions} from '@ngrx/effects';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/switchMap';
import 'rxjs/add/operator/withLastestFrom';
import * as EndpointActions from './endpoint.actions';
import {AppState} from '../../store/app.reducers';
@Injectable()
export class EndpointEffects {
@Effect()
setEndpointData = this.actions$
.ofType(EndpointActions.SET_ENDPOINT_DATA)
.withLatestFrom(this.store$.select(state => state.endpoint.endpointAddress))
.map(([action, endpointAddress]) => {
return {
type: EndpointActions.TRY_ENDPOINT_ADDRESS,
payload: {endpointAddress: endpointAddress}
};
});
constructor(private actions$: Actions, private store$: Store<AppState>) {}
}