Skip to content

Commit

Permalink
ci: apply automated fixes and generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored and crutchcorn committed Dec 26, 2024
1 parent 01a1422 commit e6cdf83
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/reference/functions/batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ function batch(fn): void

## Defined in

[scheduler.ts:120](https://github.com/TanStack/store/blob/main/packages/store/src/scheduler.ts#L120)
[scheduler.ts:129](https://github.com/TanStack/store/blob/main/packages/store/src/scheduler.ts#L129)
22 changes: 11 additions & 11 deletions packages/store/src/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,26 @@ function __flush_internals(relatedVals: Set<Derived<unknown>>) {
// First sort deriveds by dependency order
const sorted = Array.from(relatedVals).sort((a, b) => {
// If a depends on b, b should go first
if (a instanceof Derived && a.options.deps.includes(b)) return 1;
if (a instanceof Derived && a.options.deps.includes(b)) return 1
// If b depends on a, a should go first
if (b instanceof Derived && b.options.deps.includes(a)) return -1;
return 0;
});
if (b instanceof Derived && b.options.deps.includes(a)) return -1
return 0
})

for (const derived of sorted) {
if (__depsThatHaveWrittenThisTick.current.includes(derived)) {
continue;
continue
}

__depsThatHaveWrittenThisTick.current.push(derived);
derived.recompute();
__depsThatHaveWrittenThisTick.current.push(derived)
derived.recompute()

const stores = __derivedToStore.get(derived);
const stores = __derivedToStore.get(derived)
if (stores) {
for (const store of stores) {
const relatedLinkedDerivedVals = __storeToDerived.get(store);
if (!relatedLinkedDerivedVals) continue;
__flush_internals(relatedLinkedDerivedVals);
const relatedLinkedDerivedVals = __storeToDerived.get(store)
if (!relatedLinkedDerivedVals) continue
__flush_internals(relatedLinkedDerivedVals)
}
}
}
Expand Down

0 comments on commit e6cdf83

Please sign in to comment.