ketting icon indicating copy to clipboard operation
ketting copied to clipboard

Allow to 'optionally' follow a relation

Open reda-alaoui opened this issue 1 year ago • 0 comments

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();

reda-alaoui avatar Jun 15 '23 23:06 reda-alaoui