Dependent Queries
Are there any good examples out there of dependent queries in solid? Mostly confused about the process of setting the enabled option correctly.
5 Replies
deep-jade•3y ago
Hello! Yeah we plan to roll out more detailed documentation for solid query soon. But here is a small example
deep-jade•3y ago
In this example,
second
query will only be enabled when first
query is a success and first.data
is defineddeep-jade•3y ago
We are using the object getter syntax here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get to make the
enabled
property reactive to changesgetter - JavaScript | MDN
The get syntax binds an object property to a function
that will be called when that property is looked up.
rare-sapphireOP•3y ago
Awesome, thanks