我有三个服务,它们根据不同的操作返回相同类型的对象。我怎样才能以干净的分离来保存特征存储中的所有对象。
行动 1:LOAD_CANDIDATES
I have an effect that invokes below service call
public getCandidates(): Observable {
const url = 'Candidates Url';
return this.http.get(url);
}
行动 2: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);
}
行动 3: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);
}
我确实对他们每个人都有成功和失败的影响。
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))