Provide a way to change ability for the whole nested tree of components
See original GitHub issueuse inject/provide
to do this
Challenges
can
should re-render automatically when provided ability is updated: solutions:- add watcher for each ability. Will require to create a wrapper class for Vue or additional method to create abilities. Not how I’d like to see this
- create a watcher and subscribe in
$can
method. Requires to adddestroyed
hook and potentially may require functionalCan
component into regular one. As functional component doesn’t have state.
- components which want to use ability now needs to inject it (i.e., add
inject: ['ability']
). That’s additional complexity which I’d like not to add. solutions:- default ability should be provided and injected for all components via mixin in plugin
vm.$ability
needs to be converted intocomputed
property (in order to have single source of truth for provided ability). This property will take value frominjections
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Mat-tree :Tree with nested nodes adding child doesnt update ...
When using mat-nested-tree-node with a nested datasource if you add a child to an existing parent it does not update the view.
Read more >How to manage state in a tree component in reactjs
My first pass was to just have a single "tree" component that builds the nested lists of DOM elements in its render function...
Read more >Avoiding deeply nested component trees | by Ruben Oostinga
When you have a deeply nested component tree and you need to change a single leaf component you have 2 options. Either recreate...
Read more >How to update nested state properties in ReactJS?
Approach 1: We can create a dummy object to perform operations on it (update properties that we want) then replace the component's state ......
Read more >Practical Redux, Part 11: Nested Data and Trees
We currently have the ability to edit items, and our editing feature has generic actions and reducers for updating the contents of Redux-ORM ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
🎉 This issue has been resolved in version 0.4.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
🎉 This issue has been resolved in version 0.3.1 🎉
The release is available on:
Your semantic-release bot 📦🚀