I have three services that return same type of objects based on different actions. How can I hold all the objects on feature store with a clean separation.
Action1: LOAD_CANDIDATES
I have an effect that invokes below service call
public getCandidates(): Observable {
const url = 'Candidates Url';
return this.http.get(url);
}
Action2:LOAD_MATCHED_CANDIDATES
I have an effect that invokes below service call
public getMatchingCandidates(conditions: any): Observable
{
const url = 'Matched Candidates Url';
return this.http.get(url);
}
Action3: LOAD_ASSIGNED_CANDIDATES
I have an effect that invokes below service call
public getAssignedCandidates(id: number): Observable {
const url = 'Assigned candidates url';
return this.http.get(url);
}
I do have success and fail effects for each of them.
Candidate reducer :
export const reducers = {
search: fromSearch.reducer,
candidates: fromCandidates.reducer,
collection: fromCollection.reducer
};
Here is the injection of feature store to module
StoreModule.forFeature('candidates', combineReducers(fromStore.reducers))