Open History to see the last commit
1---
2id: __storeToDerived
3title: __storeToDerived
4---
5β
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7β
8# Variable: \_\_storeToDerived
9β
10```ts
11const __storeToDerived: WeakMap<Store<unknown, (cb) => unknown>, Set<Derived<unknown, readonly any[]>>>;
12```
13β
14Defined in: [scheduler.ts:19](https://github.com/TanStack/store/blob/main/packages/store/src/scheduler.ts#L19)
15β
16This is here to solve the pyramid dependency problem where:
17 A
18 / \
19 B C
20 \ /
21 D
22β
23Where we deeply traverse this tree, how do we avoid D being recomputed twice; once when B is updated, once when C is.
24β
25To solve this, we create linkedDeps that allows us to sync avoid writes to the state until all of the deps have been
26resolved.
27β
28This is a record of stores, because derived stores are not able to write values to, but stores are