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

What should I do if I want to watch the entire subtree? #10

Open
Ajamuar opened this issue Oct 29, 2020 · 1 comment
Open

What should I do if I want to watch the entire subtree? #10

Ajamuar opened this issue Oct 29, 2020 · 1 comment

Comments

@Ajamuar
Copy link

Ajamuar commented Oct 29, 2020

In the current documentations of useDocs, there is a mention that it watches the tree up to a given depth. Is there any way we can watch the entire subtree?

@himanshu-satija
Copy link
Member

By "watches", we mean it rerenders the React component where you use useDoc hook, whenever the updates occur until the given depth. Explained in detail here.

If you want to subscribe your component to updates on the whole tree, you can do this

useDoc("", Infinity)

This is not recommended though.

If you just want to observe changes somewhere, not necessarily a React component, you can use observe with depth Infinity.

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

2 participants