We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2b791e1 commit 9e95cdcCopy full SHA for 9e95cdc
1 file changed
packages/x-charts/src/internals/plugins/utils/ChartStore.ts
@@ -1,7 +1,7 @@
1
import type { ChartState } from '../models/chart';
2
import type { ChartAnyPluginSignature } from '../models/plugin';
3
4
-type Listener<T> = (value: T, prevValue: T) => void;
+type Listener<T> = (value: T) => void;
5
6
export type StoreUpdater<
7
TSignatures extends readonly ChartAnyPluginSignature[],
@@ -37,9 +37,8 @@ export class ChartStore<
37
public update = (updater: StoreUpdater<TSignatures, TOptionalSignatures>) => {
38
const newState = updater(this.value);
39
if (newState !== this.value) {
40
- const prevValue = this.value;
41
this.value = newState;
42
- this.listeners.forEach((l) => l(newState, prevValue));
+ this.listeners.forEach((l) => l(newState));
43
}
44
};
45
0 commit comments