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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to 'optionally' follow a relation #478

Open
reda-alaoui opened this issue Jun 15, 2023 · 0 comments
Open

Allow to 'optionally' follow a relation #478

reda-alaoui opened this issue Jun 15, 2023 · 0 comments
Labels
Cosium Features Cosium needs

Comments

@reda-alaoui
Copy link
Contributor

Often, I am not sure a relation will be present or not when a server-side permission is involved.

I'd like to avoid this kind of code:

if (userState.links.has('identity')) {
   identityState = await userState.follow('identity').get();
}

And have something like this instead:

// this would lead to an undefined identityState if the relation 'identity' is absent
identityState = await userState.mayFollow('identity').get();
@evert evert added the Cosium Features Cosium needs label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cosium Features Cosium needs
Projects
None yet
Development

No branches or pull requests

2 participants