4 ms·
Building SPA using Siren, it can be really useful for disabling parts of UI - when you have complex rules on whether user can list/edit/create resource, you jus
by JackuB 11y ago
Building SPA using Siren, it can be really useful for disabling parts of UI - when you have complex rules on whether user can list/edit/create resource, you just check if such action is in response and use its options.
Yes, you can do same with bool flags in response, but if you structure all your decision making like this (around Resources and actions) it's quite easy and natural to make all your components react to un/availability of resource/action, thus accomodating even more complex scenarios - user can list, edit (only some), but can't create new.