createComputed, one dependency changes quickly the first dependencies first reactivity is lost
this is a solidjs createComputed, there are 2 dependencies, stockfish.pvs object and fen().
The problem is when fen() changes in quick succession without waiting for the stockfish.pvs dependencies lookup for the first fen, the reactivity from the first fen and the stockfish.pvs's lookup on the first fen is lost.
I expected that no matter how many times and whenever fen changes, every change of fen and every log of 'dep' has a resulting resolution with a callback to
on_fen_eval_request_resolved
.
Here is an MVP: https://playground.solidjs.com/anonymous/095701fc-c776-4158-aa38-b21d09746406
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
3 Replies
It is unclear what is the problem, the callback is always called you are just not logging it if its undefined

but on this line:
set_b_store("bb", 2, "two")
, the a 2 and b 'two' are both defined so I am losing a [2, 'two'], it quickly jumps to [3, 'three']That they are defined doesn't mean anything, you are changing what is supposed to be tracked, the combination of signal that is reactive used as index in a store that is also reactive, but granular reactivity inside the store means that only accessed values will be tracked. It was unclear what your goal was. I still don't understand what is the point of the signal. There are 3 ways i can interpret your problem.
1. Either you want to have a reactive array where you want to have control of which indexes are tracked. Then you can have a function trackAtIndex that crates new createComputed for index that was used as parameter.
2. Or perhaps more complex version where you can add and also remove indexes that will be tracked.
3. Or you just want to track some index until the first change that occurs at that index and than stop tracking it
or if at the time of the call it is already defined call it immediately without tracking?
in that case look at https://playground.solidjs.com/anonymous/1a6c663f-d9df-4d3a-8129-9cd14d3b7a5b the already defined reactions will call the callback sooner because of how set store is implemented
4. Maybe different interpretation?
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template