@dndbuilder.com/react
Version:
Drag and drop builder for React
25 lines (24 loc) • 820 B
JavaScript
import { setSelectedBlockSettingsValueByKey as r, setSelectedBlockAdvancedSettingsValueByKey as c } from "../store/builder-slice.js";
import { getSettingsValueByKey as u } from "../../../../store/selectors.js";
import { useAppDispatch as m } from "./use-app-dispatch.js";
import { useAppSelector as p } from "./use-app-selector.js";
import { setActiveThemeSettingsValueByKey as S } from "../store/theme-slice.js";
const V = (t, e) => {
const i = p(u(t, e)), s = m();
return [i, (o) => {
const n = typeof o == "function" ? o(i) : o;
if (e === "block") {
s(r([{ key: t, value: n }]));
return;
}
if (e === "advanced") {
s(c([{ key: t, value: n }]));
return;
}
s(S([{ key: t, value: n }]));
}];
};
export {
V as useSettings
};
//# sourceMappingURL=use-settings.js.map