Skip to content

Create hook to react to all tree changes #302

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

Open
downright-development opened this issue Apr 6, 2025 · 1 comment
Open

Create hook to react to all tree changes #302

downright-development opened this issue Apr 6, 2025 · 1 comment

Comments

@downright-development
Copy link

I'd love to see a single hook to react to all tree changes.

Use case -
I want the tree to handle add move delete rename internally, because quite frankly it's a PITA to manage, and a single hook where I can get the latest tree back.
I'm store the entire tree as a single json document and it'd be far easier to just upsert the tree.

@downright-development
Copy link
Author

Update - I ended up just implementing all of the handler functions and it's working well, I saw the 'effect' of what I wanted was capable if I used a simpleTree.. but I quickly outgrew that.

(i.e.,

const {treeItems, controller} = useSimpleTree(initialData);

It would still be nice to to expose a hook "onPresenceChange" or something that callers could react to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant