Open ingoandelhofs opened 1 year ago
const dispatch = () => {
}
export const ctx = (contextValue: any) => {
const updateSize = useCallback(
(size: number) => contextValue.dispatch({type: "updateSize", data: {size}}),
[contextValue],
);
const updateSpacing = useCallback(
(spacing: number) => contextValue.dispatch({type: "updateSpacing", data: {spacing}}),
[contextValue],
);
return {
updateSize,
updateSpacing,
}
}
const {useContext, useContextSelector, ContextProvider} = generateMemoizedContext();