Skip to content

Commit 9e95cdc

Browse files
committed
revert-chart-store
1 parent 2b791e1 commit 9e95cdc

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/x-charts/src/internals/plugins/utils/ChartStore.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ChartState } from '../models/chart';
22
import type { ChartAnyPluginSignature } from '../models/plugin';
33

4-
type Listener<T> = (value: T, prevValue: T) => void;
4+
type Listener<T> = (value: T) => void;
55

66
export type StoreUpdater<
77
TSignatures extends readonly ChartAnyPluginSignature[],
@@ -37,9 +37,8 @@ export class ChartStore<
3737
public update = (updater: StoreUpdater<TSignatures, TOptionalSignatures>) => {
3838
const newState = updater(this.value);
3939
if (newState !== this.value) {
40-
const prevValue = this.value;
4140
this.value = newState;
42-
this.listeners.forEach((l) => l(newState, prevValue));
41+
this.listeners.forEach((l) => l(newState));
4342
}
4443
};
4544
}

0 commit comments

Comments
 (0)