Last active
November 29, 2018 15:35
-
-
Save wesleygrimes/c64c37c104d45d0b123ae49ac14117a3 to your computer and use it in GitHub Desktop.
Root Selectors
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
| import { createSelector, MemoizedSelector } from '@ngrx/store'; | |
| import { | |
| MyFeatureStoreSelectors | |
| } from './my-feature-store'; | |
| import { | |
| MyOtherFeatureStoreSelectors | |
| } from './my-other-feature-store'; | |
| export const selectError: MemoizedSelector<object, string> = createSelector( | |
| MyFeatureStoreSelectors.selectMyFeatureError, | |
| MyOtherFeatureStoreSelectors.selectMyOtherFeatureError, | |
| (myFeatureError: string, myOtherFeatureError: string) => { | |
| return myFeature || myOtherFeature; | |
| } | |
| ); | |
| export const selectIsLoading: MemoizedSelector< | |
| object, | |
| boolean | |
| > = createSelector( | |
| MyFeatureStoreSelectors.selectMyFeatureIsLoading, | |
| MyOtherFeatureStoreSelectors.selectMyOtherFeatureIsLoading, | |
| (myFeature: boolean, myOtherFeature: boolean) => { | |
| return myFeature || myOtherFeature; | |
| } | |
| ); |
i feel that:
return myFeature || myOtherFeature;should be:
return myFeatureError || myOtherFeatureError;
yes, it should be.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i feel that:
return myFeature || myOtherFeature;should be:
return myFeatureError || myOtherFeatureError;