Skip to content

Commit

Permalink
fix: make set theme callback param optional (#17)
Browse files Browse the repository at this point in the history
* fix: run prepublishOnly before publish (#16)

* Fix: Make setTheme callback param optional

---------

Co-authored-by: Tobias Høegh <tobias@tujo.no>
Co-authored-by: Ahmet Acer <ahmet.acer@dnb.no>
  • Loading branch information
3 people authored Oct 11, 2023
1 parent da3368e commit e62ae54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ import {

// Example usage
setTheme({ name })
// or with callback
setTheme({ name }, (theme: ThemesItem) =>
console.log(`Theme updated to: ${theme.name}`)
)

const { name } = getTheme()
const themes = getThemes() // Same as in the plugin config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function getTheme(): ThemesItem {

export function setTheme(
themeProps: { name?: string; propMapping?: PropMapping },
callback
callback?
) {
const theme = { ...getTheme(), ...themeProps } as ThemesItem

Expand Down

0 comments on commit e62ae54

Please sign in to comment.