Last active
August 1, 2019 06:16
-
-
Save NetanelBasal/c2e3553e63a2dbab31b60c429296acda to your computer and use it in GitHub Desktop.
This file contains 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
@Injectable({ providedIn: 'root' }) | |
export class UserQuery extends Query<UserState> { | |
constructor(protected store: UserStore) { | |
super(store); | |
} | |
hasFlags(flags: string | string[]): boolean { | |
const userFlags = this.getValue().featureFlags; | |
return coerceArray(flags).every(current => userFlags[current]); | |
} | |
} |
This file contains 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
@Injectable({ providedIn: 'root' }) | |
@StoreConfig({ name: 'user' }) | |
export class UserStore extends Store<UserState> { | |
constructor() { | |
super(createInitialState()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment