Order of createAsync in component changes results
I'm getting results that make no sense. This sample SolidStart app has two databases
lettersDb and numbersDb. They are simple an array with methods for get and set. The arrays of numbers is rendered to routes/index.js. The problem is that it only renders letters or numbers. That is:
If I have the createAsync calls with numbers first, both letters and numbers renders numbers.
https://github.com/klequis/data-flow/blob/main/onlyNumbers.png)
If I reverse the order of the createAsync calls then only letters will render.
https://github.com/klequis/data-flow/blob/main/onlyLetters.png
routes/index.js
The sample project is here: https://github.com/klequis/data-flowGitHub
data-flow/onlyLetters.png at main · klequis/data-flow
Contribute to klequis/data-flow development by creating an account on GitHub.
GitHub
GitHub - klequis/data-flow
Contribute to klequis/data-flow development by creating an account on GitHub.
2 Replies
You need to add a unique name for each of your queries as a second param for the
query function. You don't have it in your sample project, maybe the problem comes from that, you put all your data in the same cache slot without a name.Oops, oversight. Thank you for the catch!