Skip to content

Commit 650bbf7

Browse files
committed
update store and memoized function
1 parent 2f8afc1 commit 650bbf7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

chartlets.js/packages/lib/src/actions/helpers/getInputValues.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ import { isObject } from "@/utils/isObject";
1515
import type { HostStore } from "@/types/state/host";
1616
import memoize from "fast-memoize";
1717

18-
export function getInputValues(
18+
export const getInputValues = memoize(_getInputValues);
19+
20+
export function _getInputValues(
1921
inputs: Input[],
2022
contributionState: ContributionState,
2123
hostStore?: HostStore,
@@ -27,9 +29,7 @@ export function getInputValues(
2729

2830
const noValue = {};
2931

30-
export const getInputValue = memoize(_getInputValue);
31-
32-
function _getInputValue(
32+
function getInputValue(
3333
input: Input,
3434
contributionState: ContributionState,
3535
hostStore?: HostStore,

chartlets.js/packages/lib/src/store.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ export const store = create<StoreState>(() => ({
77
extensions: [],
88
contributionsResult: {},
99
contributionsRecord: {},
10+
lastInputValues: {},
1011
}));

0 commit comments

Comments
 (0)