Closed Waqar-SE closed 1 month ago
I has never been a part of public interface. Could you please explain why do you need it?
For me the usecase is providing abilities to render function when testing the components.
in this case it's an improvement not a bug. Why cannot you use plugin or provide/inject in tests?
To be able to provide the ability I need to build it, that's where the reactive ability is needed, to build the ability.
You don’t need it because it’s hidden inside provideAbility
and abilitiesPlugin
build ability in any way you like, casl/vue will make it reactive when you provide it. See the code:
https://github.com/stalniy/casl/blob/master/packages/casl-vue/src/useAbility.ts#L17
Close as stale. Feel free to provide more details
Sorry, couldn't reply back.
The hook doesn't work when testing as the options
in render(component,options) are supposed to be object not a hook.
The object must contain the value which is returned reactiveAbility
for key ABILITY_TOKEN that will be used when mounting the component for testing.
Describe the bug Unable to import
reactiveAbility
To Reproduce Steps to reproduce the behavior: Try to import
reactiveAbility
and it will fail as index.js doesn't provide it.Expected behavior Successful import of
reactiveAbility
CASL Version
@casl/vue
- vEnvironment:
Node 20, Vue 3