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

Subtree lifecycle hooks #16

Open
hansihe opened this issue Dec 21, 2022 · 0 comments
Open

Subtree lifecycle hooks #16

hansihe opened this issue Dec 21, 2022 · 0 comments

Comments

@hansihe
Copy link
Owner

hansihe commented Dec 21, 2022

In order to support things like stateful components or to support phx-update/temporary assigns on top of managed data structures, we need the ability to support subtree lifecycle hooks.

This would enable us to run custom code for the following events:

  • A subtree has been created
  • A subtree has changed
  • A subtree has been destroyed

For stateful components, the mapping would be as follows:

  • Subtree created -> create the stateful component
  • Subtree changed -> rerender the stateful component
  • Subtree destroyed -> destroy the stateful component

Likewise, for phx-update/temporary assigns:

  • Subtree created -> create the managed data structure
  • Subtree changed -> perform append/prepend to the ClientList
  • Subtree destroyed -> destroy the managed data structure
@hansihe hansihe added this to the Production Ready milestone Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant