Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Answer:6 Permissions #865

Closed
wants to merge 4 commits into from
Closed

Conversation

LMFinney
Copy link
Sponsor Contributor

@LMFinney LMFinney commented May 8, 2024

Checklist for challenge submission

  • Start your PR message with Answer:${challenge_number}

Warning:

  • If you want feedback or review, you must support the project on GitHub:

Alternatively, you can still submit your PR to join the list of answered challenges or to be reviewed by a community member. 馃敟

Move matching logic into the store
Add other role components
Add CanMatchFn guards
Add signal to the store for admin
Extract a method on the store to handle just the role matching.
Refactor use of the store from the directive so that the store doesn't have to deal with undefined
@github-actions github-actions bot added 6 exercice permissions answer answer sponsor sponsor the project to be reviewed PR requests a review labels May 8, 2024
this.vcr.createEmbeddedView(this.templateRef);
}
}
});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice directive 馃敟


@Injectable({
providedIn: 'root',
})
export class UserStore {
private user = new BehaviorSubject<User | undefined>(undefined);
user$ = this.user.asObservable();
private _user = signal<User | undefined>(undefined);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, if you are used to the _ naming convention for private field, you should switch to # which is a real javascript private field

@tomalaforge
Copy link
Owner

Perfect solution with the use of signals

@tomalaforge tomalaforge removed the to be reviewed PR requests a review label May 10, 2024
Copy link

This pull request is stale because it has been open for 15 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6 exercice permissions answer answer sponsor sponsor the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants