refactor(createTypographyControl): createControlStore rewrote to runes
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import {
|
||||
type ControlModel,
|
||||
createTypographyControl,
|
||||
} from '$shared/lib';
|
||||
|
||||
export function createTypographyControlManager(configs: ControlModel[]) {
|
||||
const controls = $state(
|
||||
configs.map(({ id, increaseLabel, decreaseLabel, controlLabel, ...config }) => ({
|
||||
id,
|
||||
increaseLabel,
|
||||
decreaseLabel,
|
||||
controlLabel,
|
||||
instance: createTypographyControl(config),
|
||||
})),
|
||||
);
|
||||
|
||||
return {
|
||||
get controls() {
|
||||
return controls;
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user