Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking dependencies of Signals #543

Open
saona-raimundo opened this issue Dec 14, 2022 · 0 comments
Open

Tracking dependencies of Signals #543

saona-raimundo opened this issue Dec 14, 2022 · 0 comments
Labels
A-reactivity Area: reactivity and state handling C-enhancement Category: new feature or improvement to existing feature

Comments

@saona-raimundo
Copy link

Feature request

In not-so-small apps, it is easy to lose sight of the effects an event can have. In particular, all the signals that are tracking a given signal. I would like to know if there is a way to obtain a "dependency tree" for a given Signal showing all signals that are tracking a given Signal and how its changes are tracked. I was thinking of a tree of dependencies. Then, the order of execution would be given in the order of the tree.

Current solution

One thing I can think of is to attach an effect to every Signal in your app and log a message upon change. Then, changing a Signal would trigger all its listeners to log a message. This retrieves all dependent nodes, but not the order of execution as a tree, just a possible trace.

Use cases

Things I would do with such a dependency tree:

  1. Detect cycles. Note that cycles may not be obvious if there is a control flow in the behaviour.
  2. Debug reactivity. One could look at the effect of one event in a simpler way.
  3. Disable UI. If reacting to a Signal's change takes too long, I would like to disable only the affected UI. This would also signal "we are working on your request" in all the relevant parts of the UI for the particular firing event.
@lukechu10 lukechu10 added C-enhancement Category: new feature or improvement to existing feature A-reactivity Area: reactivity and state handling labels Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-reactivity Area: reactivity and state handling C-enhancement Category: new feature or improvement to existing feature
Projects
None yet
Development

No branches or pull requests

2 participants