hansihe / hansihe/live_data

Subtree lifecycle hooks

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
short term
Dominant language
Elixir
Stars
119
Forks
2
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.