Remove Derivation.changesWithoutValues()
And replace it with `Derivation.onStale()`
This commit is contained in:
parent
9094e3041e
commit
5c1aa1cd50
13 changed files with 19 additions and 916 deletions
|
@ -49,7 +49,7 @@ export default class AudioPlaybackController implements IPlaybackController {
|
|||
|
||||
// We're keeping the rangeD hot, so we can read from it on every tick without
|
||||
// causing unnecessary recalculations
|
||||
const untapFromRangeD = rangeD.changesWithoutValues().tap(play)
|
||||
const untapFromRangeD = rangeD.onStale(play)
|
||||
play()
|
||||
|
||||
this._stopPlayCallback = () => {
|
||||
|
|
|
@ -283,9 +283,9 @@ export default class SheetObject implements IdentityDerivationProvider {
|
|||
interpolate(left, right, triple.progression),
|
||||
)
|
||||
}
|
||||
const untap = derivation
|
||||
.changesWithoutValues()
|
||||
.tap(updateSequenceValueFromItsDerivation)
|
||||
const untap = derivation.onStale(
|
||||
updateSequenceValueFromItsDerivation,
|
||||
)
|
||||
|
||||
updateSequenceValueFromItsDerivation()
|
||||
untaps.push(untap)
|
||||
|
|
|
@ -15,7 +15,7 @@ export default class PaneManager {
|
|||
|
||||
private _instantiatePanesAsTheyComeIn() {
|
||||
const allPanesD = this._getAllPanes()
|
||||
allPanesD.changesWithoutValues().tap(() => {
|
||||
allPanesD.onStale(() => {
|
||||
allPanesD.getValue()
|
||||
})
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ export class Studio {
|
|||
}
|
||||
}
|
||||
}
|
||||
projectsD.changesWithoutValues().tap(() => {
|
||||
projectsD.onStale(() => {
|
||||
attachToProjects(projectsD.getValue())
|
||||
})
|
||||
attachToProjects(projectsD.getValue())
|
||||
|
|
|
@ -311,7 +311,7 @@ function useUpdateScrollFromClippedSpaceRange(
|
|||
const rangeStartInScaledSpace = d.getValue()
|
||||
node.scrollLeft = rangeStartInScaledSpace
|
||||
}
|
||||
const untap = d.changesWithoutValues().tap(update)
|
||||
const untap = d.onStale(update)
|
||||
|
||||
update()
|
||||
const timeout = setTimeout(update, 100)
|
||||
|
|
|
@ -29,7 +29,7 @@ export const useTooltipOpenState = (): [
|
|||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
return cur.changesWithoutValues().tap(() => {
|
||||
return cur.onStale(() => {
|
||||
const flag = cur.getValue() === id
|
||||
|
||||
if (isOpenRef.current !== flag) isOpenRef.current = flag
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue