I have integrated ngrx store into my Angular2 application.
The store reducer contains two objects as shown below:
export function loadSuccessNamesAction(state: StoreData, action: loadSuccessNamesAction): StoreData {
const namesDataState = Object.assign({}, state);
namesDataState.isSpinner = false;
namesDataState.names = action.payload.names;
return namesDataState;
}
export function loadSuccessSubjectAction(state: StoreData, action: loadSuccessSubjectAction): StoreData {
const subjectDataState = Object.assign({}, state);
subjectDataState.isSpinner = false;
subjectDataState.subject = action.payload.subject;
return namesDataState;
}
In my component, I need to access the namesDataState object only. How can I subscribe to only one specific object in the store?
Currently, I am subscribing to the entire store, but I would like to subscribe to just the first object.
If you have any solutions, they would be greatly appreciated. Thank you.