question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide a way to change ability for the whole nested tree of components

See original GitHub issue

use 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 add destroyed hook and potentially may require functional Can 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 into computed property (in order to have single source of truth for provided ability). This property will take value from injections

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
stalniycommented, Jun 1, 2018

🎉 This issue has been resolved in version 0.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

0reactions
stalniycommented, Jul 2, 2018

🎉 This issue has been resolved in version 0.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found