Skip to content

Commit

Permalink
refactor: use Object.values instead of Object.entries
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-solanki committed Feb 21, 2023
1 parent a56851a commit e317f4d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/anu-vue/src/composables/useAnu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import type { ConfigThemes, PluginOptions } from '../plugin'
import { createCustomGlobalState } from '@/composables/useCustomCreateGlobalState'

const getThemeColorsCss = (themes: ConfigThemes) => {
return Object.entries(themes)
.map(
([themeName, theme]) => `${theme.class ? `.${theme.class}` : ':root'}{${Object.entries(theme.colors).concat(Object.entries(theme.cssVars)).map(([varName, val]) => `--a-${varName}:${val};`).join('')}}`,
)
return Object.values(themes)
.map(theme => `${theme.class ? `.${theme.class}` : ':root'}{${Object.entries(theme.colors).concat(Object.entries(theme.cssVars)).map(([varName, val]) => `--a-${varName}:${val};`).join('')}}`)
.join('')
}

Expand All @@ -15,8 +13,6 @@ export interface AnuComposableOptions {
}

export const useAnu = createCustomGlobalState((options: AnuComposableOptions) => {
console.log('useAnu called with options', options)

const themes = ref(options.themes)
const activeThemeName = ref(options.initialTheme)
const activeTheme = computed(() => ({
Expand Down

0 comments on commit e317f4d

Please sign in to comment.